From 4ecc0d9f154bea00f000afca40a4f4ef03d7392a Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 2 Apr 2003 09:01:33 -0500 Subject: If display is not set, do not attempt to run application --- Tests/Wrapping/qtwrappingmain.cxx | 26 +++++++++++++++++++++----- 1 file 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 #include "qtwrapping.h" +#ifndef _WIN32 +# include +# include +#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; } -- cgit v0.12