summaryrefslogtreecommitdiffstats
path: root/Tests/Wrapping/qtwrappingmain.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-04-02 14:01:33 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-04-02 14:01:33 (GMT)
commit4ecc0d9f154bea00f000afca40a4f4ef03d7392a (patch)
tree5ea5bdf31c5fb3f4fc20a59da99ce1ad37a735ab /Tests/Wrapping/qtwrappingmain.cxx
parentded93e30e633af1821bd7f3b148b6deb910bd454 (diff)
downloadCMake-4ecc0d9f154bea00f000afca40a4f4ef03d7392a.zip
CMake-4ecc0d9f154bea00f000afca40a4f4ef03d7392a.tar.gz
CMake-4ecc0d9f154bea00f000afca40a4f4ef03d7392a.tar.bz2
If display is not set, do not attempt to run application
Diffstat (limited to 'Tests/Wrapping/qtwrappingmain.cxx')
-rw-r--r--Tests/Wrapping/qtwrappingmain.cxx26
1 files changed, 21 insertions, 5 deletions
diff --git a/Tests/Wrapping/qtwrappingmain.cxx b/Tests/Wrapping/qtwrappingmain.cxx
index 81ddaf4..fabecfc 100644
--- a/Tests/Wrapping/qtwrappingmain.cxx
+++ b/Tests/Wrapping/qtwrappingmain.cxx
@@ -1,13 +1,29 @@
#include <qapplication.h>
#include "qtwrapping.h"
+#ifndef _WIN32
+# include <stdlib.h>
+# include <stdio.h>
+#endif
+
int main(int argc, char *argv[])
{
+#ifndef _WIN32
+ const char* display = getenv("DISPLAY");
+ if ( display && strlen(display)>0 )
+ {
+#endif
+ QApplication app(argc,argv);
-QApplication app(argc,argv);
-
-qtwrapping qtw;
-app.setMainWidget(&qtw);
+ qtwrapping qtw;
+ app.setMainWidget(&qtw);
+#ifndef _WIN32
+ }
+ else
+ {
+ printf("Environment variable DISPLAY is not set. I will pretend like the test passed, but you should really set it.\n");
+ }
+#endif
-return 0;
+ return 0;
}