From c21637a01db7f6958c816bfe2a8b0383b96e8f68 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Wed, 16 Apr 2014 22:38:29 +0300 Subject: [PATCH] Fixed unity builds for Qt5. --- backends.py | 3 ++- run_tests.py | 4 +++- test cases/frameworks/4 qt5/mainWindow.h | 5 +++++ test cases/frameworks/4 qt5/meson.build | 2 +- test cases/frameworks/4 qt5/stuff.qrc | 1 + test cases/frameworks/4 qt5/stuff2.qrc | 5 ----- 6 files changed, 12 insertions(+), 8 deletions(-) delete mode 100644 test cases/frameworks/4 qt5/stuff2.qrc diff --git a/backends.py b/backends.py index e7b6a9cc2..55f31925d 100644 --- a/backends.py +++ b/backends.py @@ -218,7 +218,8 @@ class Backend(): for src in gen_src_deps: src_list.append(src) if is_unity: - unity_src.append(src) + unity_src.append(os.path.join(self.environment.get_build_dir(), src)) + header_deps.append(src) else: # Generated targets are ordered deps because the must exist # before the sources compiling them are used. After the first diff --git a/run_tests.py b/run_tests.py index 96fff21dd..4ca0659e3 100755 --- a/run_tests.py +++ b/run_tests.py @@ -25,6 +25,7 @@ test_build_dir = 'work area' install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install dir') meson_command = './meson.py' +unity_flags = ['--unity'] msbuild_exe = shutil.which('msbuild') if msbuild_exe is not None: @@ -107,7 +108,8 @@ def run_test(testdir, should_succeed): os.mkdir(test_build_dir) os.mkdir(install_dir) print('Running test: ' + testdir) - gen_command = [sys.executable, meson_command, '--prefix', install_dir, testdir, test_build_dir] + backend_flags + gen_command = [sys.executable, meson_command, '--prefix', install_dir, testdir, test_build_dir]\ + + unity_flags + backend_flags p = subprocess.Popen(gen_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdo, stde) = p.communicate() stdo = stdo.decode('utf-8') diff --git a/test cases/frameworks/4 qt5/mainWindow.h b/test cases/frameworks/4 qt5/mainWindow.h index fc6b24598..82d8c7694 100644 --- a/test cases/frameworks/4 qt5/mainWindow.h +++ b/test cases/frameworks/4 qt5/mainWindow.h @@ -1,3 +1,6 @@ +#ifndef MES_MAINWINDOW +#define MES_MAINWINDOW + #include #include #include "ui_mainWindow.h" @@ -13,3 +16,5 @@ public: private: }; + +#endif diff --git a/test cases/frameworks/4 qt5/meson.build b/test cases/frameworks/4 qt5/meson.build index 3f0770ec7..cda27aecb 100644 --- a/test cases/frameworks/4 qt5/meson.build +++ b/test cases/frameworks/4 qt5/meson.build @@ -6,7 +6,7 @@ q5exe = executable('qt5app', sources : ['main.cpp', 'mainWindow.cpp'], # Sources that don't need preprocessing. moc_headers : ['mainWindow.h'], # These need to be fed through the moc tool before use. ui_files : 'mainWindow.ui', # XML files that need to be compiled with the uic tol. -qresources : ['stuff.qrc', 'stuff2.qrc'], # Resource files for rcc compiler. +qresources : 'stuff.qrc', # Resource file for rcc compiler. deps : qt5dep) # We need a console test application because some test environments diff --git a/test cases/frameworks/4 qt5/stuff.qrc b/test cases/frameworks/4 qt5/stuff.qrc index cd1c6b54e..48f8fda3b 100644 --- a/test cases/frameworks/4 qt5/stuff.qrc +++ b/test cases/frameworks/4 qt5/stuff.qrc @@ -1,5 +1,6 @@ thing.png + thing2.png diff --git a/test cases/frameworks/4 qt5/stuff2.qrc b/test cases/frameworks/4 qt5/stuff2.qrc deleted file mode 100644 index b7199197b..000000000 --- a/test cases/frameworks/4 qt5/stuff2.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - thing2.png - -