From 7c8c4ccf430dacee8a16bbeceea4cef905be7c09 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 23 Apr 2018 23:26:40 +0200 Subject: [PATCH] Fixed main app unit test for non-qtbinding build. --- testdata/klayout_main/main.rb | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/testdata/klayout_main/main.rb b/testdata/klayout_main/main.rb index 5c68ddebe..228f5d44a 100644 --- a/testdata/klayout_main/main.rb +++ b/testdata/klayout_main/main.rb @@ -60,14 +60,25 @@ class KLayoutMain_TestClass < TestBase def test_4 # Application class + if !RBA.constants.find { |x| x == :QDialog } - # QCoreApplication for (headless) mode - out = `./klayout -b -r #{File.join(File.dirname(__FILE__), "test_app.rb")}` - assert_equal(out, "RBA::Application superclass RBA::QCoreApplication_Native\nMainWindow is not there\n") + out = `./klayout -b -r #{File.join(File.dirname(__FILE__), "test_app.rb")}` + assert_equal(out, "RBA::Application superclass Object\nMainWindow is not there\n") - # QApplication for GUI mode - out = `./klayout -z -nc -rx -r #{File.join(File.dirname(__FILE__), "test_app.rb")}` - assert_equal(out, "RBA::Application superclass RBA::QApplication_Native\nMainWindow is there\n") + out = `./klayout -z -nc -rx -r #{File.join(File.dirname(__FILE__), "test_app.rb")}` + assert_equal(out, "RBA::Application superclass Object\nMainWindow is there\n") + + else + + # QCoreApplication for (headless) mode + out = `./klayout -b -r #{File.join(File.dirname(__FILE__), "test_app.rb")}` + assert_equal(out, "RBA::Application superclass RBA::QCoreApplication_Native\nMainWindow is not there\n") + + # QApplication for GUI mode + out = `./klayout -z -nc -rx -r #{File.join(File.dirname(__FILE__), "test_app.rb")}` + assert_equal(out, "RBA::Application superclass RBA::QApplication_Native\nMainWindow is there\n") + + end end