From f89d20ac2700229805b94be923f2247cad5774a7 Mon Sep 17 00:00:00 2001 From: Leandre Arseneault Date: Mon, 11 Jul 2016 13:25:16 -0400 Subject: [PATCH 01/12] New facade QTestLibFacade --- pytest_cpp/plugin.py | 4 +- pytest_cpp/qt.py | 107 +++++++++++++++++++++++++++++++++++++++ tests/test_pytest_cpp.py | 12 +++-- 3 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 pytest_cpp/qt.py diff --git a/pytest_cpp/plugin.py b/pytest_cpp/plugin.py index d544ff4..0c60b95 100644 --- a/pytest_cpp/plugin.py +++ b/pytest_cpp/plugin.py @@ -8,7 +8,9 @@ from pytest_cpp.google import GoogleTestFacade -FACADES = [GoogleTestFacade, BoostTestFacade] +from pytest_cpp.qt import QTestLibFacade + +FACADES = [GoogleTestFacade, BoostTestFacade, QTestLibFacade] DEFAULT_MASKS = ('test_*', '*_test') diff --git a/pytest_cpp/qt.py b/pytest_cpp/qt.py new file mode 100644 index 0000000..d338d3d --- /dev/null +++ b/pytest_cpp/qt.py @@ -0,0 +1,107 @@ +import os +import subprocess +import tempfile +from xml.etree import ElementTree +import io +import shutil +from pytest_cpp.error import CppTestFailure + + +class QTestLibFacade(object): + """ + Facade for QTestLib. + """ + + @classmethod + def is_test_suite(cls, executable): + try: + output = subprocess.check_output([executable, '--help'], + stderr=subprocess.STDOUT, + universal_newlines=True) + except (subprocess.CalledProcessError, OSError): + return False + else: + return '-csv' in output + + def run_test(self, executable, test_id): + + def read_file(name): + try: + with io.open(name) as f: + return f.read() + except IOError: + return None + + temp_dir = tempfile.mkdtemp() + log_xml = os.path.join(temp_dir, 'log.xml') + args = [ + executable, + '-o log_xml, xml', + ] + p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + stdout, _ = p.communicate() + + log = read_file(log_xml) + + if p.returncode not in (0, 200, 201): + msg = ('Internal Error: calling {executable} ' + 'for test {test_id} failed (returncode={returncode}):\n' + 'output:{stdout}\n' + 'log:{log}\n') + failure = QTestFailure( + '', + linenum=0, + contents=msg.format(executable=executable, + test_id=test_id, + stdout=stdout, + log=log, + returncode=p.returncode)) + return [failure] + + results = self._parse_log(log=log) + shutil.rmtree(temp_dir) + if results: + return results + + def _parse_log(self, log): + """ + Parse the "log" section produced by BoostTest. + + This is always a XML file, and from this we produce most of the + failures possible when running BoostTest. + """ + # Fatal errors apparently generate invalid xml in the form: + # ...... + # so we have to manually split it into two xmls if that's the case. + parsed_elements = [] + if log.startswith('') + fatal += '' # put it back, removed by split() + fatal_root = ElementTree.fromstring(fatal) + fatal_root.text = 'Fatal Error: %s' % fatal_root.text + parsed_elements.append(fatal_root) + + log_root = ElementTree.fromstring(log) + parsed_elements.extend(log_root.findall('Exception')) + parsed_elements.extend(log_root.findall('Error')) + + result = [] + for elem in parsed_elements: + filename = elem.attrib['file'] + linenum = int(elem.attrib['line']) + result.append(QTestFailure(filename, linenum, elem.text)) + return result + + +class QTestFailure(CppTestFailure): + def __init__(self, filename, linenum, contents): + self.filename = filename + self.linenum = linenum + self.lines = contents.splitlines() + + def get_lines(self): + m = ('red', 'bold') + return [(x, m) for x in self.lines] + + def get_file_reference(self): + return self.filename, self.linenum diff --git a/tests/test_pytest_cpp.py b/tests/test_pytest_cpp.py index 4648ebe..3061ea9 100644 --- a/tests/test_pytest_cpp.py +++ b/tests/test_pytest_cpp.py @@ -4,6 +4,7 @@ from pytest_cpp.boost import BoostTestFacade from pytest_cpp.error import CppTestFailure, CppFailureRepr from pytest_cpp.google import GoogleTestFacade +from pytest_cpp.qt import QTestLibFacade def assert_outcomes(result, expected_outcomes): @@ -143,9 +144,10 @@ def test_google_run(testdir, exes): ('FooTest.DISABLED_test_disabled', 'skipped'), ]) + def test_unknown_error(testdir, exes, mocker): mocker.patch.object(GoogleTestFacade, 'run_test', - side_effect=RuntimeError('unknown error')) + side_effect=RuntimeError('unknown error')) result = testdir.inline_run('-v', exes.get('gtest', 'test_gtest')) rep = result.matchreport('FooTest.test_success', 'pytest_runtest_logreport') assert 'unknown error' in str(rep.longrepr) @@ -154,9 +156,9 @@ def test_unknown_error(testdir, exes, mocker): def test_google_internal_errors(mocker, testdir, exes, tmpdir): mocker.patch.object(GoogleTestFacade, 'is_test_suite', return_value=True) mocker.patch.object(GoogleTestFacade, 'list_tests', - return_value=['FooTest.test_success']) + return_value=['FooTest.test_success']) mocked = mocker.patch.object(subprocess, 'check_output', autospec=True, - return_value='') + return_value='') def raise_error(*args, **kwargs): raise subprocess.CalledProcessError(returncode=100, cmd='') @@ -170,7 +172,7 @@ def raise_error(*args, **kwargs): xml_file = tmpdir.join('results.xml') xml_file.write('') mocker.patch.object(GoogleTestFacade, '_get_temp_xml_filename', - return_value=str(xml_file)) + return_value=str(xml_file)) result = testdir.inline_run('-v', exes.get('gtest', 'test_gtest')) rep = result.matchreport(exes.exe_name('test_gtest'), 'pytest_runtest_logreport') @@ -220,7 +222,7 @@ def test_cpp_failure_repr(dummy_failure): def test_cpp_files_option(testdir, exes): exes.get('boost_success') exes.get('gtest') - + result = testdir.inline_run('--collect-only') reps = result.getreports() assert len(reps) == 1 From fa370372691c4bf2046ecd41590b9a102e88db82 Mon Sep 17 00:00:00 2001 From: Jonathan Roy Date: Tue, 12 Jul 2016 10:24:21 -0400 Subject: [PATCH 02/12] Fix some part of the qttestlib facade to match qttestlib exec --- pytest_cpp/qt.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pytest_cpp/qt.py b/pytest_cpp/qt.py index d338d3d..bff3554 100644 --- a/pytest_cpp/qt.py +++ b/pytest_cpp/qt.py @@ -15,7 +15,7 @@ class QTestLibFacade(object): @classmethod def is_test_suite(cls, executable): try: - output = subprocess.check_output([executable, '--help'], + output = subprocess.check_output([executable, '-help'], stderr=subprocess.STDOUT, universal_newlines=True) except (subprocess.CalledProcessError, OSError): @@ -23,6 +23,11 @@ def is_test_suite(cls, executable): else: return '-csv' in output + def list_tests(self, executable): + # unfortunately boost doesn't provide us with a way to list the tests + # inside the executable, so the test_id is a dummy placeholder :( + return [os.path.basename(os.path.splitext(executable)[0])] + def run_test(self, executable, test_id): def read_file(name): @@ -36,7 +41,8 @@ def read_file(name): log_xml = os.path.join(temp_dir, 'log.xml') args = [ executable, - '-o log_xml, xml', + "-o", + "{xml_file},xunitxml".format(xml_file=log_xml), ] p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout, _ = p.communicate() From 3031e3958747df7ef02ed42d6d90e3a568acde96 Mon Sep 17 00:00:00 2001 From: Leandre Arseneault Date: Thu, 14 Jul 2016 10:09:13 -0400 Subject: [PATCH 03/12] Log files merged --- pytest_cpp/qt.py | 85 ++++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 31 deletions(-) diff --git a/pytest_cpp/qt.py b/pytest_cpp/qt.py index bff3554..a6e1ddd 100644 --- a/pytest_cpp/qt.py +++ b/pytest_cpp/qt.py @@ -1,10 +1,12 @@ import os import subprocess import tempfile -from xml.etree import ElementTree import io import shutil +import copy +import fnmatch from pytest_cpp.error import CppTestFailure +import xml.etree.ElementTree as ET class QTestLibFacade(object): @@ -29,7 +31,6 @@ def list_tests(self, executable): return [os.path.basename(os.path.splitext(executable)[0])] def run_test(self, executable, test_id): - def read_file(name): try: with io.open(name) as f: @@ -47,9 +48,44 @@ def read_file(name): p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout, _ = p.communicate() + matches = [] + for root, dirnames, filenames in os.walk(temp_dir): + for filename in filenames: + if filename.endswith('.xml'): + matches.append(os.path.join(root, filename)) + failures = 0 + tests = 0 + errors = 0 + cases = [] + suites = [] + + for file_name in matches: + tree = ET.parse(file_name) + test_suite = tree.getroot() + failures += int(test_suite.attrib['failures']) + tests += int(test_suite.attrib['tests']) + errors += int(test_suite.attrib['errors']) + cases.append(test_suite.getchildren()) + suites.append(test_suite) + + new_root = ET.Element('testsuites') + new_root.attrib['failures'] = '%s' % failures + new_root.attrib['tests'] = '%s' % tests + new_root.attrib['errors'] = '%s' % errors + + for suite in suites: + new_root.append(suite) + + new_tree = ET.ElementTree(new_root) + new_tree.write(os.path.join(temp_dir, "result-merged.xml"), + encoding="UTF-8", + xml_declaration=True) + + log_xml = os.path.join(temp_dir, "result-merged.xml") + log = read_file(log_xml) - if p.returncode not in (0, 200, 201): + if p.returncode not in (0, 1): msg = ('Internal Error: calling {executable} ' 'for test {test_id} failed (returncode={returncode}):\n' 'output:{stdout}\n' @@ -64,39 +100,26 @@ def read_file(name): returncode=p.returncode)) return [failure] - results = self._parse_log(log=log) + results = self._parse_log(log=log_xml) shutil.rmtree(temp_dir) + if results: return results def _parse_log(self, log): - """ - Parse the "log" section produced by BoostTest. - - This is always a XML file, and from this we produce most of the - failures possible when running BoostTest. - """ - # Fatal errors apparently generate invalid xml in the form: - # ...... - # so we have to manually split it into two xmls if that's the case. - parsed_elements = [] - if log.startswith('') - fatal += '' # put it back, removed by split() - fatal_root = ElementTree.fromstring(fatal) - fatal_root.text = 'Fatal Error: %s' % fatal_root.text - parsed_elements.append(fatal_root) - - log_root = ElementTree.fromstring(log) - parsed_elements.extend(log_root.findall('Exception')) - parsed_elements.extend(log_root.findall('Error')) - - result = [] - for elem in parsed_elements: - filename = elem.attrib['file'] - linenum = int(elem.attrib['line']) - result.append(QTestFailure(filename, linenum, elem.text)) - return result + failed_suites = [] + tree = ET.parse(log) + root = tree.getroot() + if log: + for suite in root: + if int(root.attrib['errors']) > 0 or int(root.attrib['failures']) > 0: + failed_cases = [case for case in root.iter('testcase') if case.get('result') != "pass"] + updated_attrib = copy.deepcopy(suite.attrib) + updated_attrib.update(tests=len(failed_cases)) + fail_suite = ET.Element(suite.tag, attrib=updated_attrib) + fail_suite.extend(failed_cases) + failed_suites.append(fail_suite) + return failed_suites class QTestFailure(CppTestFailure): From e8ec1594956de377f8aea7a867ee0244d32f9c37 Mon Sep 17 00:00:00 2001 From: Leandre Arseneault Date: Thu, 14 Jul 2016 14:37:26 -0400 Subject: [PATCH 04/12] New way to parse xml files --- pytest_cpp/qt.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pytest_cpp/qt.py b/pytest_cpp/qt.py index a6e1ddd..653e5a4 100644 --- a/pytest_cpp/qt.py +++ b/pytest_cpp/qt.py @@ -43,7 +43,7 @@ def read_file(name): args = [ executable, "-o", - "{xml_file},xunitxml".format(xml_file=log_xml), + "{xml_file},xml".format(xml_file=log_xml), ] p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout, _ = p.communicate() @@ -62,16 +62,10 @@ def read_file(name): for file_name in matches: tree = ET.parse(file_name) test_suite = tree.getroot() - failures += int(test_suite.attrib['failures']) - tests += int(test_suite.attrib['tests']) - errors += int(test_suite.attrib['errors']) cases.append(test_suite.getchildren()) suites.append(test_suite) new_root = ET.Element('testsuites') - new_root.attrib['failures'] = '%s' % failures - new_root.attrib['tests'] = '%s' % tests - new_root.attrib['errors'] = '%s' % errors for suite in suites: new_root.append(suite) @@ -112,13 +106,18 @@ def _parse_log(self, log): root = tree.getroot() if log: for suite in root: - if int(root.attrib['errors']) > 0 or int(root.attrib['failures']) > 0: - failed_cases = [case for case in root.iter('testcase') if case.get('result') != "pass"] + if len([case for case in root.iter('Incident') if case.get('type') != "pass"]) > 0: + failed_suites = [] + failed_cases = [case for case in root.iter('Incident') if case.get('type') != "pass"] updated_attrib = copy.deepcopy(suite.attrib) updated_attrib.update(tests=len(failed_cases)) - fail_suite = ET.Element(suite.tag, attrib=updated_attrib) - fail_suite.extend(failed_cases) - failed_suites.append(fail_suite) + #fail_suite = ET.Element(suite.tag, attrib=updated_attrib) + #fail_suite.extend(failed_cases) + #failed_suites.append(fail_suite) + failed_suites = [] + failInfo = [(case.get('file'), case.get('line'), list(case)) for case in root.iter('Incident') if case.get('type') != "pass"] + import ipdb; ipdb.set_trace(); + failed_suites.append(QTestFailure(failInfo[0][0], int(failInfo[0][1]), failInfo[0][2])) return failed_suites @@ -126,7 +125,7 @@ class QTestFailure(CppTestFailure): def __init__(self, filename, linenum, contents): self.filename = filename self.linenum = linenum - self.lines = contents.splitlines() + self.lines = contents def get_lines(self): m = ('red', 'bold') From 1de2eb07a47397190bb4e76418407a6fc94cd7bf Mon Sep 17 00:00:00 2001 From: Leandre Arseneault Date: Thu, 14 Jul 2016 16:16:01 -0400 Subject: [PATCH 05/12] Multiple fail supported --- pytest_cpp/qt.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/pytest_cpp/qt.py b/pytest_cpp/qt.py index 653e5a4..1e553ac 100644 --- a/pytest_cpp/qt.py +++ b/pytest_cpp/qt.py @@ -53,9 +53,7 @@ def read_file(name): for filename in filenames: if filename.endswith('.xml'): matches.append(os.path.join(root, filename)) - failures = 0 - tests = 0 - errors = 0 + cases = [] suites = [] @@ -106,18 +104,11 @@ def _parse_log(self, log): root = tree.getroot() if log: for suite in root: - if len([case for case in root.iter('Incident') if case.get('type') != "pass"]) > 0: - failed_suites = [] - failed_cases = [case for case in root.iter('Incident') if case.get('type') != "pass"] - updated_attrib = copy.deepcopy(suite.attrib) - updated_attrib.update(tests=len(failed_cases)) - #fail_suite = ET.Element(suite.tag, attrib=updated_attrib) - #fail_suite.extend(failed_cases) - #failed_suites.append(fail_suite) + failed_cases = [case for case in root.iter('Incident') if case.get('type') != "pass"] + if failed_cases: failed_suites = [] - failInfo = [(case.get('file'), case.get('line'), list(case)) for case in root.iter('Incident') if case.get('type') != "pass"] - import ipdb; ipdb.set_trace(); - failed_suites.append(QTestFailure(failInfo[0][0], int(failInfo[0][1]), failInfo[0][2])) + for case in failed_cases: + failed_suites.append(QTestFailure(case.attrib['file'], int(case.attrib['line']), case.find('Description').text)) return failed_suites @@ -125,7 +116,7 @@ class QTestFailure(CppTestFailure): def __init__(self, filename, linenum, contents): self.filename = filename self.linenum = linenum - self.lines = contents + self.lines = contents.splitlines() def get_lines(self): m = ('red', 'bold') From 73c5de146459a8e114763430a10b1747cfac486b Mon Sep 17 00:00:00 2001 From: Leandre Arseneault Date: Mon, 18 Jul 2016 11:53:53 -0400 Subject: [PATCH 06/12] Only merge log files if there are multiple log files --- pytest_cpp/qt.py | 55 ++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/pytest_cpp/qt.py b/pytest_cpp/qt.py index 1e553ac..d4e158b 100644 --- a/pytest_cpp/qt.py +++ b/pytest_cpp/qt.py @@ -48,6 +48,36 @@ def read_file(name): p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout, _ = p.communicate() + if len(os.listdir(temp_dir)) > 1: + self.merge_xml_report(temp_dir) + log_xml = os.path.join(temp_dir, "result-merged.xml") + log = read_file(log_xml) + else: + log_xml = os.path.join(temp_dir, os.listdir(temp_dir)[0]) + log = read_file(log_xml) + + if p.returncode not in (0, 1): + msg = ('Internal Error: calling {executable} ' + 'for test {test_id} failed (returncode={returncode}):\n' + 'output:{stdout}\n' + 'log:{log}\n') + failure = QTestFailure( + '', + linenum=0, + contents=msg.format(executable=executable, + test_id=test_id, + stdout=stdout, + log=log, + returncode=p.returncode)) + return [failure] + + results = self._parse_log(log=log_xml) + shutil.rmtree(temp_dir) + + if results: + return results + + def merge_xml_report(self, temp_dir): matches = [] for root, dirnames, filenames in os.walk(temp_dir): for filename in filenames: @@ -73,31 +103,6 @@ def read_file(name): encoding="UTF-8", xml_declaration=True) - log_xml = os.path.join(temp_dir, "result-merged.xml") - - log = read_file(log_xml) - - if p.returncode not in (0, 1): - msg = ('Internal Error: calling {executable} ' - 'for test {test_id} failed (returncode={returncode}):\n' - 'output:{stdout}\n' - 'log:{log}\n') - failure = QTestFailure( - '', - linenum=0, - contents=msg.format(executable=executable, - test_id=test_id, - stdout=stdout, - log=log, - returncode=p.returncode)) - return [failure] - - results = self._parse_log(log=log_xml) - shutil.rmtree(temp_dir) - - if results: - return results - def _parse_log(self, log): failed_suites = [] tree = ET.parse(log) From ed906aa64908e6129a4ea723dc2cf5c00e84205d Mon Sep 17 00:00:00 2001 From: Jonathan Roy Date: Thu, 21 Jul 2016 15:22:43 -0400 Subject: [PATCH 07/12] Add tests for the qt tests collector --- pytest_cpp/qt.py | 14 +++++---- tests/SConstruct | 26 ++++++++++++--- tests/test_pytest_cpp.py | 68 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 93 insertions(+), 15 deletions(-) diff --git a/pytest_cpp/qt.py b/pytest_cpp/qt.py index d4e158b..dd926e5 100644 --- a/pytest_cpp/qt.py +++ b/pytest_cpp/qt.py @@ -3,8 +3,6 @@ import tempfile import io import shutil -import copy -import fnmatch from pytest_cpp.error import CppTestFailure import xml.etree.ElementTree as ET @@ -23,7 +21,7 @@ def is_test_suite(cls, executable): except (subprocess.CalledProcessError, OSError): return False else: - return '-csv' in output + return '-datatags' in output def list_tests(self, executable): # unfortunately boost doesn't provide us with a way to list the tests @@ -48,15 +46,18 @@ def read_file(name): p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout, _ = p.communicate() - if len(os.listdir(temp_dir)) > 1: + num_reports = len(os.listdir(temp_dir)) + if num_reports > 1: self.merge_xml_report(temp_dir) log_xml = os.path.join(temp_dir, "result-merged.xml") log = read_file(log_xml) - else: + elif num_reports == 1: log_xml = os.path.join(temp_dir, os.listdir(temp_dir)[0]) log = read_file(log_xml) + else: + log_xml = log = None - if p.returncode not in (0, 1): + if p.returncode < 0 and p.returncode not in(-6, ): msg = ('Internal Error: calling {executable} ' 'for test {test_id} failed (returncode={returncode}):\n' 'output:{stdout}\n' @@ -118,6 +119,7 @@ def _parse_log(self, log): class QTestFailure(CppTestFailure): + def __init__(self, filename, linenum, contents): self.filename = filename self.linenum = linenum diff --git a/tests/SConstruct b/tests/SConstruct index 40ba0b3..c6b8d71 100644 --- a/tests/SConstruct +++ b/tests/SConstruct @@ -9,19 +9,37 @@ else: LIBS = ['pthread'] env = Environment( - CPPPATH=os.environ.get('INCLUDE'), + CPPPATH=os.environ.get('INCLUDE', []), CCFLAGS=CCFLAGS, - LIBPATH=os.environ.get('LIBPATH'), + LIBPATH=os.environ.get('LIBPATH', []), LIBS=LIBS, ) + +# google test env genv = env.Clone(LIBS=['gtest'] + LIBS) -Export('env genv') +# qt5 env +QT5DIR = "/opt/Qt5.7.0/5.7/gcc_64" +qtenv = env.Clone(QT5DIR=QT5DIR, + CCFLAGS="-std=c++11 -fPIC", + tools=['default','qt5']) +qtenv['ENV']['PKG_CONFIG_PATH'] = os.path.join(QT5DIR, 'lib/pkgconfig') +qtenv.EnableQt5Modules([ + 'QtTest' + ]) + +Export('env genv qtenv') +# build google test target genv.Program('gtest.cpp') +# build boost target for filename in ('boost_success.cpp', 'boost_failure.cpp', 'boost_error.cpp'): env.Program(filename) +# build qt5 target +for filename in ('qt_success.cpp', 'qt_failure.cpp', 'qt_error.cpp'): + qtenv.Program(filename) + SConscript('acceptance/googletest-samples/SConscript') -SConscript('acceptance/boosttest-samples/SConscript') \ No newline at end of file +SConscript('acceptance/boosttest-samples/SConscript') diff --git a/tests/test_pytest_cpp.py b/tests/test_pytest_cpp.py index 3061ea9..f871ffa 100644 --- a/tests/test_pytest_cpp.py +++ b/tests/test_pytest_cpp.py @@ -42,7 +42,11 @@ def get_file_reference(self): 'FooTest.DISABLED_test_disabled' ]), (BoostTestFacade(), 'boost_success', ['boost_success']), + (BoostTestFacade(), 'boost_failure', ['boost_failure']), (BoostTestFacade(), 'boost_error', ['boost_error']), + (QTestLibFacade(), 'qt_success', ['qt_success']), + (QTestLibFacade(), 'qt_failure', ['qt_failure']), + (QTestLibFacade(), 'qt_error', ['qt_error']) ]) def test_list_tests(facade, name, expected, exes): obtained = facade.list_tests(exes.get(name)) @@ -52,6 +56,7 @@ def test_list_tests(facade, name, expected, exes): @pytest.mark.parametrize('facade, name, other_name', [ (GoogleTestFacade(), 'gtest', 'boost_success'), (BoostTestFacade(), 'boost_success', 'gtest'), + (QTestLibFacade(), 'qt_success', 'gtest'), ]) def test_is_test_suite(facade, name, other_name, exes, tmpdir): assert facade.is_test_suite(exes.get(name)) @@ -63,6 +68,7 @@ def test_is_test_suite(facade, name, other_name, exes, tmpdir): @pytest.mark.parametrize('facade, name, test_id', [ (GoogleTestFacade(), 'gtest', 'FooTest.test_success'), (BoostTestFacade(), 'boost_success', ''), + (QTestLibFacade(), 'qt_success', ''), ]) def test_success(facade, name, test_id, exes): assert facade.run_test(exes.get(name), test_id) is None @@ -135,6 +141,29 @@ def test_boost_error(exes): assert fail2.get_file_reference() == ("unknown location", 0) +def test_qt_failure(exes): + facade = QTestLibFacade() + failures = facade.run_test(exes.get('qt_failure'), '') + assert len(failures) == 2 + + fail1 = failures[0] + colors = ('red', 'bold') + assert fail1.get_lines() == [('Compared values are not the same', colors), (' Actual (2 * 3): 6', colors), (' Expected (5) : 5', colors)] + assert fail1.get_file_reference() == ('qt_failure.cpp', 13) + + +def test_qt_error(exes): + facade = QTestLibFacade() + failures = facade.run_test(exes.get('qt_error'), '') + assert len(failures) == 1 # qt abort at first unhandled exception + + fail1 = failures[0] + colors = ('red', 'bold') + + assert fail1.get_lines() == [ + ('Caught unhandled exception', colors)] + + def test_google_run(testdir, exes): result = testdir.inline_run('-v', exes.get('gtest', 'test_gtest')) assert_outcomes(result, [ @@ -195,7 +224,7 @@ def mock_popen(mocker, return_code, stdout, stderr): mocked_popen = mocker.MagicMock() mocked_popen.__enter__ = mocked_popen mocked_popen.communicate.return_value = stdout, stderr - mocked_popen.return_code = return_code + mocked_popen.returncode = return_code mocked_popen.poll.return_value = return_code mocker.patch.object(subprocess, 'Popen', return_value=mocked_popen) return mocked_popen @@ -212,6 +241,29 @@ def test_boost_internal_error(testdir, exes, mocker): assert 'Internal Error:' in str(rep.longrepr) +def test_qt_run(testdir, exes): + all_names = ['qt_success', 'qt_error', 'qt_failure'] + all_files = [exes.get(n, 'test_' + n) for n in all_names] + result = testdir.inline_run('-v', *all_files) + assert_outcomes(result, [ + ('test_qt_success', 'passed'), + ('test_qt_error', 'failed'), + ('test_qt_failure', 'failed'), + ]) + + +def test_qt_internal_error(testdir, exes, mocker): + exe = exes.get('qt_success', 'test_qt_success') + mock_popen(mocker, return_code=-10, stderr=None, stdout=None) + mocker.patch.object(QTestLibFacade, 'is_test_suite', return_value=True) + mocker.patch.object(GoogleTestFacade, 'is_test_suite', return_value=False) + mocker.patch.object(BoostTestFacade, 'is_test_suite', return_value=False) + result = testdir.inline_run(exe) + rep = result.matchreport(exes.exe_name('test_qt_success'), + 'pytest_runtest_logreport') + assert 'Internal Error:' in str(rep.longrepr) + + def test_cpp_failure_repr(dummy_failure): dummy_failure.lines = [('error message', {'red'})] dummy_failure.file_reference = 'test_suite', 20 @@ -222,6 +274,7 @@ def test_cpp_failure_repr(dummy_failure): def test_cpp_files_option(testdir, exes): exes.get('boost_success') exes.get('gtest') + exes.get('qt_success') result = testdir.inline_run('--collect-only') reps = result.getreports() @@ -230,17 +283,22 @@ def test_cpp_files_option(testdir, exes): testdir.makeini(''' [pytest] - cpp_files = gtest* boost* + cpp_files = gtest* boost* qt* ''') result = testdir.inline_run('--collect-only') assert len(result.matchreport(exes.exe_name('boost_success')).result) == 1 assert len(result.matchreport(exes.exe_name('gtest')).result) == 4 + assert len(result.matchreport(exes.exe_name('qt_success')).result) == 1 def test_passing_files_directly_in_command_line(testdir, exes): - f = exes.get('boost_success') - result = testdir.runpytest(f) - result.stdout.fnmatch_lines(['*1 passed*']) + boost_exe = exes.get('boost_success') + result_boost = testdir.runpytest(boost_exe) + result_boost.stdout.fnmatch_lines(['*1 passed*']) + + qt_exe = exes.get('qt_success') + result_qt = testdir.runpytest(qt_exe) + result_qt.stdout.fnmatch_lines(['*1 passed*']) class TestError: From 27752087ca3f5e786cb5d3192f5d0c117e3db623 Mon Sep 17 00:00:00 2001 From: Jonathan Roy Date: Thu, 21 Jul 2016 15:40:16 -0400 Subject: [PATCH 08/12] Update README for qt support --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 443203b..9420e48 100644 --- a/README.rst +++ b/README.rst @@ -6,8 +6,8 @@ Use `pytest `_ runner to discover and execu |python| |version| |downloads| |ci| |coverage| -Supports both `Google Test `_ and -`Boost::Test `_: +Supports `Google Test `_ , +`Boost::Test `_ and `QTest `_: .. image:: https://raw.githubusercontent.com/pytest-dev/pytest-cpp/master/images/screenshot.png @@ -43,7 +43,7 @@ Usage Once installed, when py.test runs it will search and run tests founds in executable files, detecting if the suites are -Google or Boost tests automatically. +Google, Boost or Qt tests automatically. You can configure which files are tested for suites by using the ``cpp_files`` ini configuration:: From d702f81a309e5af9afdaf2f9ef657eee8ce064ae Mon Sep 17 00:00:00 2001 From: Jonathan Roy Date: Tue, 26 Jul 2016 17:29:12 -0400 Subject: [PATCH 09/12] Add tests files and qt5 scons builder --- tests/qt_error.cpp | 22 + tests/qt_failure.cpp | 22 + tests/qt_success.cpp | 22 + tests/site_scons/site_tools/qt5/README.rst | 351 ++++++ tests/site_scons/site_tools/qt5/__init__.py | 1004 +++++++++++++++++ .../site_scons/site_tools/qt5/docs/SConstruct | 34 + tests/site_scons/site_tools/qt5/docs/html.xsl | 55 + .../site_scons/site_tools/qt5/docs/manual.xml | 388 +++++++ tests/site_scons/site_tools/qt5/docs/pdf.xsl | 62 + tests/site_scons/site_tools/qt5/docs/qt5.xml | 600 ++++++++++ .../site_tools/qt5/docs/reference.xml | 717 ++++++++++++ .../site_scons/site_tools/qt5/docs/scons.css | 263 +++++ .../CPPPATH/CPPPATH-appended/SConscript-after | 6 + .../CPPPATH-appended/SConscript-before | 5 + .../CPPPATH/CPPPATH-appended/image/SConscript | 2 + .../CPPPATH/CPPPATH-appended/image/SConstruct | 6 + .../CPPPATH-appended/image/sub/aaa.cpp | 13 + .../CPPPATH/CPPPATH-appended/image/sub/aaa.h | 12 + .../image/sub/local_include/local_include.h | 3 + .../sconstest-CPPPATH-appended-fail.py | 56 + .../sconstest-CPPPATH-appended.py | 54 + .../basic/CPPPATH/CPPPATH/SConscript-after | 3 + .../basic/CPPPATH/CPPPATH/SConscript-before | 3 + .../basic/CPPPATH/CPPPATH/image/SConstruct | 6 + .../test/basic/CPPPATH/CPPPATH/image/aaa.cpp | 13 + .../test/basic/CPPPATH/CPPPATH/image/aaa.h | 12 + .../image/local_include/local_include.h | 2 + .../CPPPATH/CPPPATH/sconstest-CPPPATH-fail.py | 54 + .../CPPPATH/CPPPATH/sconstest-CPPPATH.py | 53 + .../test/basic/copied-env/image/MyFile.cpp | 5 + .../qt5/test/basic/copied-env/image/MyFile.h | 2 + .../test/basic/copied-env/image/SConscript | 11 + .../test/basic/copied-env/image/SConstruct | 6 + .../basic/copied-env/sconstest-copied-env.py | 52 + .../qt5/test/basic/empty-env/image/SConstruct | 4 + .../qt5/test/basic/empty-env/image/foo6.h | 8 + .../qt5/test/basic/empty-env/image/main.cpp | 3 + .../basic/empty-env/sconstest-empty-env.py | 47 + .../qt5/test/basic/manual/image/SConscript | 20 + .../qt5/test/basic/manual/image/SConstruct | 6 + .../qt5/test/basic/manual/image/aaa.cpp | 2 + .../qt5/test/basic/manual/image/bbb.cpp | 18 + .../qt5/test/basic/manual/image/bbb.h | 2 + .../qt5/test/basic/manual/image/ddd.cpp | 2 + .../qt5/test/basic/manual/image/eee.cpp | 16 + .../qt5/test/basic/manual/image/eee.h | 2 + .../qt5/test/basic/manual/image/fff.cpp | 1 + .../qt5/test/basic/manual/image/include/aaa.h | 9 + .../qt5/test/basic/manual/image/include/ddd.h | 9 + .../qt5/test/basic/manual/image/main.cpp | 17 + .../qt5/test/basic/manual/image/ui/ccc.h | 9 + .../qt5/test/basic/manual/image/ui/ccc.ui | 19 + .../qt5/test/basic/manual/image/ui/fff.ui | 19 + .../qt5/test/basic/manual/sconstest-manual.py | 57 + .../test/basic/moc-from-cpp/image/SConscript | 7 + .../test/basic/moc-from-cpp/image/SConstruct | 24 + .../qt5/test/basic/moc-from-cpp/image/aaa.cpp | 18 + .../qt5/test/basic/moc-from-cpp/image/aaa.h | 2 + .../test/basic/moc-from-cpp/image/useit.cpp | 4 + .../moc-from-cpp/sconstest-moc-from-cpp.py | 91 ++ .../image/SConscript | 8 + .../image/SConstruct | 24 + .../moc-from-header-nocompile/image/aaa.cpp | 7 + .../moc-from-header-nocompile/image/aaa.h | 9 + .../sconstest-moc-from-header-nocompile.py | 88 ++ .../basic/moc-from-header/image/SConscript | 6 + .../basic/moc-from-header/image/SConstruct | 24 + .../test/basic/moc-from-header/image/aaa.cpp | 7 + .../test/basic/moc-from-header/image/aaa.h | 9 + .../sconstest-moc-from-header.py | 77 ++ .../qt5/test/basic/reentrant/image/SConscript | 4 + .../qt5/test/basic/reentrant/image/SConstruct | 6 + .../qt5/test/basic/reentrant/image/foo5.h | 8 + .../qt5/test/basic/reentrant/image/main.cpp | 7 + .../basic/reentrant/sconstest-reentrant.py | 46 + .../test/basic/variantdir/image/MyForm.cpp | 14 + .../qt5/test/basic/variantdir/image/MyForm.h | 18 + .../test/basic/variantdir/image/SConstruct | 12 + .../test/basic/variantdir/image/anUiFile.ui | 19 + .../qt5/test/basic/variantdir/image/main.cpp | 17 + .../basic/variantdir/image/mocFromCpp.cpp | 16 + .../test/basic/variantdir/image/mocFromCpp.h | 2 + .../test/basic/variantdir/image/mocFromH.cpp | 8 + .../test/basic/variantdir/image/mocFromH.h | 11 + .../basic/variantdir/sconstest-installed.py | 47 + .../test/moc/auto/ccomment/image/SConscript | 9 + .../test/moc/auto/ccomment/image/SConstruct | 6 + .../qt5/test/moc/auto/ccomment/image/main.cpp | 14 + .../moc/auto/ccomment/image/mocFromCpp.cpp | 41 + .../test/moc/auto/ccomment/image/mocFromCpp.h | 2 + .../test/moc/auto/ccomment/image/mocFromH.cpp | 10 + .../test/moc/auto/ccomment/image/mocFromH.h | 32 + .../moc/auto/ccomment/sconstest-ccomment.py | 46 + .../moc/auto/literalstring/image/SConscript | 6 + .../moc/auto/literalstring/image/SConstruct | 6 + .../moc/auto/literalstring/image/main.cpp | 14 + .../auto/literalstring/image/mocFromCpp.cpp | 27 + .../moc/auto/literalstring/image/mocFromCpp.h | 2 + .../moc/auto/literalstring/image/mocFromH.cpp | 10 + .../moc/auto/literalstring/image/mocFromH.h | 21 + .../literalstring/sconstest-literalstring.py | 45 + .../qt5/test/moc/cpppath/default/SConscript | 8 + .../test/moc/cpppath/default/SConscript-fails | 9 + .../test/moc/cpppath/default/image/SConstruct | 6 + .../default/image/include/mocFromCpp.h | 1 + .../cpppath/default/image/include/mocFromH.h | 11 + .../moc/cpppath/default/image/src/main.cpp | 14 + .../cpppath/default/image/src/mocFromCpp.cpp | 15 + .../cpppath/default/image/src/mocFromH.cpp | 10 + .../default/sconstest-default-fails.py | 46 + .../moc/cpppath/default/sconstest-default.py | 46 + .../qt5/test/moc/cpppath/specific/SConscript | 9 + .../moc/cpppath/specific/SConscript-fails | 9 + .../moc/cpppath/specific/image/SConstruct | 6 + .../specific/image/include/mocFromCpp.h | 1 + .../cpppath/specific/image/include/mocFromH.h | 11 + .../moc/cpppath/specific/image/src/main.cpp | 14 + .../cpppath/specific/image/src/mocFromCpp.cpp | 15 + .../cpppath/specific/image/src/mocFromH.cpp | 10 + .../specific/sconstest-specific-fails.py | 49 + .../cpppath/specific/sconstest-specific.py | 48 + .../qt5/test/moc/explicit/image/SConscript | 10 + .../qt5/test/moc/explicit/image/SConstruct | 6 + .../qt5/test/moc/explicit/image/main.cpp | 14 + .../test/moc/explicit/image/mocFromCpp.cpp | 16 + .../qt5/test/moc/explicit/image/mocFromCpp.h | 2 + .../qt5/test/moc/explicit/image/mocFromH.cpp | 8 + .../qt5/test/moc/explicit/image/mocFromH.h | 11 + .../test/moc/explicit/sconstest-explicit.py | 45 + .../moc/order_independent/image/SConscript | 12 + .../moc/order_independent/image/SConstruct | 25 + .../test/moc/order_independent/image/aaa.cpp | 7 + .../test/moc/order_independent/image/aaa.h | 9 + .../test/moc/order_independent/image/bbb.cpp | 4 + .../sconstest-order-independent.py | 46 + .../site_tools/qt5/test/qrc/basic/SConscript | 8 + .../qt5/test/qrc/basic/SConscript-wflags | 9 + .../qt5/test/qrc/basic/image/SConstruct | 6 + .../qt5/test/qrc/basic/image/icons.qrc | 5 + .../qt5/test/qrc/basic/image/icons/scons.png | Bin 0 -> 1613 bytes .../qt5/test/qrc/basic/image/main.cpp | 11 + .../qt5/test/qrc/basic/sconstest-basic.py | 45 + .../test/qrc/basic/sconstest-basicwflags.py | 45 + .../site_tools/qt5/test/qrc/manual/SConscript | 9 + .../qt5/test/qrc/manual/SConscript-wflags | 11 + .../qt5/test/qrc/manual/image/SConstruct | 6 + .../qt5/test/qrc/manual/image/icons.qrc | 5 + .../qt5/test/qrc/manual/image/icons/scons.png | Bin 0 -> 1613 bytes .../qt5/test/qrc/manual/image/main.cpp | 11 + .../qt5/test/qrc/manual/sconstest-manual.py | 45 + .../test/qrc/manual/sconstest-manualwflags.py | 45 + .../qt5/test/qrc/multifiles/SConscript | 8 + .../qt5/test/qrc/multifiles/SConscript-manual | 9 + .../qt5/test/qrc/multifiles/image/SConstruct | 6 + .../qt5/test/qrc/multifiles/image/icons.qrc | 5 + .../test/qrc/multifiles/image/icons/scons.png | Bin 0 -> 1613 bytes .../qt5/test/qrc/multifiles/image/main.cpp | 12 + .../qt5/test/qrc/multifiles/image/other.qrc | 5 + .../test/qrc/multifiles/image/other/rocks.png | Bin 0 -> 1613 bytes .../multifiles/sconstest-multifiles-manual.py | 45 + .../qrc/multifiles/sconstest-multifiles.py | 46 + .../qt5/test/qrc/othername/image/SConscript | 11 + .../qt5/test/qrc/othername/image/SConstruct | 6 + .../qt5/test/qrc/othername/image/icons.qrc | 5 + .../test/qrc/othername/image/icons/scons.png | Bin 0 -> 1613 bytes .../qt5/test/qrc/othername/image/main.cpp | 11 + .../test/qrc/othername/sconstest-othername.py | 45 + .../test/qrc/samefilename/image/SConscript | 8 + .../test/qrc/samefilename/image/SConstruct | 6 + .../qt5/test/qrc/samefilename/image/icons.cpp | 11 + .../qt5/test/qrc/samefilename/image/icons.qrc | 5 + .../qrc/samefilename/image/icons/scons.png | Bin 0 -> 1613 bytes .../samefilename/sconstest-samefilename.py | 46 + .../qt5/test/qrc/subdir/image/SConscript | 8 + .../qt5/test/qrc/subdir/image/SConstruct | 6 + .../qt5/test/qrc/subdir/image/main.cpp | 11 + .../qt5/test/qrc/subdir/image/qrc/icons.qrc | 5 + .../test/qrc/subdir/image/qrc/icons/scons.png | Bin 0 -> 1613 bytes .../qt5/test/qrc/subdir/sconstest-subdir.py | 46 + .../test/qt_examples/create_scons_tests.py | 748 ++++++++++++ .../qt5/test/qt_examples/sconstest.skip | 0 tests/site_scons/site_tools/qt5/test/qtenv.py | 107 ++ .../site_tools/qt5/test/sconstest.skip | 0 .../qt5/test/ts_qm/clean/image/MyFile.cpp | 7 + .../qt5/test/ts_qm/clean/image/MyFile.h | 13 + .../qt5/test/ts_qm/clean/image/SConscript | 6 + .../qt5/test/ts_qm/clean/image/SConstruct | 6 + .../qt5/test/ts_qm/clean/sconstest-clean.py | 54 + .../qt5/test/ts_qm/mixdir/image/MyFile.cpp | 7 + .../qt5/test/ts_qm/mixdir/image/MyFile.h | 13 + .../qt5/test/ts_qm/mixdir/image/SConscript | 3 + .../qt5/test/ts_qm/mixdir/image/SConstruct | 6 + .../test/ts_qm/mixdir/image/subdir/bbb.cpp | 6 + .../qt5/test/ts_qm/mixdir/image/subdir/bbb.h | 13 + .../qt5/test/ts_qm/mixdir/sconstest-mixdir.py | 49 + .../test/ts_qm/multisource/image/MyFile.cpp | 7 + .../qt5/test/ts_qm/multisource/image/MyFile.h | 13 + .../test/ts_qm/multisource/image/SConscript | 6 + .../test/ts_qm/multisource/image/SConstruct | 6 + .../qt5/test/ts_qm/multisource/image/bbb.cpp | 6 + .../qt5/test/ts_qm/multisource/image/bbb.h | 13 + .../multisource/sconstest-multisource.py | 61 + .../test/ts_qm/multitarget/image/MyFile.cpp | 7 + .../qt5/test/ts_qm/multitarget/image/MyFile.h | 13 + .../test/ts_qm/multitarget/image/SConscript | 4 + .../test/ts_qm/multitarget/image/SConstruct | 6 + .../multitarget/sconstest-multitarget.py | 59 + .../qt5/test/ts_qm/noclean/image/MyFile.cpp | 7 + .../qt5/test/ts_qm/noclean/image/MyFile.h | 13 + .../qt5/test/ts_qm/noclean/image/SConscript | 4 + .../qt5/test/ts_qm/noclean/image/SConstruct | 6 + .../test/ts_qm/noclean/sconstest-noclean.py | 54 + 212 files changed, 7623 insertions(+) create mode 100644 tests/qt_error.cpp create mode 100644 tests/qt_failure.cpp create mode 100644 tests/qt_success.cpp create mode 100644 tests/site_scons/site_tools/qt5/README.rst create mode 100644 tests/site_scons/site_tools/qt5/__init__.py create mode 100644 tests/site_scons/site_tools/qt5/docs/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/docs/html.xsl create mode 100644 tests/site_scons/site_tools/qt5/docs/manual.xml create mode 100644 tests/site_scons/site_tools/qt5/docs/pdf.xsl create mode 100644 tests/site_scons/site_tools/qt5/docs/qt5.xml create mode 100644 tests/site_scons/site_tools/qt5/docs/reference.xml create mode 100644 tests/site_scons/site_tools/qt5/docs/scons.css create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-after create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-before create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.h create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/local_include/local_include.h create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended-fail.py create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended.py create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-after create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-before create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.h create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/local_include/local_include.h create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH-fail.py create mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH.py create mode 100644 tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.h create mode 100644 tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/basic/copied-env/sconstest-copied-env.py create mode 100755 tests/site_scons/site_tools/qt5/test/basic/empty-env/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/basic/empty-env/image/foo6.h create mode 100755 tests/site_scons/site_tools/qt5/test/basic/empty-env/image/main.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/empty-env/sconstest-empty-env.py create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/SConscript create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/SConstruct create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/aaa.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.h create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/ddd.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.h create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/fff.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/include/aaa.h create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/include/ddd.h create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/main.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.h create mode 100644 tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.ui create mode 100644 tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/fff.ui create mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/sconstest-manual.py create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConscript create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConstruct create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.h create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/useit.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/sconstest-moc-from-cpp.py create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConscript create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.h create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/sconstest-moc-from-header-nocompile.py create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConscript create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.h create mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header/sconstest-moc-from-header.py create mode 100755 tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConscript create mode 100755 tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/basic/reentrant/image/foo5.h create mode 100755 tests/site_scons/site_tools/qt5/test/basic/reentrant/image/main.cpp create mode 100755 tests/site_scons/site_tools/qt5/test/basic/reentrant/sconstest-reentrant.py create mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.h create mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/anUiFile.ui create mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/main.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.h create mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.h create mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/sconstest-installed.py create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/main.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.h create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.h create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/sconstest-ccomment.py create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/main.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.h create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.h create mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/sconstest-literalstring.py create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript-fails create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromCpp.h create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromH.h create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/main.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromCpp.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromH.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default-fails.py create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default.py create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript-fails create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromCpp.h create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromH.h create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/main.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromCpp.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromH.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific-fails.py create mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific.py create mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/main.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.h create mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.h create mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/sconstest-explicit.py create mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.h create mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/image/bbb.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/sconstest-order-independent.py create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript-wflags create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons.qrc create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons/scons.png create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/image/main.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basic.py create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basicwflags.py create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript-wflags create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons.qrc create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons/scons.png create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/image/main.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manual.py create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manualwflags.py create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript-manual create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons.qrc create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons/scons.png create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/main.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other.qrc create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other/rocks.png create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles-manual.py create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles.py create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons.qrc create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons/scons.png create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/image/main.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/sconstest-othername.py create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.qrc create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons/scons.png create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/sconstest-samefilename.py create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/image/main.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons.qrc create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons/scons.png create mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/sconstest-subdir.py create mode 100644 tests/site_scons/site_tools/qt5/test/qt_examples/create_scons_tests.py create mode 100644 tests/site_scons/site_tools/qt5/test/qt_examples/sconstest.skip create mode 100644 tests/site_scons/site_tools/qt5/test/qtenv.py create mode 100644 tests/site_scons/site_tools/qt5/test/sconstest.skip create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.h create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/clean/sconstest-clean.py create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.h create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.h create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/sconstest-mixdir.py create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.h create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.h create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/sconstest-multisource.py create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.h create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/sconstest-multitarget.py create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.cpp create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.h create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConscript create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConstruct create mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/noclean/sconstest-noclean.py diff --git a/tests/qt_error.cpp b/tests/qt_error.cpp new file mode 100644 index 0000000..222f950 --- /dev/null +++ b/tests/qt_error.cpp @@ -0,0 +1,22 @@ +#include + +class TestError: public QObject +{ + Q_OBJECT +private slots: + void testErrorOne(); + void testErrorTwo(); +}; + +void TestError::testErrorOne() +{ + throw std::runtime_error("unexpected exception"); +} + +void TestError::testErrorTwo() +{ + throw std::runtime_error("another unexpected exception"); +} + +QTEST_MAIN(TestError) +#include "qt_error.moc" diff --git a/tests/qt_failure.cpp b/tests/qt_failure.cpp new file mode 100644 index 0000000..6e8bfc4 --- /dev/null +++ b/tests/qt_failure.cpp @@ -0,0 +1,22 @@ +#include + +class TestFailure: public QObject +{ + Q_OBJECT +private slots: + void TestFailureOne(); + void TestFailureTwo(); +}; + +void TestFailure::TestFailureOne() +{ + QCOMPARE(2 * 3, 5); +} + +void TestFailure::TestFailureTwo() +{ + QCOMPARE(2 - 1, 0); +} + +QTEST_MAIN(TestFailure) +#include "qt_failure.moc" diff --git a/tests/qt_success.cpp b/tests/qt_success.cpp new file mode 100644 index 0000000..7850d7c --- /dev/null +++ b/tests/qt_success.cpp @@ -0,0 +1,22 @@ +#include + +class TestSuccess: public QObject +{ + Q_OBJECT +private slots: + void testSuccessOne(); + void testSuccessTwo(); +}; + +void TestSuccess::testSuccessOne() +{ + QCOMPARE(2 * 3, 6); +} + +void TestSuccess::testSuccessTwo() +{ + QCOMPARE(3 * 4, 12); +} + +QTEST_MAIN(TestSuccess) +#include "qt_success.moc" diff --git a/tests/site_scons/site_tools/qt5/README.rst b/tests/site_scons/site_tools/qt5/README.rst new file mode 100644 index 0000000..b9f8e27 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/README.rst @@ -0,0 +1,351 @@ +#################################### +The SCons qt5 tool +#################################### + +Basics +====== +This tool can be used to compile Qt projects, designed for versions 5.x.y and higher. +It is not usable for Qt3 and older versions, since some of the helper tools +(``moc``, ``uic``) behave different. + +Install +------- +Installing it, requires you to copy (or, even better: checkout) the contents of the +package's ``qt5`` folder to + +#. "``/path_to_your_project/site_scons/site_tools/qt5``", if you need the Qt5 Tool in one project only, or +#. "``~/.scons/site_scons/site_tools/qt5``", for a system-wide installation under your current login. + +For more infos about this, please refer to + +* the SCons User's Guide, sect. "Where to put your custom Builders and Tools" and +* the SCons Tools Wiki page at `http://scons.org/wiki/ToolsIndex `_. + +How to activate +--------------- +For activating the tool "qt5", you have to add its name to the Environment constructor, +like this + +:: + + env = Environment(tools=['default','qt5']) + + +On its startup, the Qt5 tool tries to read the variable ``QT5DIR`` from the current +Environment and ``os.environ``. If it is not set, the value of ``QTDIR`` (in +Environment/``os.environ``) is used as a fallback. + +So, you either have to explicitly give the path of your Qt5 installation to the +Environment with + +:: + + env['QT5DIR'] = '/usr/local/Trolltech/Qt-5.2.3' + + +or set the ``QT5DIR`` as environment variable in your shell. + + +Requirements +------------ +Under Linux, "qt5" uses the system tool ``pkg-config`` for automatically +setting the required compile and link flags of the single Qt5 modules (like QtCore, +QtGui,...). +This means that + +#. you should have ``pkg-config`` installed, and +#. you additionally have to set ``PKG_CONFIG_PATH`` in your shell environment, such + that it points to $``QT5DIR/lib/pkgconfig`` (or $``QT5DIR/lib`` for some older versions). + +Based on these two environment variables (``QT5DIR`` and ``PKG_CONFIG_PATH``), +the "qt5" tool initializes all ``QT5_*`` +construction variables listed in the Reference manual. This happens when the tool +is "detected" during Environment construction. As a consequence, the setup +of the tool gets a two-stage process, if you want to override the values provided +by your current shell settings: + +:: + + # Stage 1: create plain environment + qtEnv = Environment() + # Set new vars + qtEnv['QT5DIR'] = '/usr/local/Trolltech/Qt-5.2.3 + qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-5.2.3/lib/pkgconfig' + # Stage 2: add qt5 tool + qtEnv.Tool('qt5') + + + + +Suggested boilerplate +===================== +Based on the requirements above, we suggest a simple ready-to-go setup +as follows: + +SConstruct + +:: + + # Detect Qt version + qtdir = detectLatestQtDir() + + # Create base environment + baseEnv = Environment() + #...further customization of base env + + # Clone Qt environment + qtEnv = baseEnv.Clone() + # Set QT5DIR and PKG_CONFIG_PATH + qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') + qtEnv['QT5DIR'] = qtdir + # Add qt5 tool + qtEnv.Tool('qt5') + #...further customization of qt env + + # Export environments + Export('baseEnv qtEnv') + + # Your other stuff... + # ...including the call to your SConscripts + + +In a SConscript + +:: + + # Get the Qt5 environment + Import('qtEnv') + # Clone it + env = qtEnv.clone() + # Patch it + env.Append(CCFLAGS=['-m32']) # or whatever + # Use it + env.StaticLibrary('foo', Glob('*.cpp')) + + +The detection of the Qt directory could be as simple as directly assigning +a fixed path + +:: + + def detectLatestQtDir(): + return "/usr/local/qt5.3.2" + + +or a little more sophisticated + +:: + + # Tries to detect the path to the installation of Qt with + # the highest version number + def detectLatestQtDir(): + if sys.platform.startswith("linux"): + # Simple check: inspect only '/usr/local/Trolltech' + paths = glob.glob('/usr/local/Trolltech/*') + if len(paths): + paths.sort() + return paths[-1] + else: + return "" + else: + # Simple check: inspect only 'C:\Qt' + paths = glob.glob('C:\\Qt\\*') + if len(paths): + paths.sort() + return paths[-1] + else: + return os.environ.get("QTDIR","") + + + +A first project +=============== +The following SConscript is for a simple project with +some cxx files, using the QtCore, QtGui +and QtNetwork modules: + +:: + + Import('qtEnv') + env = qtEnv.Clone() + env.EnableQt5Modules([ + 'QtGui', + 'QtCore', + 'QtNetwork' + ]) + # Add your CCFLAGS and CPPPATHs to env here... + + env.Program('foo', Glob('*.cpp')) + + + +MOC it up +========= +For the basic support of automocing, nothing needs to be +done by the user. The tool usually detects the ``Q_OBJECT`` +macro and calls the "``moc``" executable accordingly. + +If you don't want this, you can switch off the automocing +by a + +:: + + env['QT5_AUTOSCAN'] = 0 + + +in your SConscript file. Then, you have to moc your files +explicitly, using the Moc5 builder. + +You can also switch to an extended automoc strategy with + +:: + + env['QT5_AUTOSCAN_STRATEGY'] = 1 + + +Please read the description of the ``QT5_AUTOSCAN_STRATEGY`` +variable in the Reference manual for details. + +For debugging purposes, you can set the variable ``QT5_DEBUG`` +with + +:: + + env['QT5_DEBUG'] = 1 + + +which outputs a lot of messages during automocing. + + +Forms (.ui) +=========== +The header files with setup code for your GUI classes, are not +compiled automatically from your ``.ui`` files. You always +have to call the Uic5 builder explicitly like + +:: + + env.Uic5(Glob('*.ui')) + env.Program('foo', Glob('*.cpp')) + + + +Resource files (.qrc) +===================== +Resource files are not built automatically, you always +have to add the names of the ``.qrc`` files to the source list +for your program or library: + +:: + + env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) + + +For each of the Resource input files, its prefix defines the +name of the resulting resource. An appropriate "``-name``" option +is added to the call of the ``rcc`` executable +by default. + +You can also call the Qrc5 builder explicitly as + +:: + + qrccc = env.Qrc5('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] + + +or (overriding the default suffix) + +:: + + qrccc = env.Qrc5('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] + + +and then add the resulting cxx file to the sources of your +Program/Library: + +:: + + env.Program('foo', Glob('*.cpp') + qrccc) + + + +Translation files +================= +The update of the ``.ts`` files and the conversion to binary +``.qm`` files is not done automatically. You have to call the +corresponding builders on your own. + +Example for updating a translation file: + +:: + + env.Ts5('foo.ts','.') # -> ['foo.ts'] + + +By default, the ``.ts`` files are treated as *precious* targets. This means that +they are not removed prior to a rebuild, but simply get updated. Additionally, they +do not get cleaned on a "``scons -c``". If you want to delete the translation files +on the "``-c``" SCons command, you can set the variable "``QT5_CLEAN_TS``" like this + +:: + + env['QT5_CLEAN_TS']=1 + + +Example for releasing a translation file, i.e. compiling +it to a ``.qm`` binary file: + +:: + + env.Qm5('foo') # ['foo.ts'] -> ['foo.qm'] + + +or (overriding the output prefix) + +:: + + env.Qm5('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] + + +As an extension both, the Ts5() and Qm5 builder, support the definition of +multiple targets. So, calling + +:: + + env.Ts5(['app_en','app_de'], Glob('*.cpp')) + + +and + +:: + + env.Qm5(['app','copy'], Glob('*.ts')) + + +should work fine. + +Finally, two short notes about the support of directories for the Ts5() builder. You can +pass an arbitrary mix of cxx files and subdirs to it, as in + +:: + + env.Ts5('app_en',['sub1','appwindow.cpp','main.cpp'])) + + +where ``sub1`` is a folder that gets scanned recursively for cxx files by ``lupdate``. +But like this, you lose all dependency information for the subdir, i.e. if a file +inside the folder changes, the .ts file is not updated automatically! In this case +you should tell SCons to always update the target: + +:: + + ts = env.Ts5('app_en',['sub1','appwindow.cpp','main.cpp']) + env.AlwaysBuild(ts) + + +Last note: specifying the current folder "``.``" as input to Ts5() and storing the resulting +.ts file in the same directory, leads to a dependency cycle! You then have to store the .ts +and .qm files outside of the current folder, or use ``Glob('*.cpp'))`` instead. + + + diff --git a/tests/site_scons/site_tools/qt5/__init__.py b/tests/site_scons/site_tools/qt5/__init__.py new file mode 100644 index 0000000..46db788 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/__init__.py @@ -0,0 +1,1004 @@ + +"""SCons.Tool.qt5 + +Tool-specific initialization for Qt5. + +There normally shouldn't be any need to import this module directly. +It will usually be imported through the generic SCons.Tool.Tool() +selection method. + +""" + +# +# Copyright (c) 2001-7,2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +import os.path +import re + +import SCons.Action +import SCons.Builder +import SCons.Defaults +import SCons.Scanner +import SCons.Tool +import SCons.Util + +class ToolQt5Warning(SCons.Warnings.Warning): + pass + +class GeneratedMocFileNotIncluded(ToolQt5Warning): + pass + +class QtdirNotFound(ToolQt5Warning): + pass + +SCons.Warnings.enableWarningClass(ToolQt5Warning) + +try: + sorted +except NameError: + # Pre-2.4 Python has no sorted() function. + # + # The pre-2.4 Python list.sort() method does not support + # list.sort(key=) nor list.sort(reverse=) keyword arguments, so + # we must implement the functionality of those keyword arguments + # by hand instead of passing them to list.sort(). + def sorted(iterable, cmp=None, key=None, reverse=0): + if key is not None: + result = [(key(x), x) for x in iterable] + else: + result = iterable[:] + if cmp is None: + # Pre-2.3 Python does not support list.sort(None). + result.sort() + else: + result.sort(cmp) + if key is not None: + result = [t1 for t0,t1 in result] + if reverse: + result.reverse() + return result + +qrcinclude_re = re.compile(r']*>([^<]*)', re.M) + +mocver_re = re.compile(r'.*(\d+)\.(\d+)\.(\d+).*') + +def transformToWinePath(path) : + return os.popen('winepath -w "%s"'%path).read().strip().replace('\\','/') + +header_extensions = [".h", ".hxx", ".hpp", ".hh"] +if SCons.Util.case_sensitive_suffixes('.h', '.H'): + header_extensions.append('.H') +# TODO: The following two lines will work when integrated back to SCons +# TODO: Meanwhile the third line will do the work +#cplusplus = __import__('c++', globals(), locals(), []) +#cxx_suffixes = cplusplus.CXXSuffixes +cxx_suffixes = [".c", ".cxx", ".cpp", ".cc"] + +def checkMocIncluded(target, source, env): + moc = target[0] + cpp = source[0] + # looks like cpp.includes is cleared before the build stage :-( + # not really sure about the path transformations (moc.cwd? cpp.cwd?) :-/ + path = SCons.Defaults.CScan.path_function(env, moc.cwd) + includes = SCons.Defaults.CScan(cpp, env, path) + if not moc in includes: + SCons.Warnings.warn( + GeneratedMocFileNotIncluded, + "Generated moc file '%s' is not included by '%s'" % + (str(moc), str(cpp))) + +def find_file(filename, paths, node_factory): + for dir in paths: + node = node_factory(filename, dir) + if node.rexists(): + return node + return None + +class _Automoc: + """ + Callable class, which works as an emitter for Programs, SharedLibraries and + StaticLibraries. + """ + + def __init__(self, objBuilderName): + self.objBuilderName = objBuilderName + # some regular expressions: + # Q_OBJECT detection + self.qo_search = re.compile(r'[^A-Za-z0-9]Q_OBJECT[^A-Za-z0-9]') + # cxx and c comment 'eater' + self.ccomment = re.compile(r'/\*(.*?)\*/',re.S) + self.cxxcomment = re.compile(r'//.*$',re.M) + # we also allow Q_OBJECT in a literal string + self.literal_qobject = re.compile(r'"[^\n]*Q_OBJECT[^\n]*"') + + def create_automoc_options(self, env): + """ + Create a dictionary with variables related to Automocing, + based on the current environment. + Is executed once in the __call__ routine. + """ + moc_options = {'auto_scan' : True, + 'auto_scan_strategy' : 0, + 'gobble_comments' : 0, + 'debug' : 0, + 'auto_cpppath' : True, + 'cpppaths' : []} + try: + if int(env.subst('$QT5_AUTOSCAN')) == 0: + moc_options['auto_scan'] = False + except ValueError: + pass + try: + moc_options['auto_scan_strategy'] = int(env.subst('$QT5_AUTOSCAN_STRATEGY')) + except ValueError: + pass + try: + moc_options['gobble_comments'] = int(env.subst('$QT5_GOBBLECOMMENTS')) + except ValueError: + pass + try: + moc_options['debug'] = int(env.subst('$QT5_DEBUG')) + except ValueError: + pass + try: + if int(env.subst('$QT5_AUTOMOC_SCANCPPPATH')) == 0: + moc_options['auto_cpppath'] = False + except ValueError: + pass + if moc_options['auto_cpppath']: + paths = env.get('QT5_AUTOMOC_CPPPATH', []) + if not paths: + paths = env.get('CPPPATH', []) + moc_options['cpppaths'].extend(paths) + + return moc_options + + def __automoc_strategy_simple(self, env, moc_options, + cpp, cpp_contents, out_sources): + """ + Default Automoc strategy (Q_OBJECT driven): detect a header file + (alongside the current cpp/cxx) that contains a Q_OBJECT + macro...and MOC it. + If a Q_OBJECT macro is also found in the cpp/cxx itself, + it gets MOCed too. + """ + + h=None + for h_ext in header_extensions: + # try to find the header file in the corresponding source + # directory + hname = self.splitext(cpp.name)[0] + h_ext + h = find_file(hname, [cpp.get_dir()]+moc_options['cpppaths'], env.File) + if h: + if moc_options['debug']: + print "scons: qt5: Scanning '%s' (header of '%s')" % (str(h), str(cpp)) + h_contents = h.get_contents() + if moc_options['gobble_comments']: + h_contents = self.ccomment.sub('', h_contents) + h_contents = self.cxxcomment.sub('', h_contents) + h_contents = self.literal_qobject.sub('""', h_contents) + break + if not h and moc_options['debug']: + print "scons: qt5: no header for '%s'." % (str(cpp)) + if h and self.qo_search.search(h_contents): + # h file with the Q_OBJECT macro found -> add moc_cpp + moc_cpp = env.Moc5(h) + if moc_options['debug']: + print "scons: qt5: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp)) + + # Now, check whether the corresponding CPP file + # includes the moc'ed output directly... + inc_moc_cpp = r'^\s*#\s*include\s+"%s"' % str(moc_cpp[0]) + if cpp and re.search(inc_moc_cpp, cpp_contents, re.M): + if moc_options['debug']: + print "scons: qt5: CXX file '%s' directly includes the moc'ed output '%s', no compiling required" % (str(cpp), str(moc_cpp)) + env.Depends(cpp, moc_cpp) + else: + moc_o = self.objBuilder(moc_cpp) + if moc_options['debug']: + print "scons: qt5: compiling '%s' to '%s'" % (str(cpp), str(moc_o)) + out_sources.extend(moc_o) + if cpp and self.qo_search.search(cpp_contents): + # cpp file with Q_OBJECT macro found -> add moc + # (to be included in cpp) + moc = env.Moc5(cpp) + env.Ignore(moc, moc) + if moc_options['debug']: + print "scons: qt5: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(cpp), str(moc)) + + def __automoc_strategy_include_driven(self, env, moc_options, + cpp, cpp_contents, out_sources): + """ + Automoc strategy #1 (include driven): searches for "include" + statements of MOCed files in the current cpp/cxx file. + This strategy tries to add support for the compilation + of the qtsolutions... + """ + if self.splitext(str(cpp))[1] in cxx_suffixes: + added = False + h_moc = "%s%s%s" % (env.subst('$QT5_XMOCHPREFIX'), + self.splitext(cpp.name)[0], + env.subst('$QT5_XMOCHSUFFIX')) + cxx_moc = "%s%s%s" % (env.subst('$QT5_XMOCCXXPREFIX'), + self.splitext(cpp.name)[0], + env.subst('$QT5_XMOCCXXSUFFIX')) + inc_h_moc = r'#include\s+"%s"' % h_moc + inc_cxx_moc = r'#include\s+"%s"' % cxx_moc + + # Search for special includes in qtsolutions style + if cpp and re.search(inc_h_moc, cpp_contents): + # cpp file with #include directive for a MOCed header found -> add moc + + # Try to find header file + h=None + hname="" + for h_ext in header_extensions: + # Try to find the header file in the + # corresponding source directory + hname = self.splitext(cpp.name)[0] + h_ext + h = find_file(hname, [cpp.get_dir()]+moc_options['cpppaths'], env.File) + if h: + if moc_options['debug']: + print "scons: qt5: Scanning '%s' (header of '%s')" % (str(h), str(cpp)) + h_contents = h.get_contents() + if moc_options['gobble_comments']: + h_contents = self.ccomment.sub('', h_contents) + h_contents = self.cxxcomment.sub('', h_contents) + h_contents = self.literal_qobject.sub('""', h_contents) + break + if not h and moc_options['debug']: + print "scons: qt5: no header for '%s'." % (str(cpp)) + if h and self.qo_search.search(h_contents): + # h file with the Q_OBJECT macro found -> add moc_cpp + moc_cpp = env.XMoc5(h) + env.Ignore(moc_cpp, moc_cpp) + added = True + # Removing file from list of sources, because it is not to be + # compiled but simply included by the cpp/cxx file. + for idx, s in enumerate(out_sources): + if hasattr(s, "sources") and len(s.sources) > 0: + if str(s.sources[0]) == h_moc: + out_sources.pop(idx) + break + if moc_options['debug']: + print "scons: qt5: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(h_moc)) + else: + if moc_options['debug']: + print "scons: qt5: found no Q_OBJECT macro in '%s', but a moc'ed version '%s' gets included in '%s'" % (str(h), inc_h_moc, cpp.name) + + if cpp and re.search(inc_cxx_moc, cpp_contents): + # cpp file with #include directive for a MOCed cxx file found -> add moc + if self.qo_search.search(cpp_contents): + moc = env.XMoc5(target=cxx_moc, source=cpp) + env.Ignore(moc, moc) + added = True + if moc_options['debug']: + print "scons: qt5: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(cpp), str(moc)) + else: + if moc_options['debug']: + print "scons: qt5: found no Q_OBJECT macro in '%s', although a moc'ed version '%s' of itself gets included" % (cpp.name, inc_cxx_moc) + + if not added: + # Fallback to default Automoc strategy (Q_OBJECT driven) + self.__automoc_strategy_simple(env, moc_options, cpp, + cpp_contents, out_sources) + + def __call__(self, target, source, env): + """ + Smart autoscan function. Gets the list of objects for the Program + or Lib. Adds objects and builders for the special qt5 files. + """ + moc_options = self.create_automoc_options(env) + + # some shortcuts used in the scanner + self.splitext = SCons.Util.splitext + self.objBuilder = getattr(env, self.objBuilderName) + + # The following is kind of hacky to get builders working properly (FIXME) + objBuilderEnv = self.objBuilder.env + self.objBuilder.env = env + mocBuilderEnv = env.Moc5.env + env.Moc5.env = env + xMocBuilderEnv = env.XMoc5.env + env.XMoc5.env = env + + # make a deep copy for the result; MocH objects will be appended + out_sources = source[:] + + for obj in source: + if not moc_options['auto_scan']: + break + if isinstance(obj,basestring): # big kludge! + print "scons: qt5: '%s' MAYBE USING AN OLD SCONS VERSION AND NOT CONVERTED TO 'File'. Discarded." % str(obj) + continue + if not obj.has_builder(): + # binary obj file provided + if moc_options['debug']: + print "scons: qt5: '%s' seems to be a binary. Discarded." % str(obj) + continue + cpp = obj.sources[0] + if not self.splitext(str(cpp))[1] in cxx_suffixes: + if moc_options['debug']: + print "scons: qt5: '%s' is no cxx file. Discarded." % str(cpp) + # c or fortran source + continue + try: + cpp_contents = cpp.get_contents() + if moc_options['gobble_comments']: + cpp_contents = self.ccomment.sub('', cpp_contents) + cpp_contents = self.cxxcomment.sub('', cpp_contents) + cpp_contents = self.literal_qobject.sub('""', cpp_contents) + except: continue # may be an still not generated source + + if moc_options['auto_scan_strategy'] == 0: + # Default Automoc strategy (Q_OBJECT driven) + self.__automoc_strategy_simple(env, moc_options, + cpp, cpp_contents, out_sources) + else: + # Automoc strategy #1 (include driven) + self.__automoc_strategy_include_driven(env, moc_options, + cpp, cpp_contents, out_sources) + + # restore the original env attributes (FIXME) + self.objBuilder.env = objBuilderEnv + env.Moc5.env = mocBuilderEnv + env.XMoc5.env = xMocBuilderEnv + + # We return the set of source entries as sorted sequence, else + # the order might accidentally change from one build to another + # and trigger unwanted rebuilds. For proper sorting, a key function + # has to be specified...FS.Entry (and Base nodes in general) do not + # provide a __cmp__, for performance reasons. + return (target, sorted(set(out_sources), key=lambda entry : str(entry))) + +AutomocShared = _Automoc('SharedObject') +AutomocStatic = _Automoc('StaticObject') + +def _detect(env): + """Not really safe, but fast method to detect the Qt5 library""" + try: return env['QT5DIR'] + except KeyError: pass + + try: return env['QTDIR'] + except KeyError: pass + + try: return os.environ['QT5DIR'] + except KeyError: pass + + try: return os.environ['QTDIR'] + except KeyError: pass + + moc = env.WhereIs('moc-qt5') or env.WhereIs('moc5') or env.WhereIs('moc') + if moc: + vernumber = os.popen3('%s -v' % moc)[2].read() + vernumber = mocver_re.match(vernumber) + if vernumber: + vernumber = [ int(x) for x in vernumber.groups() ] + if vernumber < [5, 0, 0]: + vernumber = '.'.join([str(x) for x in vernumber]) + moc = None + SCons.Warnings.warn( + QtdirNotFound, + "QT5DIR variable not defined, and detected moc is for Qt %s" % vernumber) + + QT5DIR = os.path.dirname(os.path.dirname(moc)) + SCons.Warnings.warn( + QtdirNotFound, + "QT5DIR variable is not defined, using moc executable as a hint (QT5DIR=%s)" % QT5DIR) + return QT5DIR + + raise SCons.Errors.StopError( + QtdirNotFound, + "Could not detect Qt 5 installation") + return None + + +def __scanResources(node, env, path, arg): + # Helper function for scanning .qrc resource files + # I've been careful on providing names relative to the qrc file + # If that was not needed this code could be simplified a lot + def recursiveFiles(basepath, path) : + result = [] + for item in os.listdir(os.path.join(basepath, path)) : + itemPath = os.path.join(path, item) + if os.path.isdir(os.path.join(basepath, itemPath)) : + result += recursiveFiles(basepath, itemPath) + else: + result.append(itemPath) + return result + contents = node.get_contents() + includes = qrcinclude_re.findall(contents) + qrcpath = os.path.dirname(node.path) + dirs = [included for included in includes if os.path.isdir(os.path.join(qrcpath,included))] + # dirs need to include files recursively + for dir in dirs : + includes.remove(dir) + includes+=recursiveFiles(qrcpath,dir) + return includes + +# +# Scanners +# +__qrcscanner = SCons.Scanner.Scanner(name = 'qrcfile', + function = __scanResources, + argument = None, + skeys = ['.qrc']) + +# +# Emitters +# +def __qrc_path(head, prefix, tail, suffix): + if head: + if tail: + return os.path.join(head, "%s%s%s" % (prefix, tail, suffix)) + else: + return "%s%s%s" % (prefix, head, suffix) + else: + return "%s%s%s" % (prefix, tail, suffix) +def __qrc_emitter(target, source, env): + sourceBase, sourceExt = os.path.splitext(SCons.Util.to_String(source[0])) + sHead = None + sTail = sourceBase + if sourceBase: + sHead, sTail = os.path.split(sourceBase) + + t = __qrc_path(sHead, env.subst('$QT5_QRCCXXPREFIX'), + sTail, env.subst('$QT5_QRCCXXSUFFIX')) + + return t, source + +# +# Action generators +# +def __moc_generator_from_h(source, target, env, for_signature): + pass_defines = False + try: + if int(env.subst('$QT5_CPPDEFINES_PASSTOMOC')) == 1: + pass_defines = True + except ValueError: + pass + + if pass_defines: + return '$QT5_MOC $QT5_MOCDEFINES $QT5_MOCFROMHFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE' + else: + return '$QT5_MOC $QT5_MOCFROMHFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE' + +def __moc_generator_from_cxx(source, target, env, for_signature): + pass_defines = False + try: + if int(env.subst('$QT5_CPPDEFINES_PASSTOMOC')) == 1: + pass_defines = True + except ValueError: + pass + + if pass_defines: + return ['$QT5_MOC $QT5_MOCDEFINES $QT5_MOCFROMCXXFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE', + SCons.Action.Action(checkMocIncluded,None)] + else: + return ['$QT5_MOC $QT5_MOCFROMCXXFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE', + SCons.Action.Action(checkMocIncluded,None)] + +def __mocx_generator_from_h(source, target, env, for_signature): + pass_defines = False + try: + if int(env.subst('$QT5_CPPDEFINES_PASSTOMOC')) == 1: + pass_defines = True + except ValueError: + pass + + if pass_defines: + return '$QT5_MOC $QT5_MOCDEFINES $QT5_MOCFROMHFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE' + else: + return '$QT5_MOC $QT5_MOCFROMHFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE' + +def __mocx_generator_from_cxx(source, target, env, for_signature): + pass_defines = False + try: + if int(env.subst('$QT5_CPPDEFINES_PASSTOMOC')) == 1: + pass_defines = True + except ValueError: + pass + + if pass_defines: + return ['$QT5_MOC $QT5_MOCDEFINES $QT5_MOCFROMCXXFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE', + SCons.Action.Action(checkMocIncluded,None)] + else: + return ['$QT5_MOC $QT5_MOCFROMCXXFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE', + SCons.Action.Action(checkMocIncluded,None)] + +def __qrc_generator(source, target, env, for_signature): + name_defined = False + try: + if env.subst('$QT5_QRCFLAGS').find('-name') >= 0: + name_defined = True + except ValueError: + pass + + if name_defined: + return '$QT5_RCC $QT5_QRCFLAGS $SOURCE -o $TARGET' + else: + qrc_suffix = env.subst('$QT5_QRCSUFFIX') + src = str(source[0]) + head, tail = os.path.split(src) + if tail: + src = tail + qrc_suffix = env.subst('$QT5_QRCSUFFIX') + if src.endswith(qrc_suffix): + qrc_stem = src[:-len(qrc_suffix)] + else: + qrc_stem = src + return '$QT5_RCC $QT5_QRCFLAGS -name %s $SOURCE -o $TARGET' % qrc_stem + +# +# Builders +# +__ts_builder = SCons.Builder.Builder( + action = SCons.Action.Action('$QT5_LUPDATECOM','$QT5_LUPDATECOMSTR'), + suffix = '.ts', + source_factory = SCons.Node.FS.Entry) +__qm_builder = SCons.Builder.Builder( + action = SCons.Action.Action('$QT5_LRELEASECOM','$QT5_LRELEASECOMSTR'), + src_suffix = '.ts', + suffix = '.qm') +__qrc_builder = SCons.Builder.Builder( + action = SCons.Action.CommandGeneratorAction(__qrc_generator, {'cmdstr':'$QT5_QRCCOMSTR'}), + source_scanner = __qrcscanner, + src_suffix = '$QT5_QRCSUFFIX', + suffix = '$QT5_QRCCXXSUFFIX', + prefix = '$QT5_QRCCXXPREFIX', + single_source = 1) +__ex_moc_builder = SCons.Builder.Builder( + action = SCons.Action.CommandGeneratorAction(__moc_generator_from_h, {'cmdstr':'$QT5_MOCCOMSTR'})) +__ex_uic_builder = SCons.Builder.Builder( + action = SCons.Action.Action('$QT5_UICCOM', '$QT5_UICCOMSTR'), + src_suffix = '.ui') + + +# +# Wrappers (pseudo-Builders) +# +def Ts5(env, target, source=None, *args, **kw): + """ + A pseudo-Builder wrapper around the LUPDATE executable of Qt5. + lupdate [options] [source-file|path]... -ts ts-files + """ + if not SCons.Util.is_List(target): + target = [target] + if not source: + source = target[:] + if not SCons.Util.is_List(source): + source = [source] + + # Check QT5_CLEAN_TS and use NoClean() function + clean_ts = False + try: + if int(env.subst('$QT5_CLEAN_TS')) == 1: + clean_ts = True + except ValueError: + pass + + result = [] + for t in target: + obj = __ts_builder.__call__(env, t, source, **kw) + # Prevent deletion of the .ts file, unless explicitly specified + if not clean_ts: + env.NoClean(obj) + # Always make our target "precious", such that it is not deleted + # prior to a rebuild + env.Precious(obj) + # Add to resulting target list + result.extend(obj) + + return result + +def Qm5(env, target, source=None, *args, **kw): + """ + A pseudo-Builder wrapper around the LRELEASE executable of Qt5. + lrelease [options] ts-files [-qm qm-file] + """ + if not SCons.Util.is_List(target): + target = [target] + if not source: + source = target[:] + if not SCons.Util.is_List(source): + source = [source] + + result = [] + for t in target: + result.extend(__qm_builder.__call__(env, t, source, **kw)) + + return result + +def Qrc5(env, target, source=None, *args, **kw): + """ + A pseudo-Builder wrapper around the RCC executable of Qt5. + rcc [options] qrc-files -o out-file + """ + if not SCons.Util.is_List(target): + target = [target] + if not source: + source = target[:] + if not SCons.Util.is_List(source): + source = [source] + + result = [] + for t, s in zip(target, source): + result.extend(__qrc_builder.__call__(env, t, s, **kw)) + + return result + +def ExplicitMoc5(env, target, source, *args, **kw): + """ + A pseudo-Builder wrapper around the MOC executable of Qt5. + moc [options] + """ + if not SCons.Util.is_List(target): + target = [target] + if not SCons.Util.is_List(source): + source = [source] + + result = [] + for t in target: + # Is it a header or a cxx file? + result.extend(__ex_moc_builder.__call__(env, t, source, **kw)) + + return result + +def ExplicitUic5(env, target, source, *args, **kw): + """ + A pseudo-Builder wrapper around the UIC executable of Qt5. + uic [options] + """ + if not SCons.Util.is_List(target): + target = [target] + if not SCons.Util.is_List(source): + source = [source] + + result = [] + for t in target: + result.extend(__ex_uic_builder.__call__(env, t, source, **kw)) + + return result + +def generate(env): + """Add Builders and construction variables for qt5 to an Environment.""" + + suffixes = [ + '-qt5', + '-qt5.exe', + '5', + '5.exe', + '', + '.exe', + ] + command_suffixes = ['-qt5', '5', ''] + + def locateQt5Command(env, command, qtdir) : + triedPaths = [] + for suffix in suffixes : + fullpath = os.path.join(qtdir,'bin',command + suffix) + if os.access(fullpath, os.X_OK) : + return fullpath + triedPaths.append(fullpath) + + fullpath = env.Detect([command+s for s in command_suffixes]) + if not (fullpath is None) : return fullpath + + raise Exception("Qt5 command '" + command + "' not found. Tried: " + ', '.join(triedPaths)) + + CLVar = SCons.Util.CLVar + Action = SCons.Action.Action + Builder = SCons.Builder.Builder + + env['QT5DIR'] = _detect(env) + # TODO: 'Replace' should be 'SetDefault' +# env.SetDefault( + env.Replace( + QT5DIR = _detect(env), + QT5_BINPATH = os.path.join('$QT5DIR', 'bin'), + # TODO: This is not reliable to QT5DIR value changes but needed in order to support '-qt5' variants + QT5_MOC = locateQt5Command(env,'moc', env['QT5DIR']), + QT5_UIC = locateQt5Command(env,'uic', env['QT5DIR']), + QT5_RCC = locateQt5Command(env,'rcc', env['QT5DIR']), + QT5_LUPDATE = locateQt5Command(env,'lupdate', env['QT5DIR']), + QT5_LRELEASE = locateQt5Command(env,'lrelease', env['QT5DIR']), + + QT5_AUTOSCAN = 1, # Should the qt5 tool try to figure out, which sources are to be moc'ed? + QT5_AUTOSCAN_STRATEGY = 0, # While scanning for files to moc, should we search for includes in qtsolutions style? + QT5_GOBBLECOMMENTS = 0, # If set to 1, comments are removed before scanning cxx/h files. + QT5_CPPDEFINES_PASSTOMOC = 1, # If set to 1, all CPPDEFINES get passed to the moc executable. + QT5_CLEAN_TS = 0, # If set to 1, translation files (.ts) get cleaned on 'scons -c' + QT5_AUTOMOC_SCANCPPPATH = 1, # If set to 1, the CPPPATHs (or QT5_AUTOMOC_CPPPATH) get scanned for moc'able files + QT5_AUTOMOC_CPPPATH = [], # Alternative paths that get scanned for moc files + + # Some Qt5 specific flags. I don't expect someone wants to + # manipulate those ... + QT5_UICFLAGS = CLVar(''), + QT5_MOCFROMHFLAGS = CLVar(''), + QT5_MOCFROMCXXFLAGS = CLVar('-i'), + QT5_QRCFLAGS = '', + QT5_LUPDATEFLAGS = '', + QT5_LRELEASEFLAGS = '', + + # suffixes/prefixes for the headers / sources to generate + QT5_UISUFFIX = '.ui', + QT5_UICDECLPREFIX = 'ui_', + QT5_UICDECLSUFFIX = '.h', + QT5_MOCINCPREFIX = '-I', + QT5_MOCHPREFIX = 'moc_', + QT5_MOCHSUFFIX = '$CXXFILESUFFIX', + QT5_MOCCXXPREFIX = '', + QT5_MOCCXXSUFFIX = '.moc', + QT5_QRCSUFFIX = '.qrc', + QT5_QRCCXXSUFFIX = '$CXXFILESUFFIX', + QT5_QRCCXXPREFIX = 'qrc_', + QT5_MOCDEFPREFIX = '-D', + QT5_MOCDEFSUFFIX = '', + QT5_MOCDEFINES = '${_defines(QT5_MOCDEFPREFIX, CPPDEFINES, QT5_MOCDEFSUFFIX, __env__)}', + QT5_MOCCPPPATH = [], + QT5_MOCINCFLAGS = '$( ${_concat(QT5_MOCINCPREFIX, QT5_MOCCPPPATH, INCSUFFIX, __env__, RDirs)} $)', + + # Commands for the qt5 support ... + QT5_UICCOM = '$QT5_UIC $QT5_UICFLAGS -o $TARGET $SOURCE', + QT5_LUPDATECOM = '$QT5_LUPDATE $QT5_LUPDATEFLAGS $SOURCES -ts $TARGET', + QT5_LRELEASECOM = '$QT5_LRELEASE $QT5_LRELEASEFLAGS -qm $TARGET $SOURCES', + + # Specialized variables for the Extended Automoc support + # (Strategy #1 for qtsolutions) + QT5_XMOCHPREFIX = 'moc_', + QT5_XMOCHSUFFIX = '.cpp', + QT5_XMOCCXXPREFIX = '', + QT5_XMOCCXXSUFFIX = '.moc', + + ) + + try: + env.AddMethod(Ts5, "Ts5") + env.AddMethod(Qm5, "Qm5") + env.AddMethod(Qrc5, "Qrc5") + env.AddMethod(ExplicitMoc5, "ExplicitMoc5") + env.AddMethod(ExplicitUic5, "ExplicitUic5") + except AttributeError: + # Looks like we use a pre-0.98 version of SCons... + from SCons.Script.SConscript import SConsEnvironment + SConsEnvironment.Ts5 = Ts5 + SConsEnvironment.Qm5 = Qm5 + SConsEnvironment.Qrc5 = Qrc5 + SConsEnvironment.ExplicitMoc5 = ExplicitMoc5 + SConsEnvironment.ExplicitUic5 = ExplicitUic5 + + # Interface builder + uic5builder = Builder( + action = SCons.Action.Action('$QT5_UICCOM', '$QT5_UICCOMSTR'), + src_suffix='$QT5_UISUFFIX', + suffix='$QT5_UICDECLSUFFIX', + prefix='$QT5_UICDECLPREFIX', + single_source = True + #TODO: Consider the uiscanner on new scons version + ) + env['BUILDERS']['Uic5'] = uic5builder + + # Metaobject builder + mocBld = Builder(action={}, prefix={}, suffix={}) + for h in header_extensions: + act = SCons.Action.CommandGeneratorAction(__moc_generator_from_h, {'cmdstr':'$QT5_MOCCOMSTR'}) + mocBld.add_action(h, act) + mocBld.prefix[h] = '$QT5_MOCHPREFIX' + mocBld.suffix[h] = '$QT5_MOCHSUFFIX' + for cxx in cxx_suffixes: + act = SCons.Action.CommandGeneratorAction(__moc_generator_from_cxx, {'cmdstr':'$QT5_MOCCOMSTR'}) + mocBld.add_action(cxx, act) + mocBld.prefix[cxx] = '$QT5_MOCCXXPREFIX' + mocBld.suffix[cxx] = '$QT5_MOCCXXSUFFIX' + env['BUILDERS']['Moc5'] = mocBld + + # Metaobject builder for the extended auto scan feature + # (Strategy #1 for qtsolutions) + xMocBld = Builder(action={}, prefix={}, suffix={}) + for h in header_extensions: + act = SCons.Action.CommandGeneratorAction(__mocx_generator_from_h, {'cmdstr':'$QT5_MOCCOMSTR'}) + xMocBld.add_action(h, act) + xMocBld.prefix[h] = '$QT5_XMOCHPREFIX' + xMocBld.suffix[h] = '$QT5_XMOCHSUFFIX' + for cxx in cxx_suffixes: + act = SCons.Action.CommandGeneratorAction(__mocx_generator_from_cxx, {'cmdstr':'$QT5_MOCCOMSTR'}) + xMocBld.add_action(cxx, act) + xMocBld.prefix[cxx] = '$QT5_XMOCCXXPREFIX' + xMocBld.suffix[cxx] = '$QT5_XMOCCXXSUFFIX' + env['BUILDERS']['XMoc5'] = xMocBld + + # Add the Qrc5 action to the CXX file builder (registers the + # *.qrc extension with the Environment) + cfile_builder, cxxfile_builder = SCons.Tool.createCFileBuilders(env) + qrc_act = SCons.Action.CommandGeneratorAction(__qrc_generator, {'cmdstr':'$QT5_QRCCOMSTR'}) + cxxfile_builder.add_action('$QT5_QRCSUFFIX', qrc_act) + cxxfile_builder.add_emitter('$QT5_QRCSUFFIX', __qrc_emitter) + + # We use the emitters of Program / StaticLibrary / SharedLibrary + # to scan for moc'able files + # We can't refer to the builders directly, we have to fetch them + # as Environment attributes because that sets them up to be called + # correctly later by our emitter. + env.AppendUnique(PROGEMITTER =[AutomocStatic], + SHLIBEMITTER=[AutomocShared], + LIBEMITTER =[AutomocStatic], + ) + + # TODO: Does dbusxml2cpp need an adapter + try: + env.AddMethod(enable_modules, "EnableQt5Modules") + except AttributeError: + # Looks like we use a pre-0.98 version of SCons... + from SCons.Script.SConscript import SConsEnvironment + SConsEnvironment.EnableQt5Modules = enable_modules + +def enable_modules(self, modules, debug=False, crosscompiling=False) : + import sys + + validModules = [ + # Qt Essentials + 'QtCore', + 'QtGui', + 'QtMultimedia', + 'QtMultimediaQuick_p', + 'QtMultimediaWidgets', + 'QtNetwork', + 'QtPlatformSupport', + 'QtQml', + 'QtQmlDevTools', + 'QtQuick', + 'QtQuickParticles', + 'QtSql', + 'QtQuickTest', + 'QtTest', + 'QtWebKit', + 'QtWebKitWidgets', + 'QtWidgets', + # Qt Add-Ons + 'QtConcurrent', + 'QtDBus', + 'QtOpenGL', + 'QtPrintSupport', + 'QtDeclarative', + 'QtScript', + 'QtScriptTools', + 'QtSvg', + 'QtUiTools', + 'QtXml', + 'QtXmlPatterns', + # Qt Tools + 'QtHelp', + 'QtDesigner', + 'QtDesignerComponents', + # Other + 'QtCLucene', + 'QtConcurrent', + 'QtV8' + ] + pclessModules = [ + ] + staticModules = [ + ] + invalidModules=[] + for module in modules: + if module not in validModules : + invalidModules.append(module) + if invalidModules : + raise Exception("Modules %s are not Qt5 modules. Valid Qt5 modules are: %s"% ( + str(invalidModules),str(validModules))) + + moduleDefines = { + 'QtScript' : ['QT_SCRIPT_LIB'], + 'QtSvg' : ['QT_SVG_LIB'], + 'QtSql' : ['QT_SQL_LIB'], + 'QtXml' : ['QT_XML_LIB'], + 'QtOpenGL' : ['QT_OPENGL_LIB'], + 'QtGui' : ['QT_GUI_LIB'], + 'QtNetwork' : ['QT_NETWORK_LIB'], + 'QtCore' : ['QT_CORE_LIB'], + 'QtWidgets' : ['QT_WIDGETS_LIB'], + } + for module in modules : + try : self.AppendUnique(CPPDEFINES=moduleDefines[module]) + except: pass + debugSuffix = '' + if sys.platform in ["darwin", "linux2"] and not crosscompiling : + if debug : debugSuffix = '_debug' + for module in modules : + if module not in pclessModules : continue + self.AppendUnique(LIBS=[module.replace('Qt','Qt5')+debugSuffix]) + self.AppendUnique(LIBPATH=[os.path.join("$QT5DIR","lib")]) + self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include")]) + self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include",module)]) + pcmodules = [module.replace('Qt','Qt5')+debugSuffix for module in modules if module not in pclessModules ] + if 'Qt5DBus' in pcmodules: + self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include","Qt5DBus")]) + if "Qt5Assistant" in pcmodules: + self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include","Qt5Assistant")]) + pcmodules.remove("Qt5Assistant") + pcmodules.append("Qt5AssistantClient") + self.AppendUnique(RPATH=[os.path.join("$QT5DIR","lib")]) + self.ParseConfig('pkg-config %s --libs --cflags'% ' '.join(pcmodules)) + self["QT5_MOCCPPPATH"] = self["CPPPATH"] + return + if sys.platform == "win32" or crosscompiling : + if crosscompiling: + transformedQtdir = transformToWinePath(self['QT5DIR']) + self['QT5_MOC'] = "QT5DIR=%s %s"%( transformedQtdir, self['QT5_MOC']) + self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include")]) + try: modules.remove("QtDBus") + except: pass + if debug : debugSuffix = 'd' + if "QtAssistant" in modules: + self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include","QtAssistant")]) + modules.remove("QtAssistant") + modules.append("QtAssistantClient") + self.AppendUnique(LIBS=['qtmain'+debugSuffix]) + self.AppendUnique(LIBS=[lib.replace("Qt","Qt5")+debugSuffix for lib in modules if lib not in staticModules]) + self.PrependUnique(LIBS=[lib+debugSuffix for lib in modules if lib in staticModules]) + if 'QtOpenGL' in modules: + self.AppendUnique(LIBS=['opengl32']) + self.AppendUnique(CPPPATH=[ '$QT5DIR/include/']) + self.AppendUnique(CPPPATH=[ '$QT5DIR/include/'+module for module in modules]) + if crosscompiling : + self["QT5_MOCCPPPATH"] = [ + path.replace('$QT5DIR', transformedQtdir) + for path in self['CPPPATH'] ] + else : + self["QT5_MOCCPPPATH"] = self["CPPPATH"] + self.AppendUnique(LIBPATH=[os.path.join('$QT5DIR','lib')]) + return + + """ + if sys.platform=="darwin" : + # TODO: Test debug version on Mac + self.AppendUnique(LIBPATH=[os.path.join('$QT5DIR','lib')]) + self.AppendUnique(LINKFLAGS="-F$QT5DIR/lib") + self.AppendUnique(LINKFLAGS="-L$QT5DIR/lib") #TODO clean! + if debug : debugSuffix = 'd' + for module in modules : +# self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include")]) +# self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include",module)]) +# port qt5-mac: + self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include", "qt5")]) + self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include", "qt5", module)]) + if module in staticModules : + self.AppendUnique(LIBS=[module+debugSuffix]) # TODO: Add the debug suffix + self.AppendUnique(LIBPATH=[os.path.join("$QT5DIR","lib")]) + else : +# self.Append(LINKFLAGS=['-framework', module]) +# port qt5-mac: + self.Append(LIBS=module) + if 'QtOpenGL' in modules: + self.AppendUnique(LINKFLAGS="-F/System/Library/Frameworks") + self.Append(LINKFLAGS=['-framework', 'AGL']) #TODO ughly kludge to avoid quotes + self.Append(LINKFLAGS=['-framework', 'OpenGL']) + self["QT5_MOCCPPPATH"] = self["CPPPATH"] + return +# This should work for mac but doesn't +# env.AppendUnique(FRAMEWORKPATH=[os.path.join(env['QT5DIR'],'lib')]) +# env.AppendUnique(FRAMEWORKS=['QtCore','QtGui','QtOpenGL', 'AGL']) + """ + +def exists(env): + return _detect(env) diff --git a/tests/site_scons/site_tools/qt5/docs/SConstruct b/tests/site_scons/site_tools/qt5/docs/SConstruct new file mode 100644 index 0000000..e4afdf7 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/docs/SConstruct @@ -0,0 +1,34 @@ +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +import os + +env = Environment(ENV = os.environ, + tools = ['docbook']) + +env.DocbookPdf('manual', DOCBOOK_XSL='pdf.xsl') +env.DocbookPdf('reference', DOCBOOK_XSL='pdf.xsl') + +env.DocbookHtml('manual', DOCBOOK_XSL='html.xsl') +env.DocbookHtml('reference', DOCBOOK_XSL='html.xsl') + diff --git a/tests/site_scons/site_tools/qt5/docs/html.xsl b/tests/site_scons/site_tools/qt5/docs/html.xsl new file mode 100644 index 0000000..dd7bf5f --- /dev/null +++ b/tests/site_scons/site_tools/qt5/docs/html.xsl @@ -0,0 +1,55 @@ + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + + diff --git a/tests/site_scons/site_tools/qt5/docs/manual.xml b/tests/site_scons/site_tools/qt5/docs/manual.xml new file mode 100644 index 0000000..490a410 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/docs/manual.xml @@ -0,0 +1,388 @@ + + + +
+ The SCons qt5 tool + + + + Dirk Baechle + + + 2012-12-13 + + +
+ Basics + + This tool can be used to compile Qt projects, designed for versions + 5.x.y and higher. It is not usable for Qt3 and older versions, since some + of the helper tools (moc, uic) + behave different. + +
+ Install + + Installing it, requires you to copy (or, even better: checkout) + the contents of the package's qt5 folder to + + + + /path_to_your_project/site_scons/site_tools/qt5, + if you need the Qt5 Tool in one project only, or + + + + ~/.scons/site_scons/site_tools/qt5, + for a system-wide installation under your current login. + + + + For more infos about this, please refer to + + + + the SCons User's Guide, sect. "Where to put your custom + Builders and Tools" and + + + + the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. + + +
+ +
+ How to activate + + For activating the tool "qt5", you have to add its name to the + Environment constructor, like this + + env = Environment(tools=['default','qt5']) + + + On its startup, the Qt5 tool tries to read the variable + QT5DIR from the current Environment and + os.environ. If it is not set, the value of + QTDIR (in Environment/os.environ) + is used as a fallback. + + So, you either have to explicitly give the path of your Qt5 + installation to the Environment with + + env['QT5DIR'] = '/usr/local/Trolltech/Qt-5.2.3' + + + or set the QT5DIR as environment variable in + your shell. +
+ +
+ Requirements + + Under Linux, "qt5" uses the system tool + pkg-config for automatically setting the required + compile and link flags of the single Qt5 modules (like QtCore, + QtGui,...). This means that + + + + you should have pkg-config installed, + and + + + + you additionally have to set + PKG_CONFIG_PATH in your shell environment, such + that it points to $QT5DIR/lib/pkgconfig (or + $QT5DIR/lib for some older versions). + + + + Based on these two environment variables + (QT5DIR and PKG_CONFIG_PATH), the + "qt5" tool initializes all QT5_* construction + variables listed in the Reference manual. This happens when the tool is + "detected" during Environment construction. As a consequence, the setup + of the tool gets a two-stage process, if you want to override the values + provided by your current shell settings: + + # Stage 1: create plain environment +qtEnv = Environment() +# Set new vars +qtEnv['QT5DIR'] = '/usr/local/Trolltech/Qt-5.2.3 +qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-5.2.3/lib/pkgconfig' +# Stage 2: add qt5 tool +qtEnv.Tool('qt5') + +
+
+ +
+ Suggested boilerplate + + Based on the requirements above, we suggest a simple ready-to-go + setup as follows: + + SConstruct + + # Detect Qt version +qtdir = detectLatestQtDir() + +# Create base environment +baseEnv = Environment() +#...further customization of base env + +# Clone Qt environment +qtEnv = baseEnv.Clone() +# Set QT5DIR and PKG_CONFIG_PATH +qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') +qtEnv['QT5DIR'] = qtdir +# Add qt5 tool +qtEnv.Tool('qt5') +#...further customization of qt env + +# Export environments +Export('baseEnv qtEnv') + +# Your other stuff... +# ...including the call to your SConscripts + + + In a SConscript + + # Get the Qt5 environment +Import('qtEnv') +# Clone it +env = qtEnv.clone() +# Patch it +env.Append(CCFLAGS=['-m32']) # or whatever +# Use it +env.StaticLibrary('foo', Glob('*.cpp')) + + + The detection of the Qt directory could be as simple as directly + assigning a fixed path + + def detectLatestQtDir(): + return "/usr/local/qt5.3.2" + + + or a little more sophisticated + + # Tries to detect the path to the installation of Qt with +# the highest version number +def detectLatestQtDir(): + if sys.platform.startswith("linux"): + # Simple check: inspect only '/usr/local/Trolltech' + paths = glob.glob('/usr/local/Trolltech/*') + if len(paths): + paths.sort() + return paths[-1] + else: + return "" + else: + # Simple check: inspect only 'C:\Qt' + paths = glob.glob('C:\\Qt\\*') + if len(paths): + paths.sort() + return paths[-1] + else: + return os.environ.get("QTDIR","") + +
+ +
+ A first project + + The following SConscript is for a simple project with some cxx + files, using the QtCore, QtGui and QtNetwork modules: + + Import('qtEnv') +env = qtEnv.Clone() +env.EnableQt5Modules([ + 'QtGui', + 'QtCore', + 'QtNetwork' + ]) +# Add your CCFLAGS and CPPPATHs to env here... + +env.Program('foo', Glob('*.cpp')) + +
+ +
+ MOC it up + + For the basic support of automocing, nothing needs to be done by the + user. The tool usually detects the Q_OBJECT macro and + calls the moc executable + accordingly. + + If you don't want this, you can switch off the automocing by + a + + env['QT5_AUTOSCAN'] = 0 + + + in your SConscript file. Then, you have to moc your files + explicitly, using the Moc5 builder. + + You can also switch to an extended automoc strategy with + + env['QT5_AUTOSCAN_STRATEGY'] = 1 + + + Please read the description of the + QT5_AUTOSCAN_STRATEGY variable in the Reference manual + for details. + + For debugging purposes, you can set the variable + QT5_DEBUG with + + env['QT5_DEBUG'] = 1 + + + which outputs a lot of messages during automocing. +
+ +
+ Forms (.ui) + + The header files with setup code for your GUI classes, are not + compiled automatically from your .ui files. You always + have to call the Uic5 builder explicitly like + + env.Uic5(Glob('*.ui')) +env.Program('foo', Glob('*.cpp')) + +
+ +
+ Resource files (.qrc) + + Resource files are not built automatically, you always have to add + the names of the .qrc files to the source list for your + program or library: + + env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) + + + For each of the Resource input files, its prefix defines the name of + the resulting resource. An appropriate + -name option is added to the call of the + rcc executable by default. + + You can also call the Qrc5 builder explicitly as + + qrccc = env.Qrc5('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] + + + or (overriding the default suffix) + + qrccc = env.Qrc5('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] + + + and then add the resulting cxx file to the sources of your + Program/Library: + + env.Program('foo', Glob('*.cpp') + qrccc) + +
+ +
+ Translation files + + The update of the .ts files and the conversion to + binary .qm files is not done automatically. You have to + call the corresponding builders on your own. + + Example for updating a translation file: + + env.Ts5('foo.ts','.') # -> ['foo.ts'] + + + By default, the .ts files are treated as + precious targets. This means that they are not + removed prior to a rebuild, but simply get updated. Additionally, they do + not get cleaned on a scons -c. If you + want to delete the translation files on the + -c SCons command, you can set the + variable QT5_CLEAN_TS like this + + env['QT5_CLEAN_TS']=1 + + + Example for releasing a translation file, i.e. compiling it to a + .qm binary file: + + env.Qm5('foo') # ['foo.ts'] -> ['foo.qm'] + + + or (overriding the output prefix) + + env.Qm5('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] + + + As an extension both, the Ts5() and Qm5 builder, support the + definition of multiple targets. So, calling + + env.Ts5(['app_en','app_de'], Glob('*.cpp')) + + + and + + env.Qm5(['app','copy'], Glob('*.ts')) + + + should work fine. + + Finally, two short notes about the support of directories for the + Ts5() builder. You can pass an arbitrary mix of cxx files and subdirs to + it, as in + + env.Ts5('app_en',['sub1','appwindow.cpp','main.cpp'])) + + + where sub1 is a folder that gets scanned + recursively for cxx files by lupdate. But like this, + you lose all dependency information for the subdir, i.e. if a file inside + the folder changes, the .ts file is not updated automatically! In this + case you should tell SCons to always update the target: + + ts = env.Ts5('app_en',['sub1','appwindow.cpp','main.cpp']) +env.AlwaysBuild(ts) + + + Last note: specifying the current folder + . as input to Ts5() and storing the + resulting .ts file in the same directory, leads to a dependency cycle! You + then have to store the .ts and .qm files outside of the current folder, or + use Glob('*.cpp')) instead. +
+
diff --git a/tests/site_scons/site_tools/qt5/docs/pdf.xsl b/tests/site_scons/site_tools/qt5/docs/pdf.xsl new file mode 100644 index 0000000..fbdc591 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/docs/pdf.xsl @@ -0,0 +1,62 @@ + + + + + + + + + + +0pt + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + + + + + + diff --git a/tests/site_scons/site_tools/qt5/docs/qt5.xml b/tests/site_scons/site_tools/qt5/docs/qt5.xml new file mode 100644 index 0000000..d067cad --- /dev/null +++ b/tests/site_scons/site_tools/qt5/docs/qt5.xml @@ -0,0 +1,600 @@ + + + +Sets construction variables for building Qt5 applications. + + +QT5DIR +QT5_BINPATH +QT5_MOC +QT5_UIC +QT5_RCC +QT5_AUTOSCAN +QT5_AUTOSCAN_STRATEGY +QT5_AUTOMOC_CPPPATH +QT5_AUTOMOC_SCANCPPPATH +QT5_UICFLAGS +QT5_MOCFROMHFLAGS +QT5_MOCFROMCXXFLAGS +QT5_UICDECLPREFIX +QT5_UICDECLSUFFIX +QT5_MOCHPREFIX +QT5_MOCHSUFFIX +QT5_MOCCXXPREFIX +QT5_MOCCXXSUFFIX +QT5_MOCDEFPREFIX +QT5_MOCDEFSUFFIX +QT5_UISUFFIX +QT5_UICCOM +QT5_GOBBLECOMMENTS +QT5_CPPDEFINES_PASSTOMOC +QT5_CLEAN_TS +QT5_DEBUG +QT5_XMOCHPREFIX +QT5_XMOCHSUFFIX +QT5_XMOCCXXPREFIX +QT5_XMOCCXXSUFFIX +QT5_LUPDATE +QT5_LRELEASE +QT5_LUPDATEFLAGS +QT5_LRELEASEFLAGS +QT5_QRCFLAGS +QT5_UICDECLPREFIX +QT5_UICDECLSUFFIX +QT5_MOCINCPREFIX +QT5_QRCSUFFIX +QT5_QRCCXXSUFFIX +QT5_QRCCXXPREFIX +QT5_MOCDEFINES +QT5_MOCCPPPATH +QT5_MOCINCFLAGS +QT5_LUPDATECOM +QT5_LRELEASECOM + + + + + + + +Builds an output file from a moc input file. Moc input files are either +header files or cxx files. This builder is only available after using the +tool 'qt5'. It should be your first choice when manually Mocing files +and is the builder for the Q_OBJECT driven Automoc strategy (#0, the default). +It can can be controlled via the QT5_MOC* variables. See the &cv-link-QT5DIR; and +&cv-link-QT5_AUTOSCAN_STRATEGY; variables for more information. +Example: + + +env.Moc5('foo.h') # generates moc_foo.cc +env.Moc5('foo.cpp') # generates foo.moc + + + + + + +Just like the &b-Moc5; builder, it builds an output file from a moc input file. +Moc input files are either header files or cxx files. This builder is only available after using the +tool 'qt5'. It is defined separately for the include driven Automoc strategy (#1) +and can be controlled via the QT5_XMOC* variables. See the &cv-link-QT5DIR; and +&cv-link-QT5_AUTOSCAN_STRATEGY; variables for more information. +Example: + + +env.XMoc5('foo.h') # generates moc_foo.cpp +env.XMoc5('foo.cpp') # generates foo.moc + + + + + + +Just like the &b-Moc5; builder, it builds an output file from a moc input file. +However, it does not use any default prefix or suffix for the filenames. +You can, and have to, specify the full source and target names explicitly. +This builder is only available after using the +tool 'qt5'. It can be your last resort, when you have to moc single files +from/to exotic filenames. +Example: + + +env.ExplicitMoc5('moced_foo.cxx','foo.h') # generates moced_foo.cxx + + + + + + + +Builds a header file from an .ui file, where the former +contains the setup code for a GUI class. +This builder is only available after using the tool 'qt5'. +Using this builder lets you override the standard +naming conventions (be careful: prefixes are always prepended to names of +built files; if you don't want prefixes, you may set them to ``). +See the &cv-link-QT5DIR; variable for more information. +Example: + + +env.Uic5('foo.ui') # -> 'ui_foo.h' + + + + + + +Just like the &b-Uic5; builder, it builds a header file from a .ui input file. +However, it does not use any default prefix or suffix for the filenames. +You can, and have to, specify the full source and target names explicitly. +This builder is only available after using the +tool 'qt5'. It can be your last resort, when you have to convert .ui +files to exotic filenames. +Example: + + +env.ExplicitUic5('uiced_foo.hpp','foo.ui') # generates uiced_foo.hpp + + + + + + +Builds a cxx file, containing all resources from the given +.qrc file. +This builder is only available after using the tool 'qt5'. + +Example: + + +env.Qrc5('foo.qrc') # -> ['qrc_foo.cc'] + + + + + + +Scans the source files in the given path for tr() marked strings, +that should get translated. Writes a .ts file for the Qt Linguist. +This builder is only available after using the tool 'qt5'. + +Example: + + +env.Ts5('foo.ts','.') # -> ['foo.ts'] + + + + + + + +Compiles a given .ts file (Qt Linguist) into a binary .qm file. +This builder is only available after using the tool 'qt5'. + +Example: + + +env.Qm5('foo.ts') # -> ['foo.qm'] + + + + + + + +The Qt5 tool tries to read this from the current Environment and then from os.environ. +If it is not set and found, the value of QTDIR (in the Environment and os.environ) is +used as a fallback. +It also initializes all QT5_* +construction variables listed below. +(Note that all paths are constructed +with python's os.path.join() method, +but are listed here with the '/' separator +for easier reading.) +In addition, the construction environment +variables &cv-link-CPPPATH;, +&cv-link-LIBPATH; and +&cv-link-LIBS; may be modified +and the variables +PROGEMITTER, SHLIBEMITTER and LIBEMITTER +are modified. Because the build-performance is affected when using this tool, +you have to explicitly specify it at Environment creation: + + +Environment(tools=['default','qt5']) + + +The Qt5 tool supports the following operations: + +Automatic moc file generation from header files. +You do not have to specify moc files explicitly, the tool does it for you. +However, there are a few preconditions to do so: Your header file must have +the same filebase as your implementation file and must stay in the same +directory. It must have one of the suffixes .h, .hpp, .H, .hxx, .hh. You +can turn off automatic moc file generation by setting &cv-link-QT5_AUTOSCAN; to 0. +See also the corresponding builder method +&b-Moc5;(). + +Automatic moc file generation from cxx files. +As stated in the Qt documentation, include the moc file at the end of +the cxx file. Note that you have to include the file, which is generated +by the transformation ${QT5_MOCCXXPREFIX}<basename>${QT5_MOCCXXSUFFIX}, by default +<basename>.moc. A warning is generated after building the moc file, if you +do not include the correct file. If you are using VariantDir, you may +need to specify duplicate=1. You can turn off automatic moc file generation +by setting &cv-link-QT5_AUTOSCAN; to 0. See also the corresponding +&b-Moc5; +builder method. + +Handling of .ui files. +TODO: describe a little +See also the corresponding +&b-Uic5; +builder method. + +Handling translation files (.ts and .qm). +TODO: describe a little +See also the corresponding +builder methods &b-Ts5; and &b-Qm5;. + +Compiling resource files (.qrc). +TODO: describe a little +See also the corresponding +&b-Qrc5; builder method. + + + + + + +The default is '1', which means that the tool is automatically +scanning for mocable files (see also &cv-link-QT5_AUTOSCAN_STRATEGY;). +You can set this variable to '0' to +switch it off, and then use the &b-Moc5; Builder to explicitly +specify files to run moc on. + + + + + +The path where the Qt5 binaries are installed. +The default value is '&cv-link-QT5DIR;/bin'. + + + + + +The path where the Qt5 header files are installed. +The default value is '&cv-link-QT5DIR;/include'. +Note: If you set this variable to None, +the tool won't change the &cv-link-CPPPATH; +construction variable. + + + + + +Prints lots of debugging information while scanning for moc files. + + + + + +The path to the Qt5 moc executable. +Default value is '&cv-link-QT5_BINPATH;/moc'. + + + + + +Default value is ''. Prefix for moc output files, when source is a cxx file and the +Automoc strategy #0 (Q_OBJECT driven) is used. + + + + + +Default value is '.moc'. Suffix for moc output files, when source is a cxx file and the +Automoc strategy #0 (Q_OBJECT driven) is used. + + + + + +Default value is '-i'. These flags are passed to moc, when moccing a +C++ file. + + + + + +Default value is ''. These flags are passed to moc, when moccing a header +file. + + + + + +Default value is 'moc_'. Prefix for moc output files, when the source file is a header +and the Automoc strategy #0 (Q_OBJECT driven) is used. + + + + + +Default value is '&cv-link-CXXFILESUFFIX;'. Suffix for moc output files, when +the source file is a header and the Automoc strategy #0 (Q_OBJECT driven) is used. + + + + + +Default value is '&cv-link-QT5_BINPATH;/uic'. The path to the Qt5 uic executable. + + + + + +Command to generate the required header and source files from .ui form files. +Is compiled from &cv-link-QT5_UIC; and &cv-link-QT5_UICFLAGS;. + + + + + +The string displayed when generating header and source files from .ui form files. +If this is not set, then &cv-link-QT5_UICCOM; (the command line) is displayed. + + + + + +Default value is ''. These flags are passed to the Qt5 uic executable, when creating header +and source files from a .ui form file. + + + + + +Default value is 'ui_'. Prefix for uic generated header files. + + + + + +Default value is '.h'. Suffix for uic generated header files. + + + + + +Default value is '.ui'. Suffix of designer input files (form files) in Qt5. + + + + + +Default value is '0'. When using the Automoc feature of the Qt5 tool, you +can select different strategies for detecting which files should get moced. +The simple approach ('0' as the default) scans header and source files for +the Q_OBJECT macro, so the trigger 'moc or not' is Q_OBJECT driven. If it is +found, the corresponding file gets moced with +the &b-Moc5; builder. This results in the files 'moc_foo.cc' and 'foo.moc' for header +and source file, respectively. They get added to the list of sources, for compiling +the current library or program. + +In older Qt manuals, a different technique for mocing is recommended. A cxx file +includes the moced output of itself or its header at the end. This approach is somewhat +deprecated, but the 'qtsolutions' by Qt are still based on it, for example. You also +might have to switch older Qt sources to a new version 5.x.y. Then you can set +this variable to '1', for 'include driven' mocing. This means that the tool searches +for '#include' statements in all cxx files, containing a file pattern 'moc_foo.cpp' +and 'foo.moc' for header and source file, respectively. If the file 'foo.h/foo.cpp' +then contains a Q_OBJECT macro, it gets moced but is NOT added to the list of sources. +This is the important difference between the two strategies. If no matching +include patterns are found for the current cxx file, the Q_OBJECT driven method (#0) +is tried as fallback. + + + + + +The default is '1', meaning that the tool scans +for mocable files not only in the current directory, but +also in all CPPPATH folders (see also &cv-link-QT5_AUTOMOC_CPPPATH;). +You can set this variable to '0' to +switch it off on rare occasions, e.g. when too many search +folders give you a bad performance in large projects. + + + + + +The list of paths to scan for mocable files +(see also &cv-link-QT5_AUTOMOC_SCANCPPPATH;), it is empty by default +which means that the CPPPATH variable is used. +You can set this variable to a subset of CPPPATH in order +to improve performance, i.e. to minimize the search space. + + + + + +Default value is '0' (disabled). When you set this variable to '1', +you enable the automatic removal of C/C++ comments, while searching for +the Q_OBJECT keyword during the Automoc process. This can be helpful if you +have the string Q_OBJECT in one of your comments, but don't want this +file to get moced. + + + + + +Default value is '1' (enabled). When you set this variable to '1', +all currently set CPPDEFINES get passed to the moc executable. It does not matter +which strategy you selected with &cv-link-QT5_AUTOSCAN_STRATEGY; or whether you +call the &b-Moc5; builder directly. + + + + + +Default value is '0' (disabled). When you set this variable to '1', +the &b-Ts5; builder will delete your .ts files on a 'scons -c'. Normally, +these files for the QtLinguist are treated as 'precious' (they are not removed +prior to a rebuild) and do not get cleaned. + + + + + +Default value is 'moc_'. +Like &cv-link-QT5_MOCHPREFIX;, this is the prefix for moc output files, when +the source file is a header +and the Automoc strategy #1 (include driven) is used. + + + + + +Default value is '.cpp'. +Like &cv-link-QT5_MOCHSUFFIX;, this is the suffix for moc output files, when +the source file is a header and the Automoc strategy #1 +(include driven) is used. + + + + + +Default value is ''. +Like &cv-link-QT5_MOCCXXPREFIX;, this is the +prefix for moc output files, when source is a cxx file and the +Automoc strategy #1 (include driven) is used. + + + + + +Default value is '.moc'. +Like &cv-link-QT5_MOCCXXSUFFIX;, this is the +suffix for moc output files, when source is a cxx file and the +Automoc strategy #1 (include driven) is used. + + + + + +Default value is '&cv-link-QT5_BINPATH;/rcc'. The path to the Qt5 rcc +executable (resource file compiler). + + + + + +Default value is '&cv-link-QT5_BINPATH;/lupdate'. The path to the Qt5 lupdate +executable (updates the .ts files from sources). + + + + + +Default value is '&cv-link-QT5_BINPATH;/lrelease'. The path to the Qt5 lrelease +executable (converts .ts files to binary .qm files). + + + + + +Default value is ''. These flags are passed to the Qt5 rcc executable, +when compiling a resource file. + + + + + +Default value is ''. These flags are passed to the Qt5 lupdate executable, +when updating .ts files from sources. + + + + + +Default value is ''. These flags are passed to the Qt5 lrelease executable, +when compiling .ts files into binary .qm files. + + + + + +Default value is '-I'. The prefix for specifying include directories to the +Qt5 moc executable. + + + + + +Default value is '.qrc'. Suffix of Qt5 resource files. + + + + + +Default value is '$CXXFILESUFFIX'. +This is the suffix for compiled .qrc resource files. + + + + + +Default value is 'qrc_'. +This is the prefix for compiled .qrc resource files. + + + + + +List of include paths for the Qt5 moc executable, is compiled from +&cv-link-QT5_MOCINCPREFIX;, &cv-link-QT5_MOCCPPPATH; and &cv-link-INCSUFFIX;. + + + + + +List of CPP defines that are passed to the Qt5 moc executable, +is compiled from &cv-link-QT5_MOCDEFPREFIX;, &cv-link-CPPDEFINES; and &cv-link-QT5_MOCDEFSUFFIX;. + + + + + +Command to update .ts files for translation from the sources. + + + + + +The string displayed when updating .ts files from the sources. +If this is not set, then &cv-link-QT5_LUPDATECOM; (the command line) is displayed. + + + + + +Command to convert .ts files to binary .qm files. + + + + + +The string displayed when converting .ts files to binary .qm files. +If this is not set, then &cv-link-QT5_RCC; (the command line) is displayed. + + + + diff --git a/tests/site_scons/site_tools/qt5/docs/reference.xml b/tests/site_scons/site_tools/qt5/docs/reference.xml new file mode 100644 index 0000000..a9b459a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/docs/reference.xml @@ -0,0 +1,717 @@ + + + +
+ + SCons tool <quote>qt5</quote> - Reference + + + Dirk + + Baechle + + + 2012-12-13 + + + + This reference lists all the variables that are used within the + qt5 tool, and the available builders. It is intended for + SCons tool developers and core programmers, as a normal user you should + read the manual instead. + + +
+ What it does + + The qt5 tool sets construction variables and + registers builders for creating applications and libraries that use the + Qt5 framework by Trolltech/Nokia. + + It supports the following operations: + +
+ Automatic moc file generation from header files + + You do not have to specify moc files explicitly, the tool does it + for you. However, there are a few preconditions to do so: Your header + file must have the same filebase as your implementation file. It must + have one of the suffixes .h, .hpp, + .H, .hxx, .hh. + You can turn off automatic moc file generation by setting + QT5_AUTOSCAN to 0. See also the corresponding builder + method Moc5(). +
+ +
+ Automatic moc file generation from cxx files + + As stated in the Qt documentation, include the moc file at the end + of the cxx file. Note that you have to include the file, which is + generated by the transformation + + ${QT5_MOCCXXPREFIX}<basename>${QT5_MOCCXXSUFFIX}, + by default <basename>.moc. A warning is + generated after building the moc file, if you do not include the correct + file. If you are using VariantDir, you may need to specify + duplicate=1. You can turn off automatic moc file + generation by setting QT5_AUTOSCAN to 0. See also the + corresponding Moc5 builder method. +
+ +
+ Handling of .ui files + + TODO: describe in a little more detail. + + See also the corresponding Uic5 builder + method. +
+ +
+ Handling translation files (.ts and .qm) + + TODO: describe in a little more detail. + + See also the corresponding builder methods Ts5 and Qm5. +
+ +
+ Compiling resource files (.qrc) + + TODO: describe in a little more detail. + + See also the corresponding Qrc5 builder method. +
+
+ +
+ Builders + + + +
+ Moc5 + + Builds an output file from a moc input file. Moc input files are + either header files or cxx files. This builder is only available after + using the tool 'qt5'. + + Example: + + env.Moc5('foo.h') # generates moc_foo.cc +env.Moc5('foo.cpp') # generates foo.moc + +
+ +
+ XMoc5 + + Just like the Moc5 builder, it builds an output file from a moc + input file. Moc input files are either header files or cxx files. This + builder is only available after using the tool 'qt5'. It is defined + separately for the include driven Automoc strategy (#1) and can be + controlled via the QT5_XMOC* variables. + + Example: + + env.XMoc5('foo.h') # generates moc_foo.cpp +env.XMoc5('foo.cpp') # generates foo.moc + +
+ +
+ ExplicitMoc5 + + Just like the Moc5 builder, it builds an output + file from a moc input file. However, it does not use any default prefix + or suffix for the filenames. You can, and have to, specify the full + source and target names explicitly. This builder is only available after + using the tool 'qt5'. It can be your last resort, when you have to moc + single files from/to exotic filenames. + + Example: + + env.ExplicitMoc5('moced_foo.cxx','foo.h') # generates moced_foo.cxx + +
+ +
+ Uic5 + + Builds a header file from an .ui file, where the former contains + the setup code for a GUI class. This builder is only available after + using the tool 'qt5'. Using this builder lets you override the standard + naming conventions (be careful: prefixes are always prepended to names + of built files; if you don't want prefixes, you may set them to + ``). + + Example: + + env.Uic5('foo.ui') # -> 'ui_foo.h' + +
+ +
+ ExplicitUic5 + + Just like the Uic5 builder, it builds a header + file from a .ui input file. However, it does not use any default prefix + or suffix for the filenames. You can, and have to, specify the full + source and target names explicitly. This builder is only available after + using the tool 'qt5'. It can be your last resort, when you have to + convert .ui files to exotic filenames. + + Example: + + env.ExplicitUic5('uiced_foo.hpp','foo.ui') # generates uiced_foo.hpp + +
+ +
+ Qrc5 + + Builds a cxx file, containing all resources from the given + .qrc file. This builder is only available after using + the tool 'qt5'. + + Example: + + env.Qrc5('foo.qrc') # -> ['qrc_foo.cc'] + +
+ +
+ Ts5 + + Scans the source files in the given path for tr() marked strings, + that should get translated. Writes a .ts file for the + Qt Linguist. This builder is only available after using the tool + 'qt5'. + + Example: + + env.Ts5('foo.ts','.') # -> ['foo.ts'] + +
+ +
+ Qm5 + + Compiles a given .ts file (Qt Linguist) into a + binary .qm file. This builder is only available after + using the tool 'qt5'. + + Example: + + env.Qm5('foo.ts') # -> ['foo.qm'] + +
+
+ +
+ Variables + + + + QT5DIR + + + The Qt5 tool tries to read this from the current Environment + and os.environ. If it is not set and found, the + value of QTDIR (in Environment/os.environ) is + used as a fallback. It is used to initialize all QT5_* + construction variables listed below. + + + + + QT5_AUTOSCAN + + + The default is '1', which means that the tool is + automatically scanning for mocable files (see also + QT5_AUTOSCAN_STRATEGY). You can set this + variable to '0' to switch it off, and then use the + Moc5 Builder to explicitly specify files to run + moc on. + + + + + QT5_BINPATH + + + The path where the Qt5 binaries are installed. The default + value is 'QT5DIR/bin'. + + + + + QT5_MOCCPPPATH + + + The path where the Qt5 header files are installed. The + default value is 'QT5DIR/include'. Note: If you + set this variable to None, the tool won't change the + CPPPATH construction variable. + + + + + QT5_DEBUG + + + Prints lots of debugging information while scanning for moc + files. + + + + + QT5_MOC + + + The path to the Qt5 moc executable. Default value is + 'QT5_BINPATH/moc'. + + + + + QT5_MOCCXXPREFIX + + + Default value is ''. Prefix for moc output files, when + source is a cxx file and the Automoc strategy #0 (Q_OBJECT driven) + is used. + + + + + QT5_MOCCXXSUFFIX + + + Default value is '.moc'. Suffix for moc output files, when + source is a cxx file and the Automoc strategy #0 (Q_OBJECT driven) + is used. + + + + + QT5_MOCFROMCXXFLAGS + + + Default value is '-i'. These flags are passed to moc, when + moccing a C++ file. + + + + + QT5_MOCFROMHFLAGS + + + Default value is ''. These flags are passed to moc, when + moccing a header file. + + + + + QT5_MOCHPREFIX + + + Default value is 'moc_'. Prefix for moc output files, when + the source file is a header and the Automoc strategy #0 (Q_OBJECT + driven) is used. + + + + + QT5_MOCHSUFFIX + + + Default value is 'CXXFILESUFFIX'. Suffix + for moc output files, when the source file is a header and the + Automoc strategy #0 (Q_OBJECT driven) is used. + + + + + QT5_UIC + + + Default value is 'QT5_BINPATH/uic'. The + path to the Qt5 uic executable. + + + + + QT5_UICCOM + + + Command to generate the required header and source files + from .ui form files. Is compiled from QT5_UIC + and QT5_UICFLAGS. + + + + + QT5_UICCOMSTR + + + The string displayed when generating header and source files + from .ui form files. If this is not set, then + QT5_UICCOM (the command line) is + displayed. + + + + + QT5_UICFLAGS + + + Default value is ''. These flags are passed to the Qt5 uic + executable, when creating header and source files from a .ui form + file. + + + + + QT5_UICDECLPREFIX + + + Default value is 'ui_'. Prefix for uic generated header + files. + + + + + QT5_UICDECLSUFFIX + + + Default value is '.h'. Suffix for uic generated header + files. + + + + + QT5_UISUFFIX + + + Default value is '.ui'. Suffix of designer input files (form + files) in Qt5. + + + + + QT5_AUTOSCAN_STRATEGY + + + Default value is '0'. When using the Automoc feature of the + Qt5 tool, you can select different strategies for detecting which + files should get moced. The simple approach ('0' as the default) + scans header and source files for the Q_OBJECT macro, so the + trigger 'moc or not' is Q_OBJECT driven. If it is found, the + corresponding file gets moced with the Moc5 + builder. This results in the files 'moc_foo.cc' and 'foo.moc' for + header and source file, respectively. They get added to the list + of sources, for compiling the current library or program. In older + Qt manuals, a different technique for mocing is recommended. A cxx + file includes the moced output of itself or its header at the end. + This approach is somewhat deprecated, but the 'qtsolutions' by Qt + are still based on it, for example. You also might have to switch + older Qt sources to a new version 5.x.y. Then you can set this + variable to '1', for 'include driven' mocing. This means that the + tool searches for '#include' statements in all cxx files, + containing a file pattern 'moc_foo.cpp' and 'foo.moc' for header + and source file, respectively. If the file 'foo.h/foo.cpp' then + contains a Q_OBJECT macro, it gets moced but is NOT added to the + list of sources. This is the important difference between the two + strategies. If no matching include patterns are found for the + current cxx file, the Q_OBJECT driven method (#0) is tried as + fallback. + + + + + QT5_AUTOMOC_SCANCPPPATH + + + The default is '1', meaning that the tool scans for mocable + files not only in the current directory, but also in all CPPPATH + folders (see also QT5_AUTOMOC_CPPPATH). You can + set this variable to '0' to switch it off on rare occasions, e.g. + when too many search folders give you a bad performance in large + projects. + + + + + QT5_AUTOMOC_CPPPATH + + + The list of paths to scan for mocable files (see also + QT5_AUTOMOC_SCANCPPPATH), it is empty by + default which means that the CPPPATH variable is used. You can set + this variable to a subset of CPPPATH in order to improve + performance, i.e. to minimize the search space. + + + + + QT5_GOBBLECOMMENTS + + + Default value is '0' (disabled). When you set this variable + to '1', you enable the automatic removal of C/C++ comments, while + searching for the Q_OBJECT keyword during the Automoc process. + This can be helpful if you have the string Q_OBJECT in one of your + comments, but don't want this file to get moced. + + + + + QT5_CPPDEFINES_PASSTOMOC + + + Default value is '1' (enabled). When you set this variable + to '1', all currently set CPPDEFINES get passed to the moc + executable. It does not matter which strategy you selected with + QT5_AUTOSCAN_STRATEGY or whether you call the + Moc5 builder directly. + + + + + QT5_CLEAN_TS + + + Default value is '0' (disabled). When you set this variable + to '1', the Ts5 builder will delete your .ts + files on a 'scons -c'. Normally, these files for the QtLinguist + are treated as 'precious' (they are not removed prior to a + rebuild) and do not get cleaned. + + + + + QT5_XMOCHPREFIX + + + Default value is 'moc_'. Like + QT5_MOCHPREFIX, this is the prefix for moc + output files, when the source file is a header and the Automoc + strategy #1 (include driven) is used. + + + + + QT5_XMOCHSUFFIX + + + Default value is '.cpp'. Like + QT5_MOCHSUFFIX, this is the suffix for moc + output files, when the source file is a header and the Automoc + strategy #1 (include driven) is used. + + + + + QT5_XMOCCXXPREFIX + + + Default value is ''. Like + QT5_MOCCXXPREFIX, this is the prefix for moc + output files, when source is a cxx file and the Automoc strategy + #1 (include driven) is used. + + + + + QT5_XMOCCXXSUFFIX + + + Default value is '.moc'. Like + QT5_MOCCXXSUFFIX, this is the suffix for moc + output files, when source is a cxx file and the Automoc strategy + #1 (include driven) is used. + + + + + QT5_RCC + + + Default value is 'QT5_BINPATH/rcc'. The + path to the Qt5 rcc executable (resource file compiler). + + + + + QT5_LUPDATE + + + Default value is 'QT5_BINPATH/lupdate'. + The path to the Qt5 lupdate executable (updates the .ts files from + sources). + + + + + QT5_LRELEASE + + + Default value is 'QT5_BINPATH/lrelease'. + The path to the Qt5 lrelease executable (converts .ts files to + binary .qm files). + + + + + QT5_QRCFLAGS + + + Default value is ''. These flags are passed to the Qt5 rcc + executable, when compiling a resource file. + + + + + QT5_LUPDATEFLAGS + + + Default value is ''. These flags are passed to the Qt5 + lupdate executable, when updating .ts files from sources. + + + + + QT5_LRELEASEFLAGS + + + Default value is ''. These flags are passed to the Qt5 + lrelease executable, when compiling .ts files into binary .qm + files. + + + + + QT5_MOCINCPREFIX + + + Default value is '-I'. The prefix for specifying include + directories to the Qt5 moc executable. + + + + + QT5_QRCSUFFIX + + + Default value is '.qrc'. Suffix of Qt5 resource + files. + + + + + QT5_QRCCXXSUFFIX + + + Default value is '$CXXFILESUFFIX'. This is the suffix for + compiled .qrc resource files. + + + + + QT5_QRCCXXPREFIX + + + Default value is 'qrc_'. This is the prefix for compiled + .qrc resource files. + + + + + QT5_MOCINCFLAGS + + + List of include paths for the Qt5 moc executable, is + compiled from QT5_MOCINCPREFIX, + QT5_MOCCPPPATH and + INCSUFFIX. + + + + + QT5_MOCDEFINES + + + List of CPP defines that are passed to the Qt5 moc + executable, is compiled from QT5_MOCDEFPREFIX, + CPPDEFINES and + QT5_MOCDEFSUFFIX. + + + + + QT5_LUPDATECOM + + + Command to update .ts files for translation from the + sources. + + + + + QT5_LUPDATECOMSTR + + + The string displayed when updating .ts files from the + sources. If this is not set, then + QT5_LUPDATECOM (the command line) is + displayed. + + + + + QT5_LRELEASECOM + + + Command to convert .ts files to binary .qm files. + + + + + QT5_LRELEASECOMSTR + + + The string displayed when converting .ts files to binary .qm + files. If this is not set, then QT5_RCC (the + command line) is displayed. + + + +
+
\ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/docs/scons.css b/tests/site_scons/site_tools/qt5/docs/scons.css new file mode 100644 index 0000000..6941abb --- /dev/null +++ b/tests/site_scons/site_tools/qt5/docs/scons.css @@ -0,0 +1,263 @@ +body { + background: #ffffff; + margin: 10px; + padding: 0; + font-family:palatino, georgia, verdana, arial, sans-serif; + } + + +a { + color: #80572a; + } + +a:hover { + color: #d72816; + text-decoration: none; + } + +tt { + color: #a14447; + } + +pre { + background: #e0e0e0; + } + +#main { + border: 1px solid; + border-color: black; + background-color: white; + background-image: url(../images/sconsback.png); + background-repeat: repeat-y 50% 0; + background-position: right top; + margin: 30px auto; + width: 750px; + } + +#banner { + background-image: url(../images/scons-banner.jpg); + border-bottom: 1px solid; + height: 95px; + } + +#menu { + font-family: sans-serif; + font-size: small; + line-height: 0.9em; + float: right; + width: 220px; + clear: both; + margin-top: 10px; + } + +#menu li { + margin-bottom: 7px; + } + +#menu li li { + margin-bottom: 2px; + } + +#menu li.submenuitems { + margin-bottom: 2px; + } + +#menu a { + text-decoration: none; + } + +#footer { + border-top: 1px solid black; + text-align: center; + font-size: small; + color: #822; + margin-top: 4px; + background: #eee; + } + +ul.hack { + list-style-position:inside; + } + +ul.menuitems { + list-style-type: none; + } + +ul.submenuitems { + list-style-type: none; + font-size: smaller; + margin-left: 0; + padding-left: 16px; + } + +ul.subsubmenuitems { + list-style-type: none; + font-size: smaller; + margin-left: 0; + padding-left: 16px; + } + +ol.upper-roman { + list-style-type: upper-roman; + } + +ol.decimal { + list-style-type: decimal; + } + +#currentpage { + font-weight: bold; + } + +#bodycontent { + margin: 15px; + width: 520px; + font-size: small; + line-height: 1.5em; + } + +#bodycontent li { + margin-bottom: 6px; + list-style-type: square; + } + +#sconsdownloadtable downloadtable { + display: table; + margin-left: 5%; + border-spacing: 12px 3px; + } + +#sconsdownloadtable downloadrow { + display: table-row; + } + +#sconsdownloadtable downloadentry { + display: table-cell; + text-align: center; + vertical-align: bottom; + } + +#sconsdownloadtable downloaddescription { + display: table-cell; + font-weight: bold; + text-align: left; + } + +#sconsdownloadtable downloadversion { + display: table-cell; + font-weight: bold; + text-align: center; + } + +#sconsdocversiontable sconsversiontable { + display: table; + margin-left: 10%; + border-spacing: 12px 3px; + } + +#sconsdocversiontable sconsversionrow { + display: table-row; + } + +#sconsdocversiontable docformat { + display: table-cell; + font-weight: bold; + text-align: center; + vertical-align: bottom; + } + +#sconsdocversiontable sconsversion { + display: table-cell; + font-weight: bold; + text-align: left; + } + +#sconsdocversiontable docversion { + display: table-cell; + font-weight: bold; + text-align: center; + } + +#osrating { + margin-left: 35px; + } + + +h2 { + color: #272; + color: #c01714; + font-family: sans-serif; + font-weight: normal; + } + +h2.pagetitle { + font-size: xx-large; + } +h3 { + margin-bottom: 10px; + } + +.date { + font-size: small; + color: gray; + } + +.link { + margin-bottom: 22px; + } + +.linkname { + } + +.linkdesc { + margin: 10px; + margin-top: 0; + } + +.quote { + margin-top: 20px; + margin-bottom: 10px; + background: #f8f8f8; + border: 1px solid; + border-color: #ddd; + } + +.quotetitle { + font-weight: bold; + font-size: large; + margin: 10px; + } + +.quotedesc { + margin-left: 20px; + margin-right: 10px; + margin-bottom: 15px; + } + +.quotetext { + margin-top: 20px; + margin-left: 20px; + margin-right: 10px; + font-style: italic; + } + +.quoteauthor { + font-size: small; + text-align: right; + margin-top: 10px; + margin-right: 7px; + } + +.sconslogo { + font-style: normal; + font-weight: bold; + color: #822; + } + +.downloadlink { + } + +.downloaddescription { + margin-left: 1em; + margin-bottom: 0.4em; + } diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-after b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-after new file mode 100644 index 0000000..9a0eb95 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-after @@ -0,0 +1,6 @@ + +Import("qtEnv") +qtEnv.Append(CPPPATH=['./local_include']) +qtEnv.EnableQt5Modules(['QtCore']) +qtEnv.Program(target = 'aaa', source = 'aaa.cpp') + diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-before b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-before new file mode 100644 index 0000000..d5677bb --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-before @@ -0,0 +1,5 @@ + +Import("qtEnv") +qtEnv.EnableQt5Modules(['QtCore']) +qtEnv.Program(target = 'aaa', source = 'aaa.cpp') + diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConscript new file mode 100644 index 0000000..f392a40 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConscript @@ -0,0 +1,2 @@ + +SConscript('sub/SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConstruct new file mode 100644 index 0000000..d9d897d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.cpp new file mode 100644 index 0000000..36dc229 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.cpp @@ -0,0 +1,13 @@ +#include "aaa.h" + +aaa::aaa() +{ + ; +} + +int main() +{ + aaa a; + return 0; +} + diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.h new file mode 100644 index 0000000..f397b48 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.h @@ -0,0 +1,12 @@ +#include +#include "local_include.h" + +class aaa : public QObject +{ + Q_OBJECT +public: + + aaa(); +}; + + diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/local_include/local_include.h b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/local_include/local_include.h new file mode 100644 index 0000000..b427f9a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/local_include/local_include.h @@ -0,0 +1,3 @@ + +/* empty; just needs to be found */ + diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended-fail.py b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended-fail.py new file mode 100644 index 0000000..8c236b5 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended-fail.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Test that an appended relative CPPPATH works with generated files. + +This is basically the same as CPPPATH.py, but the include path +is env.Append-ed and everything goes into sub directory "sub". +The SConscript does not add the necessary path, such that +the compile run actually fails. Together with the second +test, this demonstrates that the CPPPATH has an effect. + +""" + +import os.path + +import TestSCons + +test = TestSCons.TestSCons() + +test.dir_fixture('image') +test.file_fixture('SConscript-before','sub/SConscript') +test.file_fixture('../../../qtenv.py') +test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run(status=2, stderr=None) + +test.pass_test() + + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended.py b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended.py new file mode 100644 index 0000000..3d3dd7c --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Test that an appended relative CPPPATH works with generated files. + +This is basically the same as CPPPATH.py, but the include path +is env.Append-ed and everything goes into sub directory "sub". +In the SConscript we really add the necessary path, such that +the compile run is successful. See also the accompanying test +that is supposed to fail. + +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.dir_fixture('image') +test.file_fixture('SConscript-after','sub/SConscript') +test.file_fixture('../../../qtenv.py') +test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run(stderr=None) + +test.pass_test() + + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-after b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-after new file mode 100644 index 0000000..43b0b91 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-after @@ -0,0 +1,3 @@ +Import("qtEnv") +qtEnv.EnableQt5Modules(['QtCore']) +qtEnv.Program(target = 'aaa', source = 'aaa.cpp', CPPPATH=['$CPPPATH', './local_include']) diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-before b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-before new file mode 100644 index 0000000..95ff8a3 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-before @@ -0,0 +1,3 @@ +Import("qtEnv") +qtEnv.EnableQt5Modules(['QtCore']) +qtEnv.Program(target = 'aaa', source = 'aaa.cpp') diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/SConstruct new file mode 100644 index 0000000..d9d897d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.cpp new file mode 100644 index 0000000..36dc229 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.cpp @@ -0,0 +1,13 @@ +#include "aaa.h" + +aaa::aaa() +{ + ; +} + +int main() +{ + aaa a; + return 0; +} + diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.h new file mode 100644 index 0000000..f397b48 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.h @@ -0,0 +1,12 @@ +#include +#include "local_include.h" + +class aaa : public QObject +{ + Q_OBJECT +public: + + aaa(); +}; + + diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/local_include/local_include.h b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/local_include/local_include.h new file mode 100644 index 0000000..ad85bb2 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/local_include/local_include.h @@ -0,0 +1,2 @@ + +/* empty; just needs to be found */ diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH-fail.py b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH-fail.py new file mode 100644 index 0000000..ad0ca4a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH-fail.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Test that CPPPATH works with generated files. + +The SConscript does not add the necessary path, such that +the compile run actually fails. Together with the second +test, this demonstrates that the CPPPATH has an effect. + +""" + +import os.path + +import TestSCons + +test = TestSCons.TestSCons() + +test.dir_fixture('image') +test.file_fixture('SConscript-before','SConscript') +test.file_fixture('../../../qtenv.py') +test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run(status=2, stderr=None) + +test.pass_test() + + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH.py b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH.py new file mode 100644 index 0000000..293933f --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Test that CPPPATH works with generated files. + +In the SConscript we really add the necessary path, such that +the compile run is successful. See also the accompanying test +that is supposed to fail. +""" + +import os.path + +import TestSCons + +test = TestSCons.TestSCons() + +test.dir_fixture('image') +test.file_fixture('SConscript-after','SConscript') +test.file_fixture('../../../qtenv.py') +test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run(stderr=None) + +test.pass_test() + + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.cpp new file mode 100644 index 0000000..b5f3f8f --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.cpp @@ -0,0 +1,5 @@ + +#include "MyFile.h" +void useit() { + aaa(); +} diff --git a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.h new file mode 100644 index 0000000..8b2a3f8 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.h @@ -0,0 +1,2 @@ + +void aaa(void) {}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConscript new file mode 100644 index 0000000..fc7668b --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConscript @@ -0,0 +1,11 @@ +Import("qtEnv") +qtEnv.Append(CPPDEFINES = ['FOOBAZ']) + +copy = qtEnv.Clone() +copy.Append(CPPDEFINES = ['MYLIB_IMPL']) +copy.EnableQt5Modules(['QtCore']) + +copy.SharedLibrary( + target = 'MyLib', + source = ['MyFile.cpp'] +) diff --git a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConstruct new file mode 100644 index 0000000..d9d897d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + diff --git a/tests/site_scons/site_tools/qt5/test/basic/copied-env/sconstest-copied-env.py b/tests/site_scons/site_tools/qt5/test/basic/copied-env/sconstest-copied-env.py new file mode 100644 index 0000000..95b3ed0 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/copied-env/sconstest-copied-env.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Test Qt with a copied construction environment. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run() + +cpp_MyFile = [x for x in test.stdout().split('\n') if x.find('MyFile.cpp') != -1] + +for x in cpp_MyFile: + if ((x.find('MYLIB_IMPL') < 0) or (x.find('FOOBAZ') < 0)): + print "Did not find MYLIB_IMPL and FOOBAZ on MyFile.cpp compilation line:" + print test.stdout() + test.fail_test() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/SConstruct new file mode 100755 index 0000000..f7c3e64 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/SConstruct @@ -0,0 +1,4 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +qtEnv.Program('main', 'main.cpp', CPPDEFINES=['FOO'], LIBS=[]) diff --git a/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/foo6.h b/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/foo6.h new file mode 100644 index 0000000..734d7c7 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/foo6.h @@ -0,0 +1,8 @@ +#include +void +foo6(void) +{ +#ifdef FOO + printf("qt/include/foo6.h\n"); +#endif +} diff --git a/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/main.cpp b/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/main.cpp new file mode 100755 index 0000000..cedf3cb --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/main.cpp @@ -0,0 +1,3 @@ + +#include "foo6.h" +int main() { foo6(); return 0; } diff --git a/tests/site_scons/site_tools/qt5/test/basic/empty-env/sconstest-empty-env.py b/tests/site_scons/site_tools/qt5/test/basic/empty-env/sconstest-empty-env.py new file mode 100755 index 0000000..bc894b3 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/empty-env/sconstest-empty-env.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test Qt creation from a copied empty environment. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run() + +test.run(program = test.workpath('main' + TestSCons._exe), + stderr = None, + stdout = 'qt/include/foo6.h\n') + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConscript new file mode 100755 index 0000000..085947e --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConscript @@ -0,0 +1,20 @@ +Import("qtEnv") +sources = ['aaa.cpp', 'bbb.cpp', 'ddd.cpp', 'eee.cpp', 'main.cpp'] + +qtEnv.EnableQt5Modules(['QtCore','QtGui']) + +# normal invocation +sources.append(qtEnv.Moc5('include/aaa.h')) +sources.append(qtEnv.Moc5('ui/ccc.h')) +qtEnv.Moc5('bbb.cpp') +qtEnv.Uic5('ui/ccc.ui') + +# manual target specification +sources.append(qtEnv.ExplicitMoc5('moc-ddd.cpp','include/ddd.h')) +qtEnv.ExplicitMoc5('moc_eee.cpp','eee.cpp') +qtEnv.ExplicitUic5('include/uic_fff.hpp','ui/fff.ui') + +qtEnv.Program(target='aaa', + source=sources, + CPPPATH=['$CPPPATH', './include'], + QT5_AUTOSCAN=0) diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConstruct new file mode 100755 index 0000000..d9d897d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/aaa.cpp new file mode 100755 index 0000000..cbd37c1 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/aaa.cpp @@ -0,0 +1,2 @@ + +#include "aaa.h" diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.cpp new file mode 100755 index 0000000..159cc07 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.cpp @@ -0,0 +1,18 @@ +#include "bbb.h" + +#include + +class bbb : public QObject +{ + Q_OBJECT + +public: + bbb() {}; +}; + +#include "bbb.moc" + +void b_dummy() +{ + bbb b; +} diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.h b/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.h new file mode 100755 index 0000000..c3ec38e --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.h @@ -0,0 +1,2 @@ + +extern void b_dummy(void); diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ddd.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ddd.cpp new file mode 100755 index 0000000..cd59f26 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ddd.cpp @@ -0,0 +1,2 @@ + +#include "ddd.h" diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.cpp new file mode 100755 index 0000000..38cb3e3 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.cpp @@ -0,0 +1,16 @@ +#include + +class eee : public QObject +{ + Q_OBJECT + +public: + eee() {}; +}; + +#include "moc_eee.cpp" + +void e_dummy() +{ + eee e; +} diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.h b/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.h new file mode 100755 index 0000000..cb2fe43 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.h @@ -0,0 +1,2 @@ + +extern void e_dummy(void); diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/fff.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/fff.cpp new file mode 100755 index 0000000..9e5f80d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/fff.cpp @@ -0,0 +1 @@ +#include "uic_fff.hpp" diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/aaa.h new file mode 100755 index 0000000..3438edd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/aaa.h @@ -0,0 +1,9 @@ +#include + +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa() {}; +}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/ddd.h b/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/ddd.h new file mode 100755 index 0000000..872a4b2 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/ddd.h @@ -0,0 +1,9 @@ +#include + +class ddd : public QObject +{ + Q_OBJECT + +public: + ddd() {}; +}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/main.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/main.cpp new file mode 100755 index 0000000..74af94a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/main.cpp @@ -0,0 +1,17 @@ + +#include "aaa.h" +#include "bbb.h" +#include "ui/ccc.h" +#include "ddd.h" +#include "eee.h" +#include "uic_fff.hpp" + +int main() { + aaa a; + b_dummy(); + ccc c; + ddd d; + e_dummy(); + + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.h b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.h new file mode 100755 index 0000000..073dd1a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.h @@ -0,0 +1,9 @@ +#include + +class ccc : public QObject +{ + Q_OBJECT + +public: + ccc() {}; +}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.ui b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.ui new file mode 100644 index 0000000..87fffd4 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.ui @@ -0,0 +1,19 @@ + + + Form + + + + 0 + 0 + 288 + 108 + + + + Form + + + + + diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/fff.ui b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/fff.ui new file mode 100644 index 0000000..180d91f --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/fff.ui @@ -0,0 +1,19 @@ + + + Form2 + + + + 0 + 0 + 288 + 108 + + + + Form2 + + + + + diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/sconstest-manual.py b/tests/site_scons/site_tools/qt5/test/basic/manual/sconstest-manual.py new file mode 100755 index 0000000..8b30365 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/manual/sconstest-manual.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test the manual QT builder calls. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.dir_fixture('image') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +test.run() + +# normal invocation +test.must_exist(test.workpath('include', 'moc_aaa.cc')) +test.must_exist(test.workpath('bbb.moc')) +test.must_exist(test.workpath('ui', 'ccc.h')) +test.must_exist(test.workpath('ui', 'moc_ccc.cc')) + +# manual target spec. +test.must_exist(test.workpath('moc-ddd.cpp')) +test.must_exist(test.workpath('moc_eee.cpp')) +test.must_exist(test.workpath('include', 'uic_fff.hpp')) +test.must_exist(test.workpath('fff.cpp')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConscript new file mode 100755 index 0000000..571778e --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConscript @@ -0,0 +1,7 @@ +Import("qtEnv dup") + +qtEnv.EnableQt5Modules(['QtCore','QtGui']) + +if dup == 0: qtEnv.Append(CPPPATH=['.']) +aaa_lib = qtEnv.StaticLibrary('aaa',['aaa.cpp','useit.cpp']) +qtEnv.Alias('aaa_lib', aaa_lib) diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConstruct new file mode 100755 index 0000000..28a7941 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConstruct @@ -0,0 +1,24 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() + +dup = 1 +if ARGUMENTS.get('variant_dir', 0): + if ARGUMENTS.get('chdir', 0): + SConscriptChdir(1) + else: + SConscriptChdir(0) + dup=int(ARGUMENTS.get('dup', 1)) + if dup == 0: + builddir = 'build_dup0' + qtEnv['QT5_DEBUG'] = 1 + else: + builddir = 'build' + VariantDir(builddir, '.', duplicate=dup) + print builddir, dup + sconscript = Dir(builddir).File('SConscript') +else: + sconscript = File('SConscript') + +Export("qtEnv dup") +SConscript( sconscript ) diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.cpp new file mode 100755 index 0000000..07a28ef --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.cpp @@ -0,0 +1,18 @@ +#include "aaa.h" + +#include + +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa() {}; +}; + +#include "aaa.moc" + +void dummy_a() +{ + aaa a; +} diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.h new file mode 100755 index 0000000..8626f9f --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.h @@ -0,0 +1,2 @@ + +extern void dummy_a(void); diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/useit.cpp b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/useit.cpp new file mode 100755 index 0000000..0942ec3 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/useit.cpp @@ -0,0 +1,4 @@ +#include "aaa.h" +void useit() { + dummy_a(); +} diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/sconstest-moc-from-cpp.py b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/sconstest-moc-from-cpp.py new file mode 100755 index 0000000..feee87c --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/sconstest-moc-from-cpp.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Create a moc file from a cpp file. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +lib_aaa = 'aaa_lib' # Alias for the Library +moc = 'aaa.moc' + +test.run(arguments=lib_aaa, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) + +test.up_to_date(options = '-n', arguments = lib_aaa) + +test.write('aaa.cpp', r""" +#include "aaa.h" + +#include + +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa() {}; +}; + +#include "%s" + +// Using the class +void dummy_a() +{ + aaa a; +} +""" % moc) + +test.not_up_to_date(options = '-n', arguments = moc) + +test.run(options = '-c', arguments = lib_aaa) + +test.run(arguments = "variant_dir=1 " + lib_aaa, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) + +test.run(arguments = "variant_dir=1 chdir=1 " + lib_aaa) + +test.must_exist(test.workpath('build', moc)) + +test.run(arguments = "variant_dir=1 dup=0 " + lib_aaa, + stderr=TestSCons.noisy_ar, + match=TestSCons.match_re_dotall) + +test.must_exist(test.workpath('build_dup0', moc)) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConscript new file mode 100755 index 0000000..4307a75 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConscript @@ -0,0 +1,8 @@ +Import("qtEnv dup") + +qtEnv.EnableQt5Modules(['QtCore','QtGui']) + +if dup == 0: qtEnv.Append(CPPPATH=['.', '#build_dup0']) +qtEnv.Program('aaa', 'aaa.cpp', + QT5_MOCHPREFIX = 'moc_', + QT5_MOCHSUFFIX = '.cc') diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConstruct new file mode 100755 index 0000000..28a7941 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConstruct @@ -0,0 +1,24 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() + +dup = 1 +if ARGUMENTS.get('variant_dir', 0): + if ARGUMENTS.get('chdir', 0): + SConscriptChdir(1) + else: + SConscriptChdir(0) + dup=int(ARGUMENTS.get('dup', 1)) + if dup == 0: + builddir = 'build_dup0' + qtEnv['QT5_DEBUG'] = 1 + else: + builddir = 'build' + VariantDir(builddir, '.', duplicate=dup) + print builddir, dup + sconscript = Dir(builddir).File('SConscript') +else: + sconscript = File('SConscript') + +Export("qtEnv dup") +SConscript( sconscript ) diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.cpp new file mode 100644 index 0000000..d8b45aa --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.cpp @@ -0,0 +1,7 @@ +#include "moc_aaa.cc" + +int main() +{ + aaa a; + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.h new file mode 100755 index 0000000..3438edd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.h @@ -0,0 +1,9 @@ +#include + +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa() {}; +}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/sconstest-moc-from-header-nocompile.py b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/sconstest-moc-from-header-nocompile.py new file mode 100755 index 0000000..3e905a7 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/sconstest-moc-from-header-nocompile.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Create a moc file from a header file, but don't +compile it to an Object because the moc'ed output gets directly +included to the CXX file. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +aaa_exe = 'aaa' + TestSCons._exe +build_aaa_exe = test.workpath('build', aaa_exe) +moc = 'moc_aaa.cc' +moc_obj = 'moc_aaa' + TestSCons._obj + +test.run() + +# Ensure that the object file for the MOC output wasn't generated +test.must_not_exist(moc_obj) + +test.up_to_date(options = '-n', arguments=aaa_exe) +test.up_to_date(options = '-n', arguments=aaa_exe) + +test.write('aaa.h', r""" +#include + +// Introducing a change... +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa() {}; +}; +""") + +test.not_up_to_date(options='-n', arguments = moc) + +test.run(arguments = "variant_dir=1 " + build_aaa_exe) + +test.run(arguments = "variant_dir=1 chdir=1 " + build_aaa_exe) + +test.must_exist(test.workpath('build', moc)) +test.must_not_exist(test.workpath('build', moc_obj)) + +test.run(options='-c') + +test.run(arguments = "variant_dir=1 chdir=1 dup=0 " + + test.workpath('build_dup0', aaa_exe) ) + +test.must_exist(test.workpath('build_dup0', moc)) +test.must_not_exist(moc_obj) +test.must_not_exist(test.workpath('build_dup0', moc_obj)) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConscript new file mode 100755 index 0000000..4486ee8 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConscript @@ -0,0 +1,6 @@ +Import("qtEnv dup") + +qtEnv.EnableQt5Modules(['QtCore','QtGui']) + +if dup == 0: qtEnv.Append(CPPPATH=['.']) +qtEnv.Program('aaa','aaa.cpp') diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConstruct new file mode 100755 index 0000000..28a7941 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConstruct @@ -0,0 +1,24 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() + +dup = 1 +if ARGUMENTS.get('variant_dir', 0): + if ARGUMENTS.get('chdir', 0): + SConscriptChdir(1) + else: + SConscriptChdir(0) + dup=int(ARGUMENTS.get('dup', 1)) + if dup == 0: + builddir = 'build_dup0' + qtEnv['QT5_DEBUG'] = 1 + else: + builddir = 'build' + VariantDir(builddir, '.', duplicate=dup) + print builddir, dup + sconscript = Dir(builddir).File('SConscript') +else: + sconscript = File('SConscript') + +Export("qtEnv dup") +SConscript( sconscript ) diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.cpp new file mode 100644 index 0000000..054d582 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.cpp @@ -0,0 +1,7 @@ +#include "aaa.h" + +int main() +{ + aaa a; + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.h new file mode 100755 index 0000000..3438edd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.h @@ -0,0 +1,9 @@ +#include + +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa() {}; +}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/sconstest-moc-from-header.py b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/sconstest-moc-from-header.py new file mode 100755 index 0000000..ab5a0de --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/sconstest-moc-from-header.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Create a moc file from a header file. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +aaa_exe = 'aaa' + TestSCons._exe +build_aaa_exe = test.workpath('build', aaa_exe) +moc = 'moc_aaa.cc' + +test.run() + +test.up_to_date(options = '-n', arguments=aaa_exe) +test.up_to_date(options = '-n', arguments=aaa_exe) + +test.write('aaa.h', r""" +#include + +// Introducing a change... +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa() {}; +}; +""") + +test.not_up_to_date(options='-n', arguments = moc) + +test.run(arguments = "variant_dir=1 " + build_aaa_exe) + +test.run(arguments = "variant_dir=1 chdir=1 " + build_aaa_exe) + +test.must_exist(test.workpath('build', moc)) + +test.run(arguments = "variant_dir=1 chdir=1 dup=0 " + + test.workpath('build_dup0', aaa_exe) ) + +test.must_exist(['build_dup0', moc]) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConscript new file mode 100755 index 0000000..163e252 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConscript @@ -0,0 +1,4 @@ +Import("qtEnv") +env = qtEnv.Clone(tool='qt5') + +env.Program('main', 'main.cpp', CPPDEFINES=['FOO'], LIBS=[]) diff --git a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConstruct new file mode 100755 index 0000000..d9d897d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + diff --git a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/foo5.h b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/foo5.h new file mode 100644 index 0000000..5ac79c8 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/foo5.h @@ -0,0 +1,8 @@ +#include + +#ifdef FOO +void foo5(void) +{ + printf("qt/include/foo5.h\\n"); +} +#endif diff --git a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/main.cpp b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/main.cpp new file mode 100755 index 0000000..0ea9300 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/main.cpp @@ -0,0 +1,7 @@ +#include "foo5.h" + +int main() +{ + foo5(); + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/basic/reentrant/sconstest-reentrant.py b/tests/site_scons/site_tools/qt5/test/basic/reentrant/sconstest-reentrant.py new file mode 100755 index 0000000..97487f5 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/reentrant/sconstest-reentrant.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test creation from a copied environment that already has QT variables. +This makes sure the tool initialization is re-entrant. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.dir_fixture('image') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.cpp b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.cpp new file mode 100644 index 0000000..cdeb4a6 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.cpp @@ -0,0 +1,14 @@ +#include "MyForm.h" + +#include + +MyForm::MyForm(QWidget *parent) : QWidget(parent) +{ + ui.setupUi(this); +} + +void MyForm::testSlot() +{ + printf("Hello World\n"); +} + diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.h b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.h new file mode 100644 index 0000000..fa2d119 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.h @@ -0,0 +1,18 @@ +#include "ui_anUiFile.h" + +#include + +class MyForm : public QWidget +{ + Q_OBJECT + + public: + MyForm(QWidget *parent = 0); + + public slots: + void testSlot(); + + private: + Ui::Form ui; +}; + diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/SConstruct new file mode 100644 index 0000000..56d7a18 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/SConstruct @@ -0,0 +1,12 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +qtEnv.EnableQt5Modules(['QtCore','QtWidgets']) + +qtEnv.VariantDir('bld', '.') +qtEnv.Uic5('bld/anUiFile.ui') +qtEnv.Program('bld/test_realqt', ['bld/mocFromCpp.cpp', + 'bld/mocFromH.cpp', + 'bld/MyForm.cpp', + 'bld/main.cpp']) + diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/anUiFile.ui b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/anUiFile.ui new file mode 100644 index 0000000..87fffd4 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/anUiFile.ui @@ -0,0 +1,19 @@ + + + Form + + + + 0 + 0 + 288 + 108 + + + + Form + + + + + diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/main.cpp b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/main.cpp new file mode 100644 index 0000000..5212903 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/main.cpp @@ -0,0 +1,17 @@ +#include "mocFromCpp.h" +#include "mocFromH.h" +#include "MyForm.h" + +#include +#include + +int main(int argc, char **argv) { + QApplication app(argc, argv); + mocFromCpp(); + mocFromH(); + MyForm mywidget; + mywidget.testSlot(); + printf("Hello World\n"); + return 0; +} + diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.cpp new file mode 100644 index 0000000..1d5b560 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.cpp @@ -0,0 +1,16 @@ +#include + +#include "mocFromCpp.h" + +class MyClass1 : public QObject { + Q_OBJECT + public: + MyClass1() : QObject() {}; + public slots: + void myslot() {}; +}; +void mocFromCpp() { + MyClass1 myclass; +} +#include "mocFromCpp.moc" + diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.h new file mode 100644 index 0000000..fc1e04c --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.h @@ -0,0 +1,2 @@ +void mocFromCpp(); + diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.cpp new file mode 100644 index 0000000..586aafb --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.cpp @@ -0,0 +1,8 @@ +#include "mocFromH.h" + +MyClass2::MyClass2() : QObject() {} +void MyClass2::myslot() {} +void mocFromH() { + MyClass2 myclass; +} + diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.h b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.h new file mode 100644 index 0000000..48fdd7e --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.h @@ -0,0 +1,11 @@ +#include + +class MyClass2 : public QObject { + Q_OBJECT; + public: + MyClass2(); + public slots: + void myslot(); +}; +void mocFromH(); + diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/sconstest-installed.py b/tests/site_scons/site_tools/qt5/test/basic/variantdir/sconstest-installed.py new file mode 100644 index 0000000..7cef5c4 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/basic/variantdir/sconstest-installed.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +A simple test for VariantDir, in connection with basic +automocing from cxx and header files and the Uic5 builder. +""" + +import sys + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +test.run(arguments="bld/test_realqt" + TestSCons._exe) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConscript b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConscript new file mode 100644 index 0000000..d560985 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConscript @@ -0,0 +1,9 @@ +Import("qtEnv") + +env = qtEnv.Clone() +env['QT5_GOBBLECOMMENTS']=1 +env['QT5_DEBUG']=1 +env.EnableQt5Modules(['QtCore','QtWidgets']) + +env.Program('main', Glob('*.cpp')) + diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConstruct new file mode 100644 index 0000000..9754f10 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') + +SConscript('SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/main.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/main.cpp new file mode 100644 index 0000000..6d8b713 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/main.cpp @@ -0,0 +1,14 @@ +#include "mocFromCpp.h" +#include "mocFromH.h" + +#include +#include + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + mocFromCpp(); + mocFromH(); + printf("Hello World\n"); + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.cpp new file mode 100644 index 0000000..b4a24ec --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.cpp @@ -0,0 +1,41 @@ +#include + +#include "mocFromCpp.h" + + +/* + +class MyClass1 : public QObject { + Q_OBJECT + public: + MyClass1() : QObject() {}; + public slots: + void myslot() {}; +}; +void mocFromCpp() { + MyClass1 myclass; +} +#include "mocFromCpp.moc" + +*/ + +// class MyClass1 : public QObject { Q_OBJECT; }; + +class MyClass1 +{ + // Q_OBJECT + + /* and another Q_OBJECT but in + * a C comment, + * ... next Q_OBJECT + */ + +public: + MyClass1() {}; + void myslot() {}; +}; + +void mocFromCpp() +{ + MyClass1 myclass; +} diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.h new file mode 100644 index 0000000..fc1e04c --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.h @@ -0,0 +1,2 @@ +void mocFromCpp(); + diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.cpp new file mode 100644 index 0000000..7cfb2be --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.cpp @@ -0,0 +1,10 @@ +#include "mocFromH.h" + +MyClass2::MyClass2(){} + +void MyClass2::myslot() {} + +void mocFromH() { + MyClass2 myclass; +} + diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.h b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.h new file mode 100644 index 0000000..6a96ca2 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.h @@ -0,0 +1,32 @@ +#include + +/* +class MyClass2 : public QObject { + // Here we define a Q_OBJECT + Q_OBJECT; + public: + MyClass2(); + public slots: + void myslot(); +}; +void mocFromH(); + +*/ + +// class MyClass2 : public QObject { Q_OBJECT; }; + +class MyClass2 +{ + // Q_OBJECT + + /* and another Q_OBJECT but in + * a C comment, + * ... next Q_OBJECT + */ + +public: + MyClass2(); + void myslot(); +}; + +void mocFromH(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/sconstest-ccomment.py b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/sconstest-ccomment.py new file mode 100644 index 0000000..842909c --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/sconstest-ccomment.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +A simple test for a few C/C++ comments, containing the +string Q_OBJECT. With the QT5_GOBBLECOMMENTS variable set, +no automocing should get triggered. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('../../../qtenv.py') +test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConscript b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConscript new file mode 100644 index 0000000..1366183 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConscript @@ -0,0 +1,6 @@ +Import("qtEnv") + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) + +env.Program('main', Glob('*.cpp')) diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConstruct new file mode 100644 index 0000000..9754f10 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') + +SConscript('SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/main.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/main.cpp new file mode 100644 index 0000000..6d8b713 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/main.cpp @@ -0,0 +1,14 @@ +#include "mocFromCpp.h" +#include "mocFromH.h" + +#include +#include + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + mocFromCpp(); + mocFromH(); + printf("Hello World\n"); + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.cpp new file mode 100644 index 0000000..407cc41 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.cpp @@ -0,0 +1,27 @@ +#include "mocFromCpp.h" + +#include +#include + +class MyClass1 +{ +public: + MyClass1() {}; + void myslot() {}; + void printme() + { + printf("It's a Q_OBJECT!"); + printf("Concatenating " + "a Q_OBJECT" + " with another " + "Q_OBJECT" + "and a " + "Q_OBJECT, finally"); + }; + +}; + +void mocFromCpp() +{ + MyClass1 myclass; +} diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.h new file mode 100644 index 0000000..fc1e04c --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.h @@ -0,0 +1,2 @@ +void mocFromCpp(); + diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.cpp new file mode 100644 index 0000000..7cfb2be --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.cpp @@ -0,0 +1,10 @@ +#include "mocFromH.h" + +MyClass2::MyClass2(){} + +void MyClass2::myslot() {} + +void mocFromH() { + MyClass2 myclass; +} + diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.h b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.h new file mode 100644 index 0000000..6868c89 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.h @@ -0,0 +1,21 @@ +#include +#include + +class MyClass2 +{ +public: + MyClass2(); + void myslot(); + void printme() + { + printf("It's a Q_OBJECT!"); + printf("Concatenating " + "a Q_OBJECT" + " with another " + "Q_OBJECT" + "and a " + "Q_OBJECT, finally"); + }; +}; + +void mocFromH(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/sconstest-literalstring.py b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/sconstest-literalstring.py new file mode 100644 index 0000000..3d63113 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/sconstest-literalstring.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +A simple test, ensuring that the Q_OBJECT keyword in a +literal C/C++ string does not trigger automocing. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('../../../qtenv.py') +test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript new file mode 100644 index 0000000..81a9851 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript @@ -0,0 +1,8 @@ +Import("qtEnv") + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) +env.Append(CPPPATH=['include']) + +env.Program('main', Glob('src/*.cpp')) + diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript-fails b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript-fails new file mode 100644 index 0000000..8e3fcc6 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript-fails @@ -0,0 +1,9 @@ +Import("qtEnv") + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) +env.Append(CPPPATH=['include']) +env['QT5_AUTOMOC_SCANCPPPATH']='0' + +env.Program('main', Glob('src/*.cpp')) + diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/SConstruct new file mode 100644 index 0000000..9754f10 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') + +SConscript('SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromCpp.h new file mode 100644 index 0000000..84097dd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromCpp.h @@ -0,0 +1 @@ +void mocFromCpp(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromH.h b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromH.h new file mode 100644 index 0000000..79fda5a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromH.h @@ -0,0 +1,11 @@ +#include + +class MyClass2 : public QObject { + // Here we define a Q_OBJECT + Q_OBJECT; + public: + MyClass2(); + public slots: + void myslot(); +}; +void mocFromH(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/main.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/main.cpp new file mode 100644 index 0000000..6d8b713 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/main.cpp @@ -0,0 +1,14 @@ +#include "mocFromCpp.h" +#include "mocFromH.h" + +#include +#include + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + mocFromCpp(); + mocFromH(); + printf("Hello World\n"); + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromCpp.cpp new file mode 100644 index 0000000..e18d1b8 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromCpp.cpp @@ -0,0 +1,15 @@ +#include + +#include "mocFromCpp.h" + +class MyClass1 : public QObject { + Q_OBJECT + public: + MyClass1() : QObject() {}; + public slots: + void myslot() {}; +}; +void mocFromCpp() { + MyClass1 myclass; +} +#include "mocFromCpp.moc" diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromH.cpp new file mode 100644 index 0000000..7cfb2be --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromH.cpp @@ -0,0 +1,10 @@ +#include "mocFromH.h" + +MyClass2::MyClass2(){} + +void MyClass2::myslot() {} + +void mocFromH() { + MyClass2 myclass; +} + diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default-fails.py b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default-fails.py new file mode 100644 index 0000000..469c0b5 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default-fails.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Disabled the CPPPATH support of the Automoc feature: +uses the CPPPATH list of the current environment, but still fails. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('SConscript-fails','SConscript') +test.file_fixture('../../../qtenv.py') +test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +test.run(status=2, stderr=None) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default.py b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default.py new file mode 100644 index 0000000..586deb3 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Default settings for the CPPPATH support of the Automoc feature: +it is enabled and uses the CPPPATH list of the current environment. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('SConscript','SConscript') +test.file_fixture('../../../qtenv.py') +test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript new file mode 100644 index 0000000..ea6157e --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript @@ -0,0 +1,9 @@ +Import("qtEnv") + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) +env.Append(CPPPATH=['include']) +env['QT5_AUTOMOC_CPPPATH']=['include'] + +env.Program('main', Glob('src/*.cpp')) + diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript-fails b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript-fails new file mode 100644 index 0000000..90689ee --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript-fails @@ -0,0 +1,9 @@ +Import("qtEnv") + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) +env.Append(CPPPATH=['include']) +env['QT5_AUTOMOC_CPPPATH']=['wrongdir'] + +env.Program('main', Glob('src/*.cpp')) + diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/SConstruct new file mode 100644 index 0000000..9754f10 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') + +SConscript('SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromCpp.h new file mode 100644 index 0000000..84097dd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromCpp.h @@ -0,0 +1 @@ +void mocFromCpp(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromH.h b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromH.h new file mode 100644 index 0000000..79fda5a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromH.h @@ -0,0 +1,11 @@ +#include + +class MyClass2 : public QObject { + // Here we define a Q_OBJECT + Q_OBJECT; + public: + MyClass2(); + public slots: + void myslot(); +}; +void mocFromH(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/main.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/main.cpp new file mode 100644 index 0000000..6d8b713 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/main.cpp @@ -0,0 +1,14 @@ +#include "mocFromCpp.h" +#include "mocFromH.h" + +#include +#include + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + mocFromCpp(); + mocFromH(); + printf("Hello World\n"); + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromCpp.cpp new file mode 100644 index 0000000..e18d1b8 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromCpp.cpp @@ -0,0 +1,15 @@ +#include + +#include "mocFromCpp.h" + +class MyClass1 : public QObject { + Q_OBJECT + public: + MyClass1() : QObject() {}; + public slots: + void myslot() {}; +}; +void mocFromCpp() { + MyClass1 myclass; +} +#include "mocFromCpp.moc" diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromH.cpp new file mode 100644 index 0000000..7cfb2be --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromH.cpp @@ -0,0 +1,10 @@ +#include "mocFromH.h" + +MyClass2::MyClass2(){} + +void MyClass2::myslot() {} + +void mocFromH() { + MyClass2 myclass; +} + diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific-fails.py b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific-fails.py new file mode 100644 index 0000000..b301e80 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific-fails.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Explicitly sets the path list to scan for mocable files, +but to a wrong folder. +Although the correct CPPPATH is used, this lets the test +fail...and proves that the option QT5_AUTOMOC_CPPPATH +really has an effect. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('SConscript-fails','SConscript') +test.file_fixture('../../../qtenv.py') +test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +test.run(status=2, stderr=None) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific.py b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific.py new file mode 100644 index 0000000..a9ba087 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Explicitly sets the path list to scan for moc'able files. +The correct CPPPATH is used too, but gets only searched for +normal implicit header dependencies (as is proved by the +the accompanying test that fails). +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('SConscript','SConscript') +test.file_fixture('../../../qtenv.py') +test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConscript b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConscript new file mode 100644 index 0000000..f224ec9 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConscript @@ -0,0 +1,10 @@ +Import("qtEnv") + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) +env['QT5_AUTOSCAN']=0 + +env.ExplicitMoc5('explicitly_moced_FromHeader.cpp','mocFromH.h') +env.ExplicitMoc5('explicitly_moced_FromCpp.strange_cpp_moc_prefix','mocFromCpp.cpp') + +env.Program('main', Glob('*.cpp')) diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConstruct new file mode 100644 index 0000000..9754f10 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') + +SConscript('SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/main.cpp b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/main.cpp new file mode 100644 index 0000000..6d8b713 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/main.cpp @@ -0,0 +1,14 @@ +#include "mocFromCpp.h" +#include "mocFromH.h" + +#include +#include + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + mocFromCpp(); + mocFromH(); + printf("Hello World\n"); + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.cpp new file mode 100644 index 0000000..669d7a1 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.cpp @@ -0,0 +1,16 @@ +#include + +#include "mocFromCpp.h" + +class MyClass1 : public QObject { + Q_OBJECT + public: + MyClass1() : QObject() {}; + public slots: + void myslot() {}; +}; +void mocFromCpp() { + MyClass1 myclass; +} +#include "explicitly_moced_FromCpp.strange_cpp_moc_prefix" + diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.h new file mode 100644 index 0000000..fc1e04c --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.h @@ -0,0 +1,2 @@ +void mocFromCpp(); + diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.cpp new file mode 100644 index 0000000..586aafb --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.cpp @@ -0,0 +1,8 @@ +#include "mocFromH.h" + +MyClass2::MyClass2() : QObject() {} +void MyClass2::myslot() {} +void mocFromH() { + MyClass2 myclass; +} + diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.h b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.h new file mode 100644 index 0000000..48fdd7e --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.h @@ -0,0 +1,11 @@ +#include + +class MyClass2 : public QObject { + Q_OBJECT; + public: + MyClass2(); + public slots: + void myslot(); +}; +void mocFromH(); + diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/sconstest-explicit.py b/tests/site_scons/site_tools/qt5/test/moc/explicit/sconstest-explicit.py new file mode 100644 index 0000000..f5e78fe --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/explicit/sconstest-explicit.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Test of the explicit Moc5 builder, with arbitrary filenames +for the created files. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConscript b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConscript new file mode 100644 index 0000000..a8b791c --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConscript @@ -0,0 +1,12 @@ +Import("qtEnv dup reverted") + +qtEnv.EnableQt5Modules(['QtCore','QtGui']) + +if dup == 0: + qtEnv.Append(CPPPATH=['.']) + +if reverted == 0: + qtEnv.Program('aaa',['aaa.cpp','bbb.cpp']) +else: + qtEnv.Program('aaa',['bbb.cpp','aaa.cpp']) + diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConstruct new file mode 100644 index 0000000..3ee88b6 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConstruct @@ -0,0 +1,25 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() + +reverted=int(ARGUMENTS.get('reverted', 0)) +dup = 1 +if ARGUMENTS.get('variant_dir', 0): + if ARGUMENTS.get('chdir', 0): + SConscriptChdir(1) + else: + SConscriptChdir(0) + dup=int(ARGUMENTS.get('dup', 1)) + if dup == 0: + builddir = 'build_dup0' + qtEnv['QT5_DEBUG'] = 1 + else: + builddir = 'build' + VariantDir(builddir, '.', duplicate=dup) + print builddir, dup + sconscript = Dir(builddir).File('SConscript') +else: + sconscript = File('SConscript') + +Export("qtEnv dup reverted") +SConscript( sconscript ) diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.cpp new file mode 100644 index 0000000..054d582 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.cpp @@ -0,0 +1,7 @@ +#include "aaa.h" + +int main() +{ + aaa a; + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.h b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.h new file mode 100644 index 0000000..3438edd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.h @@ -0,0 +1,9 @@ +#include + +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa() {}; +}; diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/bbb.cpp b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/bbb.cpp new file mode 100644 index 0000000..6fc20da --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/bbb.cpp @@ -0,0 +1,4 @@ +int bbb() +{ + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/sconstest-order-independent.py b/tests/site_scons/site_tools/qt5/test/moc/order_independent/sconstest-order-independent.py new file mode 100644 index 0000000..083bd7b --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/moc/order_independent/sconstest-order-independent.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +""" +Ensures that no rebuilds get triggered when the order of the source +list changes in the Automoc routine(s). +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('image') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') + +test.run() +test.up_to_date(options="-n", arguments=".") +test.up_to_date(options="-n reverted=1", arguments=".") +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript new file mode 100644 index 0000000..1bcb156 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript @@ -0,0 +1,8 @@ +Import('qtEnv') + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) + +source_files = Glob('*.cpp')+Glob('*.qrc') + +env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript-wflags b/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript-wflags new file mode 100644 index 0000000..bf987fc --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript-wflags @@ -0,0 +1,9 @@ +Import('qtEnv') + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) + +source_files = Glob('*.cpp')+Glob('*.qrc') +env['QT5_QRCFLAGS'] = ['-name', 'icons'] + +env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/basic/image/SConstruct new file mode 100644 index 0000000..00e5705 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/basic/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons.qrc new file mode 100644 index 0000000..86fe71b --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons.qrc @@ -0,0 +1,5 @@ + + + icons/scons.png + + diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons/scons.png new file mode 100644 index 0000000000000000000000000000000000000000..7d85f1f8c28e010a122c55baf3de8185609c95a4 GIT binary patch literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F literal 0 HcmV?d00001 diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/image/main.cpp b/tests/site_scons/site_tools/qt5/test/qrc/basic/image/main.cpp new file mode 100644 index 0000000..304dc3a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/basic/image/main.cpp @@ -0,0 +1,11 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + Q_INIT_RESOURCE(icons); + + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basic.py b/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basic.py new file mode 100644 index 0000000..e88cc9e --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basic.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Basic test for the Qrc() builder. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('SConscript') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basicwflags.py b/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basicwflags.py new file mode 100644 index 0000000..4d1b92d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basicwflags.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Basic test for the Qrc() builder, with '-name' flag set. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('SConscript-wflags','SConscript') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript new file mode 100644 index 0000000..8445a06 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript @@ -0,0 +1,9 @@ +Import('qtEnv') + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) + +source_files = Glob('*.cpp') +source_files.append(env.Qrc5('icons')) + +env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript-wflags b/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript-wflags new file mode 100644 index 0000000..961c00b --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript-wflags @@ -0,0 +1,11 @@ +Import('qtEnv') + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) + +source_files = Glob('*.cpp') +source_files.append(env.Qrc5('icons')) + +env['QT5_QRCFLAGS'] = ['-name', 'icons'] + +env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/manual/image/SConstruct new file mode 100644 index 0000000..00e5705 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/manual/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons.qrc new file mode 100644 index 0000000..86fe71b --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons.qrc @@ -0,0 +1,5 @@ + + + icons/scons.png + + diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons/scons.png new file mode 100644 index 0000000000000000000000000000000000000000..7d85f1f8c28e010a122c55baf3de8185609c95a4 GIT binary patch literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F literal 0 HcmV?d00001 diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/image/main.cpp b/tests/site_scons/site_tools/qt5/test/qrc/manual/image/main.cpp new file mode 100644 index 0000000..304dc3a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/manual/image/main.cpp @@ -0,0 +1,11 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + Q_INIT_RESOURCE(icons); + + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manual.py b/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manual.py new file mode 100644 index 0000000..0a8fac9 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manual.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Basic test for the Qrc() builder, called explicitly. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('SConscript') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manualwflags.py b/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manualwflags.py new file mode 100644 index 0000000..aef66c7 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manualwflags.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Basic test for the Qrc() builder, called explicitly with '-name' flag set. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('SConscript-wflags','SConscript') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript new file mode 100644 index 0000000..1bcb156 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript @@ -0,0 +1,8 @@ +Import('qtEnv') + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) + +source_files = Glob('*.cpp')+Glob('*.qrc') + +env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript-manual b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript-manual new file mode 100644 index 0000000..d77c2f8 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript-manual @@ -0,0 +1,9 @@ +Import('qtEnv') + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) + +source_files = Glob('*.cpp') +qrc_files = env.Qrc5(['icons','other']) + +env.Program('main', source_files+qrc_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/SConstruct new file mode 100644 index 0000000..00e5705 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons.qrc new file mode 100644 index 0000000..86fe71b --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons.qrc @@ -0,0 +1,5 @@ + + + icons/scons.png + + diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons/scons.png new file mode 100644 index 0000000000000000000000000000000000000000..7d85f1f8c28e010a122c55baf3de8185609c95a4 GIT binary patch literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F literal 0 HcmV?d00001 diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/main.cpp b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/main.cpp new file mode 100644 index 0000000..325478d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/main.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + Q_INIT_RESOURCE(icons); + Q_INIT_RESOURCE(other); + + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other.qrc b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other.qrc new file mode 100644 index 0000000..12ed5e8 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other.qrc @@ -0,0 +1,5 @@ + + + other/rocks.png + + diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other/rocks.png b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other/rocks.png new file mode 100644 index 0000000000000000000000000000000000000000..7d85f1f8c28e010a122c55baf3de8185609c95a4 GIT binary patch literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F literal 0 HcmV?d00001 diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles-manual.py b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles-manual.py new file mode 100644 index 0000000..ad54686 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles-manual.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Tests the Qrc() builder, when more than one .qrc file is given. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('SConscript-manual','SConscript') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles.py b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles.py new file mode 100644 index 0000000..ca41695 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Tests the Qrc() builder, when more than one .qrc file is given to the +Program/Library builders directly. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('SConscript') +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConscript new file mode 100644 index 0000000..560f0cc --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConscript @@ -0,0 +1,11 @@ +Import('qtEnv') + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) + +source_files = Glob('*.cpp') +source_files.append(env.Qrc5('icons')) + +env['QT5_QRCFLAGS'] = ['-name', 'othername'] + +env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConstruct new file mode 100644 index 0000000..00e5705 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons.qrc new file mode 100644 index 0000000..86fe71b --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons.qrc @@ -0,0 +1,5 @@ + + + icons/scons.png + + diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons/scons.png new file mode 100644 index 0000000000000000000000000000000000000000..7d85f1f8c28e010a122c55baf3de8185609c95a4 GIT binary patch literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F literal 0 HcmV?d00001 diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/main.cpp b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/main.cpp new file mode 100644 index 0000000..0457bcd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/main.cpp @@ -0,0 +1,11 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + Q_INIT_RESOURCE(othername); + + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/sconstest-othername.py b/tests/site_scons/site_tools/qt5/test/qrc/othername/sconstest-othername.py new file mode 100644 index 0000000..a62937d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/othername/sconstest-othername.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Rename test for the Qrc() builder, uses the '-name' flag to set a different +name for the resulting .cxx file. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConscript new file mode 100644 index 0000000..1bcb156 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConscript @@ -0,0 +1,8 @@ +Import('qtEnv') + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) + +source_files = Glob('*.cpp')+Glob('*.qrc') + +env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConstruct new file mode 100644 index 0000000..00e5705 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.cpp b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.cpp new file mode 100644 index 0000000..304dc3a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.cpp @@ -0,0 +1,11 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + Q_INIT_RESOURCE(icons); + + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.qrc new file mode 100644 index 0000000..86fe71b --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.qrc @@ -0,0 +1,5 @@ + + + icons/scons.png + + diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons/scons.png new file mode 100644 index 0000000000000000000000000000000000000000..7d85f1f8c28e010a122c55baf3de8185609c95a4 GIT binary patch literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F literal 0 HcmV?d00001 diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/sconstest-samefilename.py b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/sconstest-samefilename.py new file mode 100644 index 0000000..91178ac --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/sconstest-samefilename.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Check that the correct prefixes/suffixes are appended to the target of +the Qrc() builder. Else, we could not add .qrc and CXX files with the +same prefix to the Program/Library builders. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConscript new file mode 100644 index 0000000..53ef724 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConscript @@ -0,0 +1,8 @@ +Import('qtEnv') + +env = qtEnv.Clone() +env.EnableQt5Modules(['QtCore','QtWidgets']) + +source_files = Glob('*.cpp')+['qrc/icons.qrc'] + +env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConstruct new file mode 100644 index 0000000..00e5705 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/main.cpp b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/main.cpp new file mode 100644 index 0000000..304dc3a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/main.cpp @@ -0,0 +1,11 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + Q_INIT_RESOURCE(icons); + + return 0; +} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons.qrc new file mode 100644 index 0000000..86fe71b --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons.qrc @@ -0,0 +1,5 @@ + + + icons/scons.png + + diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons/scons.png new file mode 100644 index 0000000000000000000000000000000000000000..7d85f1f8c28e010a122c55baf3de8185609c95a4 GIT binary patch literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F literal 0 HcmV?d00001 diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/sconstest-subdir.py b/tests/site_scons/site_tools/qt5/test/qrc/subdir/sconstest-subdir.py new file mode 100644 index 0000000..bd03a96 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qrc/subdir/sconstest-subdir.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +In this test the QRC file is placed in a subfolder (qrc/icons.qrc). The +Qrc5() builder should correctly strip the leading path and set the "-name" +option for the RCC executable to "icons" only. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qt_examples/create_scons_tests.py b/tests/site_scons/site_tools/qt5/test/qt_examples/create_scons_tests.py new file mode 100644 index 0000000..0ffbf02 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qt_examples/create_scons_tests.py @@ -0,0 +1,748 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# +# create_scons_test.py +# +# Populates a Qt "examples" directory with files for the +# SCons test framework. +# +# +# +# Usage: +# +# Step 1: Copy the "examples" folder of your Qt source tree into +# this directory. +# Step 2: Run "python create_scons_tests.py" to create all files +# for the SCons test framework. +# Step 3: Execute "python runtest.py -a" to run all tests +# +# Additional options for this script are: +# +# -local Creates the test files in the local directory, +# also copies qtenv.py and qt5.py to their correct +# places. +# -clean Removes all intermediate test files. +# +# + +import os, sys, re, glob, shutil + +# cxx file extensions +cxx_ext = ['.c', '.cpp', '.cxx', '.cc'] +# header file extensions +h_ext = ['.h', '.hpp', '.hxx'] +# regex for includes +inc_re = re.compile(r'#include\s+<([^>]+)>') +# regex for qtLibraryTarget function +qtlib_re = re.compile(r'\$\$qtLibraryTarget\(([^\)]+)\)') +qrcinit_re = re.compile('Q_INIT_RESOURCE\(([^\)]+)\)') +localvar_re = re.compile("\\$\\$([^/\s]+)") +qthave_re = re.compile("qtHaveModule\([^\)]+\)\s*:\s") + +updir = '..'+os.sep + +# we currently skip all .pro files that use these config values +complicated_configs = ['qdbus','phonon','plugin'] +# for the following CONFIG values we have to provide default qt modules +config_modules = {'designer' : ['QtCore','QtGui','QtXml','QtWidgets','QtDesigner','QtDesignerComponents'], + 'uitools' : ['QtCore','QtGui','QtUiTools'], + 'assistant' : ['QtCore','QtGui','QtXml','QtScript','QtAssistant'], + 'core' : ['QtCore'], + 'gui' : ['QtCore', 'QtGui'], + 'concurrent' : ['QtCore', 'QtConcurrent'], + 'dbus' : ['QtCore', 'QtDBus'], + 'declarative' : ['QtCore', 'QtGui', 'QtScript', 'QtSql', 'QtNetwork', 'QtWidgets', 'QtXmlPatterns', 'QtDeclarative'], + 'printsupport' : ['QtCore', 'QtGui', 'QtWidgets', 'QtPrintSupport'], + 'mediawidgets' : ['QtCore', 'QtGui', 'QtOpenGL', 'QtNetwork', 'QtWidgets', 'QtMultimedia', 'QtMultimediaWidgets'], + 'webkitwidgets' : ['QtCore', 'QtGui', 'QtOpenGL', 'QtNetwork', 'QtWidgets', 'QtPrintSupport', 'QtWebKit', 'QtQuick', 'QtQml', 'QtSql', 'QtV8', 'QtWebKitWidgets'], + 'qml' : ['QtCore', 'QtGui', 'QtNetwork', 'QtV8', 'QtQml'], + 'quick' : ['QtCore', 'QtGui', 'QtNetwork', 'QtV8', 'QtQml', 'QtQuick'], + 'axcontainer' : [], + 'axserver' : [], + 'testlib' : ['QtCore', 'QtTest'], + 'xmlpatterns' : ['QtCore', 'QtNetwork', 'QtXmlPatterns'], + 'qt' : ['QtCore','QtGui'], + 'xml' : ['QtCore','QtGui','QtXml'], + 'webkit' : ['QtCore','QtGui','QtQuick','QtQml','QtNetwork','QtSql','QtV8','QtWebKit'], + 'network' : ['QtCore','QtNetwork'], + 'svg' : ['QtCore','QtGui','QtWidgets','QtSvg'], + 'script' : ['QtCore','QtScript'], + 'scripttools' : ['QtCore','QtGui','QtWidgets','QtScript','QtScriptTools'], + 'multimedia' : ['QtCore','QtGui','QtNetwork','QtMultimedia'], + 'script' : ['QtCore','QtScript'], + 'help' : ['QtCore','QtGui','QtWidgets','QtCLucene','QtSql','QtNetwork','QtHelp'], + 'qtestlib' : ['QtCore','QtTest'], + 'opengl' : ['QtCore','QtGui','QtOpenGL'], + 'widgets' : ['QtCore','QtGui','QtWidgets'] + } +# for the following CONFIG values we have to provide additional CPP defines +config_defines = {'plugin' : ['QT_PLUGIN'], + 'designer' : ['QDESIGNER_EXPORT_WIDGETS'] + } + +# dictionary of special Qt Environment settings for all single tests/pro files +qtenv_flags = {'QT5_GOBBLECOMMENTS' : '1' + } + +# available qt modules +validModules = [ + # Qt Essentials + 'QtCore', + 'QtGui', + 'QtMultimedia', + 'QtMultimediaQuick_p', + 'QtMultimediaWidgets', + 'QtNetwork', + 'QtPlatformSupport', + 'QtQml', + 'QtQmlDevTools', + 'QtQuick', + 'QtQuickParticles', + 'QtSql', + 'QtQuickTest', + 'QtTest', + 'QtWebKit', + 'QtWebKitWidgets', + 'QtWidgets', + # Qt Add-Ons + 'QtConcurrent', + 'QtDBus', + 'QtOpenGL', + 'QtPrintSupport', + 'QtDeclarative', + 'QtScript', + 'QtScriptTools', + 'QtSvg', + 'QtUiTools', + 'QtXml', + 'QtXmlPatterns', + # Qt Tools + 'QtHelp', + 'QtDesigner', + 'QtDesignerComponents', + # Other + 'QtCLucene', + 'QtConcurrent', + 'QtV8' + ] + +def findQtBinParentPath(qtpath): + """ Within the given 'qtpath', search for a bin directory + containing the 'lupdate' executable and return + its parent path. + """ + for path, dirs, files in os.walk(qtpath): + for d in dirs: + if d == 'bin': + if sys.platform.startswith("linux"): + lpath = os.path.join(path, d, 'lupdate') + else: + lpath = os.path.join(path, d, 'lupdate.exe') + if os.path.isfile(lpath): + return path + + return "" + +def findMostRecentQtPath(dpath): + paths = glob.glob(dpath) + if len(paths): + paths.sort() + return findQtBinParentPath(paths[-1]) + + return "" + +def detectLatestQtVersion(): + if sys.platform.startswith("linux"): + # Inspect '/usr/local/Qt' first... + p = findMostRecentQtPath(os.path.join('/usr','local','Qt-*')) + if not p: + # ... then inspect '/usr/local/Trolltech'... + p = findMostRecentQtPath(os.path.join('/usr','local','Trolltech','*')) + if not p: + # ...then try to find a binary install... + p = findMostRecentQtPath(os.path.join('/opt','Qt*')) + if not p: + # ...then try to find a binary SDK. + p = findMostRecentQtPath(os.path.join('/opt','qtsdk*')) + + else: + # Simple check for Windows: inspect only 'C:\Qt' + paths = glob.glob(os.path.join('C:\\', 'Qt', 'Qt*')) + p = "" + if len(paths): + paths.sort() + # Select version with highest release number + paths = glob.glob(os.path.join(paths[-1], '5*')) + if len(paths): + paths.sort() + # Is it a MinGW or VS installation? + p = findMostRecentQtPath(os.path.join(paths[-1], 'mingw*')) + if not p: + # No MinGW, so try VS... + p = findMostRecentQtPath(os.path.join(paths[-1], 'msvc*')) + + return os.environ.get("QT5DIR", p) + +def detectPkgconfigPath(qtdir): + pkgpath = os.path.join(qtdir, 'lib', 'pkgconfig') + if os.path.exists(os.path.join(pkgpath,'Qt5Core.pc')): + return pkgpath + pkgpath = os.path.join(qtdir, 'lib') + if os.path.exists(os.path.join(pkgpath,'Qt5Core.pc')): + return pkgpath + + return "" + +def expandProFile(fpath): + """ Read the given file into a list of single lines, + while expanding included files (mainly *.pri) + recursively. + """ + lines = [] + f = open(fpath,'r') + content = f.readlines() + f.close() + pwdhead, tail = os.path.split(fpath) + head = pwdhead + if pwdhead: + pwdhead = os.path.abspath(pwdhead) + else: + pwdhead = os.path.abspath(os.getcwd()) + for idx, l in enumerate(content): + l = l.rstrip('\n') + l = l.rstrip() + if '$$PWD' in l: + l = l.replace("$$PWD", pwdhead) + if l.startswith('include('): + # Expand include file + l = l.rstrip(')') + l = l.replace('include(','') + while '$$' in l: + # Try to replace the used local variable by + # searching back in the content + m = localvar_re.search(l) + if m: + key = m.group(1) + tidx = idx-1 + skey = "%s = " % key + while tidx >= 0: + if content[tidx].startswith(skey): + # Key found + l = l.replace('$$%s' % key, content[tidx][len(skey):].rstrip('\n')) + if os.path.join('..','..','qtbase','examples') in l: + # Quick hack to cope with erroneous *.pro files + l = l.replace(os.path.join('..','..','qtbase','examples'), os.path.join('..','examples')) + break + tidx -= 1 + if tidx < 0: + print "Error: variable %s could not be found during parsing!" % key + break + ipath = l + if head: + ipath = os.path.join(head, l) + # Does the file exist? + if not os.path.isfile(ipath): + # Then search for it the hard way + ihead, tail = os.path.split(ipath) + for spath, dirs, files in os.walk('.'): + for f in files: + if f == tail: + ipath = os.path.join(spath, f) + lines.extend(expandProFile(ipath)) + else: + lines.append(l) + + return lines + +def parseProFile(fpath): + """ Parse the .pro file fpath and return the defined + variables in a dictionary. + """ + keys = {} + curkey = None + curlist = [] + for l in expandProFile(fpath): + # Strip off qtHaveModule part + m = qthave_re.search(l) + if m: + l = qthave_re.sub("", l) + kl = l.split('=') + if len(kl) > 1: + # Close old key + if curkey: + if keys.has_key(curkey): + keys[curkey].extend(curlist) + else: + keys[curkey] = curlist + + # Split off trailing + + nkey = kl[0].rstrip('+') + nkey = nkey.rstrip() + # Split off optional leading part with "contains():" + cl = nkey.split(':') + if ('lesock' not in l) and ((len(cl) < 2) or ('msvc' in cl[0])): + nkey = cl[-1] + # Open new key + curkey = nkey.split()[0] + value = kl[1].lstrip() + if value.endswith('\\'): + # Key is continued on next line + value = value[:-1] + curlist = value.split() + else: + # Single line key + if keys.has_key(curkey): + keys[curkey].extend(value.split()) + else: + keys[curkey] = value.split() + curkey = None + curlist = [] + else: + if l.endswith('\\'): + # Continue current key + curlist.extend(l[:-1].split()) + else: + # Unknown, so go back to VOID state + if curkey: + # Append last item for current key... + curlist.extend(l.split()) + if keys.has_key(curkey): + keys[curkey].extend(curlist) + else: + keys[curkey] = curlist + + # ... and reset parse state. + curkey = None + curlist = [] + + return keys + +def writeSConstruct(dirpath): + """ Create a SConstruct file in dirpath. + """ + sc = open(os.path.join(dirpath,'SConstruct'),'w') + sc.write("""import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + """) + sc.close() + +def collectModulesFromFiles(fpath): + """ Scan source files in dirpath for included + Qt5 modules, and return the used modules in a list. + """ + mods = [] + try: + f = open(fpath,'r') + content = f.read() + f.close() + except: + return mods + + for m in inc_re.finditer(content): + mod = m.group(1) + if (mod in validModules) and (mod not in mods): + mods.append(mod) + return mods + +def findQResourceName(fpath): + """ Scan the source file fpath and return the name + of the QRC instance that gets initialized via + QRC_INIT_RESOURCE. + """ + name = "" + + try: + f = open(fpath,'r') + content = f.read() + f.close() + except: + return name + + m = qrcinit_re.search(content) + if m: + name = m.group(1) + + return name + +def validKey(key, pkeys): + """ Helper function + """ + if pkeys.has_key(key) and len(pkeys[key]) > 0: + return True + + return False + +def collectModules(dirpath, pkeys): + """ Scan source files in dirpath for included + Qt5 modules, and return the used modules in a list. + """ + mods = [] + defines = [] + # Scan subdirs + if validKey('SUBDIRS', pkeys): + for s in pkeys['SUBDIRS']: + flist = glob.glob(os.path.join(dirpath, s, '*.*')) + for f in flist: + root, ext = os.path.splitext(f) + if (ext and ((ext in cxx_ext) or + (ext in h_ext))): + mods.extend(collectModulesFromFiles(f)) + + # Scan sources + if validKey('SOURCES', pkeys): + for s in pkeys['SOURCES']: + f = os.path.join(dirpath,s) + mods.extend(collectModulesFromFiles(f)) + + # Scan headers + if validKey('HEADERS', pkeys): + for s in pkeys['HEADERS']: + f = os.path.join(dirpath,s) + mods.extend(collectModulesFromFiles(f)) + + # Check CONFIG keyword + if validKey('CONFIG', pkeys): + for k in pkeys['CONFIG']: + if config_modules.has_key(k): + mods.extend(config_modules[k]) + if config_defines.has_key(k): + defines.extend(config_defines[k]) + + # Check QT keyword + if validKey('QT', pkeys): + for k in pkeys['QT']: + if config_modules.has_key(k): + mods.extend(config_modules[k]) + + # Make lists unique + unique_mods = [] + for m in mods: + if m not in unique_mods: + unique_mods.append(m) + unique_defines = [] + for d in defines: + if d not in unique_defines: + unique_defines.append(d) + + # Safety hack, if no modules are found so far + # assume that this is a normal Qt GUI application... + if len(unique_mods) == 0: + unique_mods = ['QtCore','QtGui'] + + return (unique_mods, unique_defines) + +def relOrAbsPath(dirpath, rpath): + if rpath.startswith('..'): + return os.path.abspath(os.path.normpath(os.path.join(dirpath, rpath))) + + return rpath + +def writeSConscript(dirpath, profile, pkeys): + """ Create a SConscript file in dirpath. + """ + + # Activate modules + mods, defines = collectModules(dirpath, pkeys) + if validKey('CONFIG', pkeys) and isComplicated(pkeys['CONFIG'][0]): + return False + + qrcname = "" + if not validKey('SOURCES', pkeys): + # No SOURCES specified, try to find CPP files + slist = glob.glob(os.path.join(dirpath,'*.cpp')) + if len(slist) == 0: + # Nothing to build here + return False + else: + # Scan for Q_INIT_RESOURCE + for s in slist: + qrcname = findQResourceName(s) + if qrcname: + break + + allmods = True + for m in mods: + if m not in pkeys['qtmodules']: + print " no module %s" % m + allmods = False + if not allmods: + return False + + sc = open(os.path.join(dirpath,'SConscript'),'w') + sc.write("""Import('qtEnv') + +env = qtEnv.Clone() +""") + + if len(mods): + sc.write('env.EnableQt5Modules([\n') + for m in mods[:-1]: + sc.write("'%s',\n" % m) + sc.write("'%s'\n" % mods[-1]) + sc.write('])\n\n') + + # Add CPPDEFINEs + if len(defines): + sc.write('env.AppendUnique(CPPDEFINES=[\n') + for d in defines[:-1]: + sc.write("'%s',\n" % d) + sc.write("'%s'\n" % defines[-1]) + sc.write('])\n\n') + + # Add LIBS + if validKey('LIBS', pkeys): + sc.write('env.AppendUnique(LIBS=[\n') + for d in pkeys['LIBS'][:-1]: + sc.write("'%s',\n" % d) + sc.write("'%s'\n" % pkeys['LIBS'][-1]) + sc.write('])\n\n') + + # Collect INCLUDEPATHs + incpaths = [] + if validKey('INCLUDEPATH', pkeys): + incpaths = pkeys['INCLUDEPATH'] + if validKey('FORMS', pkeys): + for s in pkeys['FORMS']: + head, tail = os.path.split(s) + if head and head not in incpaths: + incpaths.append(head) + if incpaths: + sc.write('env.Append(CPPPATH=[\n') + for d in incpaths[:-1]: + sc.write("'%s',\n" % relOrAbsPath(dirpath, d)) + sc.write("'%s'\n" % relOrAbsPath(dirpath, incpaths[-1])) + sc.write('])\n\n') + + # Add special environment flags + if len(qtenv_flags): + for key, value in qtenv_flags.iteritems(): + sc.write("env['%s']=%s\n" % (key, value)) + + + # Write source files + if validKey('SOURCES', pkeys): + sc.write('source_files = [\n') + for s in pkeys['SOURCES'][:-1]: + sc.write("'%s',\n" % relOrAbsPath(dirpath, s)) + if not qrcname: + qrcname = findQResourceName(os.path.join(dirpath,s)) + + sc.write("'%s'\n" % relOrAbsPath(dirpath, pkeys['SOURCES'][-1])) + if not qrcname: + qrcname = findQResourceName(os.path.join(dirpath,pkeys['SOURCES'][-1])) + sc.write(']\n\n') + + # Write .ui files + if validKey('FORMS', pkeys): + sc.write('ui_files = [\n') + for s in pkeys['FORMS'][:-1]: + sc.write("'%s',\n" % relOrAbsPath(dirpath, s)) + sc.write("'%s'\n" % relOrAbsPath(dirpath, pkeys['FORMS'][-1])) + sc.write(']\n') + sc.write('env.Uic5(ui_files)\n\n') + + # Write .qrc files + if validKey('RESOURCES', pkeys): + qrc_name = pkeys['RESOURCES'][0] + if qrcname: + if qrc_name.endswith('.qrc'): + qrc_name = qrc_name[:-4] + sc.write("qrc_out = env.Qrc5('%s')\nsource_files.append(qrc_out)\nenv['QT5_QRCFLAGS'] = ['-name', '%s']\n" % (qrc_name, qrcname)) + else: + if not qrc_name.endswith('.qrc'): + qrc_name += '.qrc' + sc.write("source_files.append('%s')\n" % qrc_name) + + # Select module + type = 'Program' + if validKey('TEMPLATE', pkeys): + if pkeys['TEMPLATE'][0] == 'lib': + type = 'StaticLibrary' + if pkeys['TEMPLATE'][0] == 'dll': + type = 'SharedLibrary' + + # TARGET may be wrapped by qtLibraryTarget function... + target = profile + if validKey('TARGET', pkeys): + t = pkeys['TARGET'][0] + m = qtlib_re.search(t) + if m: + t = "Qt" + m.group(1) + target = t.replace("$$TARGET", profile) + + # Create program/lib/dll + else: + if validKey('SOURCES', pkeys): + sc.write("env.%s('%s', source_files)\n\n" % (type, target)) + else: + sc.write("env.%s('%s', Glob('*.cpp'))\n\n" % (type, target)) + + sc.close() + + return True + +def writeSConsTestFile(dirpath, folder): + dirnums = dirpath.count(os.sep)+1 + f = open(os.path.join(dirpath, "sconstest-%s.py" % folder),'w') + f.write(""" +import os +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("%s") +test.file_fixture('%sqtenv.py') +test.file_fixture('%s__init__.py', os.path.join('site_scons','site_tools','qt5','__init__.py')) +test.run() + +test.pass_test() + """ % (folder, updir*dirnums, updir*(dirnums+1))) + f.close() + +def installLocalFiles(dirpath): + dirnums = dirpath.count(os.sep)+1 + shutil.copy(os.path.join(dirpath,updir*dirnums+'qtenv.py'), + os.path.join(dirpath,'qtenv.py')) + toolpath = os.path.join(dirpath,'site_scons','site_tools','qt5') + if not os.path.exists(toolpath): + os.makedirs(toolpath) + shutil.copy(os.path.join(dirpath,updir*(dirnums+1)+'__init__.py'), + os.path.join(dirpath,'site_scons','site_tools','qt5','__init__.py')) + +def isComplicated(keyvalues): + for s in keyvalues: + if s in complicated_configs: + return True + + return False + +# Folders that should get skipped while creating the SConscripts +skip_folders = ['activeqt', 'declarative', 'dbus'] + +def createSConsTest(dirpath, profile, options): + """ Create files for the SCons test framework in dirpath. + """ + pkeys = parseProFile(os.path.join(dirpath, profile)) + if validKey('TEMPLATE', pkeys) and pkeys['TEMPLATE'][0] == 'subdirs': + return + if validKey('CONFIG', pkeys) and isComplicated(pkeys['CONFIG']): + return + if validKey('QT', pkeys) and isComplicated(pkeys['QT']): + return + + head, tail = os.path.split(dirpath) + if head and tail: + print os.path.join(dirpath, profile) + for s in skip_folders: + if s in dirpath: + return + pkeys['qtmodules'] = options['qtmodules'] + if not writeSConscript(dirpath, profile[:-4], pkeys): + return + writeSConstruct(dirpath) + writeSConsTestFile(head, tail) + if options['local']: + installLocalFiles(dirpath) + +def cleanSConsTest(dirpath, profile, options): + """ Remove files for the SCons test framework in dirpath. + """ + try: + os.remove(os.path.join(dirpath,'SConstruct')) + except: + pass + try: + os.remove(os.path.join(dirpath,'SConscript')) + except: + pass + try: + os.remove(os.path.join(dirpath,'qtenv.py')) + except: + pass + try: + shutil.rmtree(os.path.join(dirpath,'site_scons'), + ignore_errors=True) + except: + pass + head, tail = os.path.split(dirpath) + if head and tail: + try: + os.remove(os.path.join(head, "sconstest-%s.py" % tail)) + except: + pass + +def main(): + """ The main program. + """ + + # Parse command line options + options = {'local' : False, # Install qtenv.py and qt5.py in local folder + 'qtpath' : None, + 'pkgconfig' : None + } + clean = False + qtpath = None + for o in sys.argv[1:]: + if o == "-local": + options['local'] = True + elif o == "-clean": + clean = True + else: + options['qtpath'] = o + + if not options['qtpath']: + qtpath = detectLatestQtVersion() + if qtpath == "": + print "No Qt installation found!" + sys.exit(1) + + is_win = sys.platform.startswith('win') + if not is_win: + # Use pkgconfig to detect the available modules + options['pkgconfig'] = detectPkgconfigPath(qtpath) + if options['pkgconfig'] == "": + print "No pkgconfig files found!" + sys.exit(1) + + options['qtpath'] = qtpath + options['qtmodules'] = [] + for v in validModules: + if is_win or os.path.exists(os.path.join(options['pkgconfig'],v.replace('Qt','Qt5')+'.pc')): + options['qtmodules'].append(v) + + if not clean: + doWork = createSConsTest + else: + doWork = cleanSConsTest + + # Detect .pro files + for path, dirs, files in os.walk('.'): + for f in files: + if f.endswith('.pro'): + doWork(path, f, options) + +if __name__ == "__main__": + main() diff --git a/tests/site_scons/site_tools/qt5/test/qt_examples/sconstest.skip b/tests/site_scons/site_tools/qt5/test/qt_examples/sconstest.skip new file mode 100644 index 0000000..e69de29 diff --git a/tests/site_scons/site_tools/qt5/test/qtenv.py b/tests/site_scons/site_tools/qt5/test/qtenv.py new file mode 100644 index 0000000..f37faf2 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/qtenv.py @@ -0,0 +1,107 @@ +# +# Copyright (c) 2001-2010 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +import os, sys, glob +from SCons import Environment + +def findQtBinParentPath(qtpath): + """ Within the given 'qtpath', search for a bin directory + containing the 'lupdate' executable and return + its parent path. + """ + for path, dirs, files in os.walk(qtpath): + for d in dirs: + if d == 'bin': + if sys.platform.startswith("linux"): + lpath = os.path.join(path, d, 'lupdate') + else: + lpath = os.path.join(path, d, 'lupdate.exe') + if os.path.isfile(lpath): + return path + + return "" + +def findMostRecentQtPath(dpath): + paths = glob.glob(dpath) + if len(paths): + paths.sort() + return findQtBinParentPath(paths[-1]) + + return "" + +def detectLatestQtVersion(): + if sys.platform.startswith("linux"): + # Inspect '/usr/local/Qt' first... + p = findMostRecentQtPath('/usr/local/Qt-*') + if not p: + # ... then inspect '/usr/local/Trolltech'... + p = findMostRecentQtPath('/usr/local/Trolltech/*') + if not p: + # ...then try to find a binary install... + p = findMostRecentQtPath('/opt/Qt*') + if not p: + # ...then try to find a binary SDK. + p = findMostRecentQtPath('/opt/qtsdk*') + + else: + # Simple check for Windows: inspect only 'C:\Qt' + paths = glob.glob(os.path.join('C:\\', 'Qt', 'Qt*')) + p = "" + if len(paths): + paths.sort() + # Select version with highest release number + paths = glob.glob(os.path.join(paths[-1], '5*')) + if len(paths): + paths.sort() + # Is it a MinGW or VS installation? + p = findMostRecentQtPath(os.path.join(paths[-1], 'mingw*')) + if not p: + # No MinGW, so try VS... + p = findMostRecentQtPath(os.path.join(paths[-1], 'msvc*')) + + return os.environ.get("QT5DIR", p) + +def detectPkgconfigPath(qtdir): + pkgpath = os.path.join(qtdir, 'lib', 'pkgconfig') + if os.path.exists(os.path.join(pkgpath,'Qt5Core.pc')): + return pkgpath + pkgpath = os.path.join(qtdir, 'lib') + if os.path.exists(os.path.join(pkgpath,'Qt5Core.pc')): + return pkgpath + + return "" + +def createQtEnvironment(qtdir=None, env=None): + if not env: + env = Environment.Environment(tools=['default']) + if not qtdir: + qtdir = detectLatestQtVersion() + env['QT5DIR'] = qtdir + if sys.platform.startswith("linux"): + env['ENV']['PKG_CONFIG_PATH'] = detectPkgconfigPath(qtdir) + env.Tool('qt5') + env.Append(CXXFLAGS=['-fPIC']) + + return env + diff --git a/tests/site_scons/site_tools/qt5/test/sconstest.skip b/tests/site_scons/site_tools/qt5/test/sconstest.skip new file mode 100644 index 0000000..e69de29 diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.cpp new file mode 100644 index 0000000..09e27c6 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.cpp @@ -0,0 +1,7 @@ +#include "MyFile.h" + +aaa::aaa() : my_s(tr("SCons rocks!")) +{ + ; +} + diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.h new file mode 100644 index 0000000..10311dd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.h @@ -0,0 +1,13 @@ +#include +#include + +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa(); + +private: + QString my_s; +}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConscript b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConscript new file mode 100644 index 0000000..915e1cd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConscript @@ -0,0 +1,6 @@ +Import("qtEnv") + +qtEnv['QT5_CLEAN_TS']=1 + +qtEnv.Ts5('my_en.ts', Glob('*.cpp')) +qtEnv.Qm5('my_en','my_en') diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConstruct b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConstruct new file mode 100644 index 0000000..d9d897d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/sconstest-clean.py b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/sconstest-clean.py new file mode 100644 index 0000000..40cb442 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/sconstest-clean.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Test the QT5_CLEAN_TS option, which removes .ts files +on a 'scons -c'. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run(stderr=None) + +test.must_exist(test.workpath('my_en.ts')) +test.must_contain(test.workpath('my_en.ts'),'SCons rocks!') +test.must_exist(test.workpath('my_en.qm')) + +test.run(options = '-c') + +test.must_not_exist(test.workpath('my_en.ts')) +test.must_not_exist(test.workpath('my_en.qm')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.cpp new file mode 100644 index 0000000..09e27c6 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.cpp @@ -0,0 +1,7 @@ +#include "MyFile.h" + +aaa::aaa() : my_s(tr("SCons rocks!")) +{ + ; +} + diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.h new file mode 100644 index 0000000..10311dd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.h @@ -0,0 +1,13 @@ +#include +#include + +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa(); + +private: + QString my_s; +}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConscript b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConscript new file mode 100644 index 0000000..4b68448 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConscript @@ -0,0 +1,3 @@ +Import("qtEnv") + +qtEnv.Ts5('my_en', ['MyFile.cpp','subdir']) diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConstruct b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConstruct new file mode 100644 index 0000000..d9d897d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.cpp new file mode 100644 index 0000000..687c0cd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.cpp @@ -0,0 +1,6 @@ +#include "bbb.h" + +bbb::bbb() : my_s(tr("And Qt5 too!")) +{ + ; +} diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.h b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.h new file mode 100644 index 0000000..0b60846 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.h @@ -0,0 +1,13 @@ +#include +#include + +class bbb : public QObject +{ + Q_OBJECT + +public: + bbb(); + +private: + QString my_s; +}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/sconstest-mixdir.py b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/sconstest-mixdir.py new file mode 100644 index 0000000..df16877 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/sconstest-mixdir.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Runs the Ts() builder with a mix of files and dirs as +input (list of sources). +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run(stderr=None) + +test.must_exist(test.workpath('my_en.ts')) +test.must_contain(test.workpath('my_en.ts'),'SCons rocks!') +test.must_contain(test.workpath('my_en.ts'),'And Qt5 too!') + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.cpp new file mode 100644 index 0000000..09e27c6 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.cpp @@ -0,0 +1,7 @@ +#include "MyFile.h" + +aaa::aaa() : my_s(tr("SCons rocks!")) +{ + ; +} + diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.h new file mode 100644 index 0000000..10311dd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.h @@ -0,0 +1,13 @@ +#include +#include + +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa(); + +private: + QString my_s; +}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConscript b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConscript new file mode 100644 index 0000000..677bd35 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConscript @@ -0,0 +1,6 @@ +Import("qtEnv") + +qtEnv.Ts5('my_en', Glob('*.cpp')) +qtEnv.Ts5('a','MyFile.cpp') +qtEnv.Ts5('b','bbb.cpp') +qtEnv.Qm5('my_en',['a','b']) diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConstruct b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConstruct new file mode 100644 index 0000000..d9d897d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.cpp new file mode 100644 index 0000000..687c0cd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.cpp @@ -0,0 +1,6 @@ +#include "bbb.h" + +bbb::bbb() : my_s(tr("And Qt5 too!")) +{ + ; +} diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.h b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.h new file mode 100644 index 0000000..0b60846 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.h @@ -0,0 +1,13 @@ +#include +#include + +class bbb : public QObject +{ + Q_OBJECT + +public: + bbb(); + +private: + QString my_s; +}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/sconstest-multisource.py b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/sconstest-multisource.py new file mode 100644 index 0000000..5b66c9a --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/sconstest-multisource.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Tests that the Ts() and Qm() builders accept and +process multiple sources correctly. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run(stderr=None) + +test.must_exist(test.workpath('my_en.ts')) +test.must_exist(test.workpath('a.ts')) +test.must_exist(test.workpath('b.ts')) +test.must_contain(test.workpath('my_en.ts'),'SCons rocks!') +test.must_contain(test.workpath('my_en.ts'),'And Qt5 too!') +test.must_contain(test.workpath('a.ts'),'SCons rocks!') +test.must_contain(test.workpath('b.ts'),'And Qt5 too!') +test.must_exist(test.workpath('my_en.qm')) + +test.run(options = '-c') + +test.must_exist(test.workpath('my_en.ts')) +test.must_exist(test.workpath('a.ts')) +test.must_exist(test.workpath('b.ts')) +test.must_not_exist(test.workpath('my_en.qm')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.cpp new file mode 100644 index 0000000..09e27c6 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.cpp @@ -0,0 +1,7 @@ +#include "MyFile.h" + +aaa::aaa() : my_s(tr("SCons rocks!")) +{ + ; +} + diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.h new file mode 100644 index 0000000..10311dd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.h @@ -0,0 +1,13 @@ +#include +#include + +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa(); + +private: + QString my_s; +}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConscript b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConscript new file mode 100644 index 0000000..0d6a666 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConscript @@ -0,0 +1,4 @@ +Import("qtEnv") + +qtEnv.Ts5(['my_en','my_de'], Glob('*.cpp')) +qtEnv.Qm5(['my_en','my_de'],'my_en') diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConstruct b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConstruct new file mode 100644 index 0000000..d9d897d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/sconstest-multitarget.py b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/sconstest-multitarget.py new file mode 100644 index 0000000..2a900fe --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/sconstest-multitarget.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Tests that the Ts() and Qm() builders accept and +process multiple targets correctly. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run(stderr=None) + +test.must_exist(test.workpath('my_en.ts')) +test.must_exist(test.workpath('my_de.ts')) +test.must_contain(test.workpath('my_en.ts'),'SCons rocks!') +test.must_contain(test.workpath('my_de.ts'),'SCons rocks!') +test.must_exist(test.workpath('my_en.qm')) +test.must_exist(test.workpath('my_de.qm')) + +test.run(options = '-c') + +test.must_exist(test.workpath('my_en.ts')) +test.must_exist(test.workpath('my_de.ts')) +test.must_not_exist(test.workpath('my_en.qm')) +test.must_not_exist(test.workpath('my_de.qm')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.cpp new file mode 100644 index 0000000..09e27c6 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.cpp @@ -0,0 +1,7 @@ +#include "MyFile.h" + +aaa::aaa() : my_s(tr("SCons rocks!")) +{ + ; +} + diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.h new file mode 100644 index 0000000..10311dd --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.h @@ -0,0 +1,13 @@ +#include +#include + +class aaa : public QObject +{ + Q_OBJECT + +public: + aaa(); + +private: + QString my_s; +}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConscript b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConscript new file mode 100644 index 0000000..932ec0f --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConscript @@ -0,0 +1,4 @@ +Import("qtEnv") + +qtEnv.Ts5('my_en.ts', Glob('*.cpp')) +qtEnv.Qm5('my_en','my_en') diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConstruct b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConstruct new file mode 100644 index 0000000..d9d897d --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConstruct @@ -0,0 +1,6 @@ +import qtenv + +qtEnv = qtenv.createQtEnvironment() +Export('qtEnv') +SConscript('SConscript') + diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/sconstest-noclean.py b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/sconstest-noclean.py new file mode 100644 index 0000000..69320b2 --- /dev/null +++ b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/sconstest-noclean.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python +# +# Copyright (c) 2001-2010,2011,2012 The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +""" +Tests that .ts files are not removed by default, +on a 'scons -c'. +""" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture("image") +test.file_fixture('../../qtenv.py') +test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') +test.run(stderr=None) + +test.must_exist(test.workpath('my_en.ts')) +test.must_contain(test.workpath('my_en.ts'),'SCons rocks!') +test.must_exist(test.workpath('my_en.qm')) + +test.run(options = '-c') + +test.must_exist(test.workpath('my_en.ts')) +test.must_not_exist(test.workpath('my_en.qm')) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: From 380db7a431f2a361d576823cc2aac70492192447 Mon Sep 17 00:00:00 2001 From: Jonathan Roy Date: Wed, 27 Jul 2016 11:38:29 -0400 Subject: [PATCH 10/12] Add a flag to enable or disable the Qt support --- tests/SConstruct | 29 ++++---- tests/test_pytest_cpp.py | 149 ++++++++++++++++++++++++--------------- 2 files changed, 108 insertions(+), 70 deletions(-) diff --git a/tests/SConstruct b/tests/SConstruct index c6b8d71..fb8578f 100644 --- a/tests/SConstruct +++ b/tests/SConstruct @@ -1,6 +1,8 @@ import os import sys +ENABLE_QT_TEST = True + if sys.platform.startswith('win'): CCFLAGS = ['/EHsc', '/nologo'] LIBS = [] @@ -18,17 +20,19 @@ env = Environment( # google test env genv = env.Clone(LIBS=['gtest'] + LIBS) -# qt5 env -QT5DIR = "/opt/Qt5.7.0/5.7/gcc_64" -qtenv = env.Clone(QT5DIR=QT5DIR, - CCFLAGS="-std=c++11 -fPIC", - tools=['default','qt5']) -qtenv['ENV']['PKG_CONFIG_PATH'] = os.path.join(QT5DIR, 'lib/pkgconfig') -qtenv.EnableQt5Modules([ - 'QtTest' - ]) +if ENABLE_QT_TEST: + # qt5 env + QT5DIR = "/opt/Qt5.7.0/5.7/gcc_64" + qtenv = env.Clone(QT5DIR=QT5DIR, + CCFLAGS="-std=c++11 -fPIC", + tools=['default','qt5']) + qtenv['ENV']['PKG_CONFIG_PATH'] = os.path.join(QT5DIR, 'lib/pkgconfig') + qtenv.EnableQt5Modules([ + 'QtTest' + ]) + Export('qtenv') -Export('env genv qtenv') +Export('env genv') # build google test target genv.Program('gtest.cpp') @@ -38,8 +42,9 @@ for filename in ('boost_success.cpp', 'boost_failure.cpp', 'boost_error.cpp'): env.Program(filename) # build qt5 target -for filename in ('qt_success.cpp', 'qt_failure.cpp', 'qt_error.cpp'): - qtenv.Program(filename) +if ENABLE_QT_TEST: + for filename in ('qt_success.cpp', 'qt_failure.cpp', 'qt_error.cpp'): + qtenv.Program(filename) SConscript('acceptance/googletest-samples/SConscript') SConscript('acceptance/boosttest-samples/SConscript') diff --git a/tests/test_pytest_cpp.py b/tests/test_pytest_cpp.py index f871ffa..bb19a0b 100644 --- a/tests/test_pytest_cpp.py +++ b/tests/test_pytest_cpp.py @@ -6,6 +6,8 @@ from pytest_cpp.google import GoogleTestFacade from pytest_cpp.qt import QTestLibFacade +ENABLE_QT_TEST = True + def assert_outcomes(result, expected_outcomes): __tracebackhide__ = True @@ -44,9 +46,6 @@ def get_file_reference(self): (BoostTestFacade(), 'boost_success', ['boost_success']), (BoostTestFacade(), 'boost_failure', ['boost_failure']), (BoostTestFacade(), 'boost_error', ['boost_error']), - (QTestLibFacade(), 'qt_success', ['qt_success']), - (QTestLibFacade(), 'qt_failure', ['qt_failure']), - (QTestLibFacade(), 'qt_error', ['qt_error']) ]) def test_list_tests(facade, name, expected, exes): obtained = facade.list_tests(exes.get(name)) @@ -56,7 +55,6 @@ def test_list_tests(facade, name, expected, exes): @pytest.mark.parametrize('facade, name, other_name', [ (GoogleTestFacade(), 'gtest', 'boost_success'), (BoostTestFacade(), 'boost_success', 'gtest'), - (QTestLibFacade(), 'qt_success', 'gtest'), ]) def test_is_test_suite(facade, name, other_name, exes, tmpdir): assert facade.is_test_suite(exes.get(name)) @@ -68,7 +66,6 @@ def test_is_test_suite(facade, name, other_name, exes, tmpdir): @pytest.mark.parametrize('facade, name, test_id', [ (GoogleTestFacade(), 'gtest', 'FooTest.test_success'), (BoostTestFacade(), 'boost_success', ''), - (QTestLibFacade(), 'qt_success', ''), ]) def test_success(facade, name, test_id, exes): assert facade.run_test(exes.get(name), test_id) is None @@ -141,29 +138,6 @@ def test_boost_error(exes): assert fail2.get_file_reference() == ("unknown location", 0) -def test_qt_failure(exes): - facade = QTestLibFacade() - failures = facade.run_test(exes.get('qt_failure'), '') - assert len(failures) == 2 - - fail1 = failures[0] - colors = ('red', 'bold') - assert fail1.get_lines() == [('Compared values are not the same', colors), (' Actual (2 * 3): 6', colors), (' Expected (5) : 5', colors)] - assert fail1.get_file_reference() == ('qt_failure.cpp', 13) - - -def test_qt_error(exes): - facade = QTestLibFacade() - failures = facade.run_test(exes.get('qt_error'), '') - assert len(failures) == 1 # qt abort at first unhandled exception - - fail1 = failures[0] - colors = ('red', 'bold') - - assert fail1.get_lines() == [ - ('Caught unhandled exception', colors)] - - def test_google_run(testdir, exes): result = testdir.inline_run('-v', exes.get('gtest', 'test_gtest')) assert_outcomes(result, [ @@ -241,29 +215,6 @@ def test_boost_internal_error(testdir, exes, mocker): assert 'Internal Error:' in str(rep.longrepr) -def test_qt_run(testdir, exes): - all_names = ['qt_success', 'qt_error', 'qt_failure'] - all_files = [exes.get(n, 'test_' + n) for n in all_names] - result = testdir.inline_run('-v', *all_files) - assert_outcomes(result, [ - ('test_qt_success', 'passed'), - ('test_qt_error', 'failed'), - ('test_qt_failure', 'failed'), - ]) - - -def test_qt_internal_error(testdir, exes, mocker): - exe = exes.get('qt_success', 'test_qt_success') - mock_popen(mocker, return_code=-10, stderr=None, stdout=None) - mocker.patch.object(QTestLibFacade, 'is_test_suite', return_value=True) - mocker.patch.object(GoogleTestFacade, 'is_test_suite', return_value=False) - mocker.patch.object(BoostTestFacade, 'is_test_suite', return_value=False) - result = testdir.inline_run(exe) - rep = result.matchreport(exes.exe_name('test_qt_success'), - 'pytest_runtest_logreport') - assert 'Internal Error:' in str(rep.longrepr) - - def test_cpp_failure_repr(dummy_failure): dummy_failure.lines = [('error message', {'red'})] dummy_failure.file_reference = 'test_suite', 20 @@ -274,7 +225,6 @@ def test_cpp_failure_repr(dummy_failure): def test_cpp_files_option(testdir, exes): exes.get('boost_success') exes.get('gtest') - exes.get('qt_success') result = testdir.inline_run('--collect-only') reps = result.getreports() @@ -283,12 +233,11 @@ def test_cpp_files_option(testdir, exes): testdir.makeini(''' [pytest] - cpp_files = gtest* boost* qt* + cpp_files = gtest* boost* ''') result = testdir.inline_run('--collect-only') assert len(result.matchreport(exes.exe_name('boost_success')).result) == 1 assert len(result.matchreport(exes.exe_name('gtest')).result) == 4 - assert len(result.matchreport(exes.exe_name('qt_success')).result) == 1 def test_passing_files_directly_in_command_line(testdir, exes): @@ -296,10 +245,6 @@ def test_passing_files_directly_in_command_line(testdir, exes): result_boost = testdir.runpytest(boost_exe) result_boost.stdout.fnmatch_lines(['*1 passed*']) - qt_exe = exes.get('qt_success') - result_qt = testdir.runpytest(qt_exe) - result_qt.stdout.fnmatch_lines(['*1 passed*']) - class TestError: @@ -324,3 +269,91 @@ def test_get_code_context_around_line(self, tmpdir): invalid = str(tmpdir.join('invalid')) assert error.get_code_context_around_line(invalid, 10) == [] + + +if ENABLE_QT_TEST: + @pytest.mark.parametrize('facade, name, expected', [ + (QTestLibFacade(), 'qt_success', ['qt_success']), + (QTestLibFacade(), 'qt_failure', ['qt_failure']), + (QTestLibFacade(), 'qt_error', ['qt_error']) + ]) + def test_qt_list_tests(facade, name, expected, exes): + obtained = facade.list_tests(exes.get(name)) + assert obtained == expected + + @pytest.mark.parametrize('facade, name, other_name', [ + (QTestLibFacade(), 'qt_success', 'gtest'), + ]) + def test_qt_is_test_suite(facade, name, other_name, exes, tmpdir): + assert facade.is_test_suite(exes.get(name)) + assert not facade.is_test_suite(exes.get(other_name)) + tmpdir.ensure('foo.txt') + assert not facade.is_test_suite(str(tmpdir.join('foo.txt'))) + + @pytest.mark.parametrize('facade, name, test_id', [ + (QTestLibFacade(), 'qt_success', ''), + ]) + def test_qt_success(facade, name, test_id, exes): + assert facade.run_test(exes.get(name), test_id) is None + + def test_qt_failure(exes): + facade = QTestLibFacade() + failures = facade.run_test(exes.get('qt_failure'), '') + assert len(failures) == 2 + + fail1 = failures[0] + colors = ('red', 'bold') + assert fail1.get_lines() == [('Compared values are not the same', colors), (' Actual (2 * 3): 6', colors), (' Expected (5) : 5', colors)] + assert fail1.get_file_reference() == ('qt_failure.cpp', 13) + + def test_qt_error(exes): + facade = QTestLibFacade() + failures = facade.run_test(exes.get('qt_error'), '') + assert len(failures) == 1 # qt abort at first unhandled exception + + fail1 = failures[0] + colors = ('red', 'bold') + + assert fail1.get_lines() == [ + ('Caught unhandled exception', colors)] + + def test_qt_run(testdir, exes): + all_names = ['qt_success', 'qt_error', 'qt_failure'] + all_files = [exes.get(n, 'test_' + n) for n in all_names] + result = testdir.inline_run('-v', *all_files) + assert_outcomes(result, [ + ('test_qt_success', 'passed'), + ('test_qt_error', 'failed'), + ('test_qt_failure', 'failed'), + ]) + + def test_qt_internal_error(testdir, exes, mocker): + exe = exes.get('qt_success', 'test_qt_success') + mock_popen(mocker, return_code=-10, stderr=None, stdout=None) + mocker.patch.object(QTestLibFacade, 'is_test_suite', return_value=True) + mocker.patch.object(GoogleTestFacade, 'is_test_suite', return_value=False) + mocker.patch.object(BoostTestFacade, 'is_test_suite', return_value=False) + result = testdir.inline_run(exe) + rep = result.matchreport(exes.exe_name('test_qt_success'), + 'pytest_runtest_logreport') + assert 'Internal Error:' in str(rep.longrepr) + + def test_qt_cpp_files_option(testdir, exes): + exes.get('qt_success') + + result = testdir.inline_run('--collect-only') + reps = result.getreports() + assert len(reps) == 1 + assert reps[0].result == [] + + testdir.makeini(''' + [pytest] + cpp_files = qt* + ''') + result = testdir.inline_run('--collect-only') + assert len(result.matchreport(exes.exe_name('qt_success')).result) == 1 + + def test_qt_passing_files_directly_in_command_line(testdir, exes): + qt_exe = exes.get('qt_success') + result_qt = testdir.runpytest(qt_exe) + result_qt.stdout.fnmatch_lines(['*1 passed*']) From a6721900e3ba0926c3fe08967cc4c8aa8da16037 Mon Sep 17 00:00:00 2001 From: Jonathan Roy Date: Wed, 27 Jul 2016 11:44:56 -0400 Subject: [PATCH 11/12] Set Qt support to False by default --- tests/SConstruct | 2 +- tests/test_pytest_cpp.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/SConstruct b/tests/SConstruct index fb8578f..779b64a 100644 --- a/tests/SConstruct +++ b/tests/SConstruct @@ -1,7 +1,7 @@ import os import sys -ENABLE_QT_TEST = True +ENABLE_QT_TEST = False if sys.platform.startswith('win'): CCFLAGS = ['/EHsc', '/nologo'] diff --git a/tests/test_pytest_cpp.py b/tests/test_pytest_cpp.py index bb19a0b..4595603 100644 --- a/tests/test_pytest_cpp.py +++ b/tests/test_pytest_cpp.py @@ -6,7 +6,7 @@ from pytest_cpp.google import GoogleTestFacade from pytest_cpp.qt import QTestLibFacade -ENABLE_QT_TEST = True +ENABLE_QT_TEST = False def assert_outcomes(result, expected_outcomes): From c535bb174a81125f1dde0596979f49e483f523b6 Mon Sep 17 00:00:00 2001 From: Jonathan Roy Date: Wed, 27 Jul 2016 14:05:31 -0400 Subject: [PATCH 12/12] Remove Scons qt 5 from repo and add a quick doc in the tests itself to explain how to install it --- tests/SConstruct | 5 + tests/site_scons/site_tools/qt5/README.rst | 351 ------ tests/site_scons/site_tools/qt5/__init__.py | 1004 ----------------- .../site_scons/site_tools/qt5/docs/SConstruct | 34 - tests/site_scons/site_tools/qt5/docs/html.xsl | 55 - .../site_scons/site_tools/qt5/docs/manual.xml | 388 ------- tests/site_scons/site_tools/qt5/docs/pdf.xsl | 62 - tests/site_scons/site_tools/qt5/docs/qt5.xml | 600 ---------- .../site_tools/qt5/docs/reference.xml | 717 ------------ .../site_scons/site_tools/qt5/docs/scons.css | 263 ----- .../CPPPATH/CPPPATH-appended/SConscript-after | 6 - .../CPPPATH-appended/SConscript-before | 5 - .../CPPPATH/CPPPATH-appended/image/SConscript | 2 - .../CPPPATH/CPPPATH-appended/image/SConstruct | 6 - .../CPPPATH-appended/image/sub/aaa.cpp | 13 - .../CPPPATH/CPPPATH-appended/image/sub/aaa.h | 12 - .../image/sub/local_include/local_include.h | 3 - .../sconstest-CPPPATH-appended-fail.py | 56 - .../sconstest-CPPPATH-appended.py | 54 - .../basic/CPPPATH/CPPPATH/SConscript-after | 3 - .../basic/CPPPATH/CPPPATH/SConscript-before | 3 - .../basic/CPPPATH/CPPPATH/image/SConstruct | 6 - .../test/basic/CPPPATH/CPPPATH/image/aaa.cpp | 13 - .../test/basic/CPPPATH/CPPPATH/image/aaa.h | 12 - .../image/local_include/local_include.h | 2 - .../CPPPATH/CPPPATH/sconstest-CPPPATH-fail.py | 54 - .../CPPPATH/CPPPATH/sconstest-CPPPATH.py | 53 - .../test/basic/copied-env/image/MyFile.cpp | 5 - .../qt5/test/basic/copied-env/image/MyFile.h | 2 - .../test/basic/copied-env/image/SConscript | 11 - .../test/basic/copied-env/image/SConstruct | 6 - .../basic/copied-env/sconstest-copied-env.py | 52 - .../qt5/test/basic/empty-env/image/SConstruct | 4 - .../qt5/test/basic/empty-env/image/foo6.h | 8 - .../qt5/test/basic/empty-env/image/main.cpp | 3 - .../basic/empty-env/sconstest-empty-env.py | 47 - .../qt5/test/basic/manual/image/SConscript | 20 - .../qt5/test/basic/manual/image/SConstruct | 6 - .../qt5/test/basic/manual/image/aaa.cpp | 2 - .../qt5/test/basic/manual/image/bbb.cpp | 18 - .../qt5/test/basic/manual/image/bbb.h | 2 - .../qt5/test/basic/manual/image/ddd.cpp | 2 - .../qt5/test/basic/manual/image/eee.cpp | 16 - .../qt5/test/basic/manual/image/eee.h | 2 - .../qt5/test/basic/manual/image/fff.cpp | 1 - .../qt5/test/basic/manual/image/include/aaa.h | 9 - .../qt5/test/basic/manual/image/include/ddd.h | 9 - .../qt5/test/basic/manual/image/main.cpp | 17 - .../qt5/test/basic/manual/image/ui/ccc.h | 9 - .../qt5/test/basic/manual/image/ui/ccc.ui | 19 - .../qt5/test/basic/manual/image/ui/fff.ui | 19 - .../qt5/test/basic/manual/sconstest-manual.py | 57 - .../test/basic/moc-from-cpp/image/SConscript | 7 - .../test/basic/moc-from-cpp/image/SConstruct | 24 - .../qt5/test/basic/moc-from-cpp/image/aaa.cpp | 18 - .../qt5/test/basic/moc-from-cpp/image/aaa.h | 2 - .../test/basic/moc-from-cpp/image/useit.cpp | 4 - .../moc-from-cpp/sconstest-moc-from-cpp.py | 91 -- .../image/SConscript | 8 - .../image/SConstruct | 24 - .../moc-from-header-nocompile/image/aaa.cpp | 7 - .../moc-from-header-nocompile/image/aaa.h | 9 - .../sconstest-moc-from-header-nocompile.py | 88 -- .../basic/moc-from-header/image/SConscript | 6 - .../basic/moc-from-header/image/SConstruct | 24 - .../test/basic/moc-from-header/image/aaa.cpp | 7 - .../test/basic/moc-from-header/image/aaa.h | 9 - .../sconstest-moc-from-header.py | 77 -- .../qt5/test/basic/reentrant/image/SConscript | 4 - .../qt5/test/basic/reentrant/image/SConstruct | 6 - .../qt5/test/basic/reentrant/image/foo5.h | 8 - .../qt5/test/basic/reentrant/image/main.cpp | 7 - .../basic/reentrant/sconstest-reentrant.py | 46 - .../test/basic/variantdir/image/MyForm.cpp | 14 - .../qt5/test/basic/variantdir/image/MyForm.h | 18 - .../test/basic/variantdir/image/SConstruct | 12 - .../test/basic/variantdir/image/anUiFile.ui | 19 - .../qt5/test/basic/variantdir/image/main.cpp | 17 - .../basic/variantdir/image/mocFromCpp.cpp | 16 - .../test/basic/variantdir/image/mocFromCpp.h | 2 - .../test/basic/variantdir/image/mocFromH.cpp | 8 - .../test/basic/variantdir/image/mocFromH.h | 11 - .../basic/variantdir/sconstest-installed.py | 47 - .../test/moc/auto/ccomment/image/SConscript | 9 - .../test/moc/auto/ccomment/image/SConstruct | 6 - .../qt5/test/moc/auto/ccomment/image/main.cpp | 14 - .../moc/auto/ccomment/image/mocFromCpp.cpp | 41 - .../test/moc/auto/ccomment/image/mocFromCpp.h | 2 - .../test/moc/auto/ccomment/image/mocFromH.cpp | 10 - .../test/moc/auto/ccomment/image/mocFromH.h | 32 - .../moc/auto/ccomment/sconstest-ccomment.py | 46 - .../moc/auto/literalstring/image/SConscript | 6 - .../moc/auto/literalstring/image/SConstruct | 6 - .../moc/auto/literalstring/image/main.cpp | 14 - .../auto/literalstring/image/mocFromCpp.cpp | 27 - .../moc/auto/literalstring/image/mocFromCpp.h | 2 - .../moc/auto/literalstring/image/mocFromH.cpp | 10 - .../moc/auto/literalstring/image/mocFromH.h | 21 - .../literalstring/sconstest-literalstring.py | 45 - .../qt5/test/moc/cpppath/default/SConscript | 8 - .../test/moc/cpppath/default/SConscript-fails | 9 - .../test/moc/cpppath/default/image/SConstruct | 6 - .../default/image/include/mocFromCpp.h | 1 - .../cpppath/default/image/include/mocFromH.h | 11 - .../moc/cpppath/default/image/src/main.cpp | 14 - .../cpppath/default/image/src/mocFromCpp.cpp | 15 - .../cpppath/default/image/src/mocFromH.cpp | 10 - .../default/sconstest-default-fails.py | 46 - .../moc/cpppath/default/sconstest-default.py | 46 - .../qt5/test/moc/cpppath/specific/SConscript | 9 - .../moc/cpppath/specific/SConscript-fails | 9 - .../moc/cpppath/specific/image/SConstruct | 6 - .../specific/image/include/mocFromCpp.h | 1 - .../cpppath/specific/image/include/mocFromH.h | 11 - .../moc/cpppath/specific/image/src/main.cpp | 14 - .../cpppath/specific/image/src/mocFromCpp.cpp | 15 - .../cpppath/specific/image/src/mocFromH.cpp | 10 - .../specific/sconstest-specific-fails.py | 49 - .../cpppath/specific/sconstest-specific.py | 48 - .../qt5/test/moc/explicit/image/SConscript | 10 - .../qt5/test/moc/explicit/image/SConstruct | 6 - .../qt5/test/moc/explicit/image/main.cpp | 14 - .../test/moc/explicit/image/mocFromCpp.cpp | 16 - .../qt5/test/moc/explicit/image/mocFromCpp.h | 2 - .../qt5/test/moc/explicit/image/mocFromH.cpp | 8 - .../qt5/test/moc/explicit/image/mocFromH.h | 11 - .../test/moc/explicit/sconstest-explicit.py | 45 - .../moc/order_independent/image/SConscript | 12 - .../moc/order_independent/image/SConstruct | 25 - .../test/moc/order_independent/image/aaa.cpp | 7 - .../test/moc/order_independent/image/aaa.h | 9 - .../test/moc/order_independent/image/bbb.cpp | 4 - .../sconstest-order-independent.py | 46 - .../site_tools/qt5/test/qrc/basic/SConscript | 8 - .../qt5/test/qrc/basic/SConscript-wflags | 9 - .../qt5/test/qrc/basic/image/SConstruct | 6 - .../qt5/test/qrc/basic/image/icons.qrc | 5 - .../qt5/test/qrc/basic/image/icons/scons.png | Bin 1613 -> 0 bytes .../qt5/test/qrc/basic/image/main.cpp | 11 - .../qt5/test/qrc/basic/sconstest-basic.py | 45 - .../test/qrc/basic/sconstest-basicwflags.py | 45 - .../site_tools/qt5/test/qrc/manual/SConscript | 9 - .../qt5/test/qrc/manual/SConscript-wflags | 11 - .../qt5/test/qrc/manual/image/SConstruct | 6 - .../qt5/test/qrc/manual/image/icons.qrc | 5 - .../qt5/test/qrc/manual/image/icons/scons.png | Bin 1613 -> 0 bytes .../qt5/test/qrc/manual/image/main.cpp | 11 - .../qt5/test/qrc/manual/sconstest-manual.py | 45 - .../test/qrc/manual/sconstest-manualwflags.py | 45 - .../qt5/test/qrc/multifiles/SConscript | 8 - .../qt5/test/qrc/multifiles/SConscript-manual | 9 - .../qt5/test/qrc/multifiles/image/SConstruct | 6 - .../qt5/test/qrc/multifiles/image/icons.qrc | 5 - .../test/qrc/multifiles/image/icons/scons.png | Bin 1613 -> 0 bytes .../qt5/test/qrc/multifiles/image/main.cpp | 12 - .../qt5/test/qrc/multifiles/image/other.qrc | 5 - .../test/qrc/multifiles/image/other/rocks.png | Bin 1613 -> 0 bytes .../multifiles/sconstest-multifiles-manual.py | 45 - .../qrc/multifiles/sconstest-multifiles.py | 46 - .../qt5/test/qrc/othername/image/SConscript | 11 - .../qt5/test/qrc/othername/image/SConstruct | 6 - .../qt5/test/qrc/othername/image/icons.qrc | 5 - .../test/qrc/othername/image/icons/scons.png | Bin 1613 -> 0 bytes .../qt5/test/qrc/othername/image/main.cpp | 11 - .../test/qrc/othername/sconstest-othername.py | 45 - .../test/qrc/samefilename/image/SConscript | 8 - .../test/qrc/samefilename/image/SConstruct | 6 - .../qt5/test/qrc/samefilename/image/icons.cpp | 11 - .../qt5/test/qrc/samefilename/image/icons.qrc | 5 - .../qrc/samefilename/image/icons/scons.png | Bin 1613 -> 0 bytes .../samefilename/sconstest-samefilename.py | 46 - .../qt5/test/qrc/subdir/image/SConscript | 8 - .../qt5/test/qrc/subdir/image/SConstruct | 6 - .../qt5/test/qrc/subdir/image/main.cpp | 11 - .../qt5/test/qrc/subdir/image/qrc/icons.qrc | 5 - .../test/qrc/subdir/image/qrc/icons/scons.png | Bin 1613 -> 0 bytes .../qt5/test/qrc/subdir/sconstest-subdir.py | 46 - .../test/qt_examples/create_scons_tests.py | 748 ------------ .../qt5/test/qt_examples/sconstest.skip | 0 tests/site_scons/site_tools/qt5/test/qtenv.py | 107 -- .../site_tools/qt5/test/sconstest.skip | 0 .../qt5/test/ts_qm/clean/image/MyFile.cpp | 7 - .../qt5/test/ts_qm/clean/image/MyFile.h | 13 - .../qt5/test/ts_qm/clean/image/SConscript | 6 - .../qt5/test/ts_qm/clean/image/SConstruct | 6 - .../qt5/test/ts_qm/clean/sconstest-clean.py | 54 - .../qt5/test/ts_qm/mixdir/image/MyFile.cpp | 7 - .../qt5/test/ts_qm/mixdir/image/MyFile.h | 13 - .../qt5/test/ts_qm/mixdir/image/SConscript | 3 - .../qt5/test/ts_qm/mixdir/image/SConstruct | 6 - .../test/ts_qm/mixdir/image/subdir/bbb.cpp | 6 - .../qt5/test/ts_qm/mixdir/image/subdir/bbb.h | 13 - .../qt5/test/ts_qm/mixdir/sconstest-mixdir.py | 49 - .../test/ts_qm/multisource/image/MyFile.cpp | 7 - .../qt5/test/ts_qm/multisource/image/MyFile.h | 13 - .../test/ts_qm/multisource/image/SConscript | 6 - .../test/ts_qm/multisource/image/SConstruct | 6 - .../qt5/test/ts_qm/multisource/image/bbb.cpp | 6 - .../qt5/test/ts_qm/multisource/image/bbb.h | 13 - .../multisource/sconstest-multisource.py | 61 - .../test/ts_qm/multitarget/image/MyFile.cpp | 7 - .../qt5/test/ts_qm/multitarget/image/MyFile.h | 13 - .../test/ts_qm/multitarget/image/SConscript | 4 - .../test/ts_qm/multitarget/image/SConstruct | 6 - .../multitarget/sconstest-multitarget.py | 59 - .../qt5/test/ts_qm/noclean/image/MyFile.cpp | 7 - .../qt5/test/ts_qm/noclean/image/MyFile.h | 13 - .../qt5/test/ts_qm/noclean/image/SConscript | 4 - .../qt5/test/ts_qm/noclean/image/SConstruct | 6 - .../test/ts_qm/noclean/sconstest-noclean.py | 54 - tests/test_pytest_cpp.py | 3 + 211 files changed, 8 insertions(+), 7557 deletions(-) delete mode 100644 tests/site_scons/site_tools/qt5/README.rst delete mode 100644 tests/site_scons/site_tools/qt5/__init__.py delete mode 100644 tests/site_scons/site_tools/qt5/docs/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/docs/html.xsl delete mode 100644 tests/site_scons/site_tools/qt5/docs/manual.xml delete mode 100644 tests/site_scons/site_tools/qt5/docs/pdf.xsl delete mode 100644 tests/site_scons/site_tools/qt5/docs/qt5.xml delete mode 100644 tests/site_scons/site_tools/qt5/docs/reference.xml delete mode 100644 tests/site_scons/site_tools/qt5/docs/scons.css delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-after delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-before delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.h delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/local_include/local_include.h delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended-fail.py delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended.py delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-after delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-before delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.h delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/local_include/local_include.h delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH-fail.py delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH.py delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.h delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/copied-env/sconstest-copied-env.py delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/empty-env/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/empty-env/image/foo6.h delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/empty-env/image/main.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/empty-env/sconstest-empty-env.py delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/SConscript delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/SConstruct delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/aaa.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.h delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/ddd.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.h delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/fff.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/include/aaa.h delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/include/ddd.h delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/main.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.h delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.ui delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/fff.ui delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/manual/sconstest-manual.py delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConscript delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConstruct delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.h delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/useit.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/sconstest-moc-from-cpp.py delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConscript delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.h delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/sconstest-moc-from-header-nocompile.py delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConscript delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.h delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/moc-from-header/sconstest-moc-from-header.py delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConscript delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/reentrant/image/foo5.h delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/reentrant/image/main.cpp delete mode 100755 tests/site_scons/site_tools/qt5/test/basic/reentrant/sconstest-reentrant.py delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.h delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/anUiFile.ui delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/main.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.h delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.h delete mode 100644 tests/site_scons/site_tools/qt5/test/basic/variantdir/sconstest-installed.py delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/main.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.h delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.h delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/sconstest-ccomment.py delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/main.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.h delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.h delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/sconstest-literalstring.py delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript-fails delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromCpp.h delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromH.h delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/main.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromCpp.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromH.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default-fails.py delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default.py delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript-fails delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromCpp.h delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromH.h delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/main.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromCpp.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromH.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific-fails.py delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific.py delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/main.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.h delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.h delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/explicit/sconstest-explicit.py delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.h delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/image/bbb.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/moc/order_independent/sconstest-order-independent.py delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript-wflags delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons.qrc delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons/scons.png delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/image/main.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basic.py delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basicwflags.py delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript-wflags delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons.qrc delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons/scons.png delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/image/main.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manual.py delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manualwflags.py delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript-manual delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons.qrc delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons/scons.png delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/main.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other.qrc delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other/rocks.png delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles-manual.py delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles.py delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons.qrc delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons/scons.png delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/image/main.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/othername/sconstest-othername.py delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.qrc delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons/scons.png delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/samefilename/sconstest-samefilename.py delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/image/main.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons.qrc delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons/scons.png delete mode 100644 tests/site_scons/site_tools/qt5/test/qrc/subdir/sconstest-subdir.py delete mode 100644 tests/site_scons/site_tools/qt5/test/qt_examples/create_scons_tests.py delete mode 100644 tests/site_scons/site_tools/qt5/test/qt_examples/sconstest.skip delete mode 100644 tests/site_scons/site_tools/qt5/test/qtenv.py delete mode 100644 tests/site_scons/site_tools/qt5/test/sconstest.skip delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.h delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/clean/sconstest-clean.py delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.h delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.h delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/sconstest-mixdir.py delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.h delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.h delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multisource/sconstest-multisource.py delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.h delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/sconstest-multitarget.py delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.cpp delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.h delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConscript delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConstruct delete mode 100644 tests/site_scons/site_tools/qt5/test/ts_qm/noclean/sconstest-noclean.py diff --git a/tests/SConstruct b/tests/SConstruct index 779b64a..9944beb 100644 --- a/tests/SConstruct +++ b/tests/SConstruct @@ -1,6 +1,11 @@ import os import sys +# In order to build the tests for QT, you need to: +# - Download and install qt from https://www.qt.io/download/ +# - Set the QT5DIR variable below +# - Install the Scons Qt5 tools from https://bitbucket.org/dirkbaechle/scons_qt5 +# First install option worked for me (installing it directly in the pytest-cpp/tests directory) ENABLE_QT_TEST = False if sys.platform.startswith('win'): diff --git a/tests/site_scons/site_tools/qt5/README.rst b/tests/site_scons/site_tools/qt5/README.rst deleted file mode 100644 index b9f8e27..0000000 --- a/tests/site_scons/site_tools/qt5/README.rst +++ /dev/null @@ -1,351 +0,0 @@ -#################################### -The SCons qt5 tool -#################################### - -Basics -====== -This tool can be used to compile Qt projects, designed for versions 5.x.y and higher. -It is not usable for Qt3 and older versions, since some of the helper tools -(``moc``, ``uic``) behave different. - -Install -------- -Installing it, requires you to copy (or, even better: checkout) the contents of the -package's ``qt5`` folder to - -#. "``/path_to_your_project/site_scons/site_tools/qt5``", if you need the Qt5 Tool in one project only, or -#. "``~/.scons/site_scons/site_tools/qt5``", for a system-wide installation under your current login. - -For more infos about this, please refer to - -* the SCons User's Guide, sect. "Where to put your custom Builders and Tools" and -* the SCons Tools Wiki page at `http://scons.org/wiki/ToolsIndex `_. - -How to activate ---------------- -For activating the tool "qt5", you have to add its name to the Environment constructor, -like this - -:: - - env = Environment(tools=['default','qt5']) - - -On its startup, the Qt5 tool tries to read the variable ``QT5DIR`` from the current -Environment and ``os.environ``. If it is not set, the value of ``QTDIR`` (in -Environment/``os.environ``) is used as a fallback. - -So, you either have to explicitly give the path of your Qt5 installation to the -Environment with - -:: - - env['QT5DIR'] = '/usr/local/Trolltech/Qt-5.2.3' - - -or set the ``QT5DIR`` as environment variable in your shell. - - -Requirements ------------- -Under Linux, "qt5" uses the system tool ``pkg-config`` for automatically -setting the required compile and link flags of the single Qt5 modules (like QtCore, -QtGui,...). -This means that - -#. you should have ``pkg-config`` installed, and -#. you additionally have to set ``PKG_CONFIG_PATH`` in your shell environment, such - that it points to $``QT5DIR/lib/pkgconfig`` (or $``QT5DIR/lib`` for some older versions). - -Based on these two environment variables (``QT5DIR`` and ``PKG_CONFIG_PATH``), -the "qt5" tool initializes all ``QT5_*`` -construction variables listed in the Reference manual. This happens when the tool -is "detected" during Environment construction. As a consequence, the setup -of the tool gets a two-stage process, if you want to override the values provided -by your current shell settings: - -:: - - # Stage 1: create plain environment - qtEnv = Environment() - # Set new vars - qtEnv['QT5DIR'] = '/usr/local/Trolltech/Qt-5.2.3 - qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-5.2.3/lib/pkgconfig' - # Stage 2: add qt5 tool - qtEnv.Tool('qt5') - - - - -Suggested boilerplate -===================== -Based on the requirements above, we suggest a simple ready-to-go setup -as follows: - -SConstruct - -:: - - # Detect Qt version - qtdir = detectLatestQtDir() - - # Create base environment - baseEnv = Environment() - #...further customization of base env - - # Clone Qt environment - qtEnv = baseEnv.Clone() - # Set QT5DIR and PKG_CONFIG_PATH - qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') - qtEnv['QT5DIR'] = qtdir - # Add qt5 tool - qtEnv.Tool('qt5') - #...further customization of qt env - - # Export environments - Export('baseEnv qtEnv') - - # Your other stuff... - # ...including the call to your SConscripts - - -In a SConscript - -:: - - # Get the Qt5 environment - Import('qtEnv') - # Clone it - env = qtEnv.clone() - # Patch it - env.Append(CCFLAGS=['-m32']) # or whatever - # Use it - env.StaticLibrary('foo', Glob('*.cpp')) - - -The detection of the Qt directory could be as simple as directly assigning -a fixed path - -:: - - def detectLatestQtDir(): - return "/usr/local/qt5.3.2" - - -or a little more sophisticated - -:: - - # Tries to detect the path to the installation of Qt with - # the highest version number - def detectLatestQtDir(): - if sys.platform.startswith("linux"): - # Simple check: inspect only '/usr/local/Trolltech' - paths = glob.glob('/usr/local/Trolltech/*') - if len(paths): - paths.sort() - return paths[-1] - else: - return "" - else: - # Simple check: inspect only 'C:\Qt' - paths = glob.glob('C:\\Qt\\*') - if len(paths): - paths.sort() - return paths[-1] - else: - return os.environ.get("QTDIR","") - - - -A first project -=============== -The following SConscript is for a simple project with -some cxx files, using the QtCore, QtGui -and QtNetwork modules: - -:: - - Import('qtEnv') - env = qtEnv.Clone() - env.EnableQt5Modules([ - 'QtGui', - 'QtCore', - 'QtNetwork' - ]) - # Add your CCFLAGS and CPPPATHs to env here... - - env.Program('foo', Glob('*.cpp')) - - - -MOC it up -========= -For the basic support of automocing, nothing needs to be -done by the user. The tool usually detects the ``Q_OBJECT`` -macro and calls the "``moc``" executable accordingly. - -If you don't want this, you can switch off the automocing -by a - -:: - - env['QT5_AUTOSCAN'] = 0 - - -in your SConscript file. Then, you have to moc your files -explicitly, using the Moc5 builder. - -You can also switch to an extended automoc strategy with - -:: - - env['QT5_AUTOSCAN_STRATEGY'] = 1 - - -Please read the description of the ``QT5_AUTOSCAN_STRATEGY`` -variable in the Reference manual for details. - -For debugging purposes, you can set the variable ``QT5_DEBUG`` -with - -:: - - env['QT5_DEBUG'] = 1 - - -which outputs a lot of messages during automocing. - - -Forms (.ui) -=========== -The header files with setup code for your GUI classes, are not -compiled automatically from your ``.ui`` files. You always -have to call the Uic5 builder explicitly like - -:: - - env.Uic5(Glob('*.ui')) - env.Program('foo', Glob('*.cpp')) - - - -Resource files (.qrc) -===================== -Resource files are not built automatically, you always -have to add the names of the ``.qrc`` files to the source list -for your program or library: - -:: - - env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) - - -For each of the Resource input files, its prefix defines the -name of the resulting resource. An appropriate "``-name``" option -is added to the call of the ``rcc`` executable -by default. - -You can also call the Qrc5 builder explicitly as - -:: - - qrccc = env.Qrc5('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] - - -or (overriding the default suffix) - -:: - - qrccc = env.Qrc5('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] - - -and then add the resulting cxx file to the sources of your -Program/Library: - -:: - - env.Program('foo', Glob('*.cpp') + qrccc) - - - -Translation files -================= -The update of the ``.ts`` files and the conversion to binary -``.qm`` files is not done automatically. You have to call the -corresponding builders on your own. - -Example for updating a translation file: - -:: - - env.Ts5('foo.ts','.') # -> ['foo.ts'] - - -By default, the ``.ts`` files are treated as *precious* targets. This means that -they are not removed prior to a rebuild, but simply get updated. Additionally, they -do not get cleaned on a "``scons -c``". If you want to delete the translation files -on the "``-c``" SCons command, you can set the variable "``QT5_CLEAN_TS``" like this - -:: - - env['QT5_CLEAN_TS']=1 - - -Example for releasing a translation file, i.e. compiling -it to a ``.qm`` binary file: - -:: - - env.Qm5('foo') # ['foo.ts'] -> ['foo.qm'] - - -or (overriding the output prefix) - -:: - - env.Qm5('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] - - -As an extension both, the Ts5() and Qm5 builder, support the definition of -multiple targets. So, calling - -:: - - env.Ts5(['app_en','app_de'], Glob('*.cpp')) - - -and - -:: - - env.Qm5(['app','copy'], Glob('*.ts')) - - -should work fine. - -Finally, two short notes about the support of directories for the Ts5() builder. You can -pass an arbitrary mix of cxx files and subdirs to it, as in - -:: - - env.Ts5('app_en',['sub1','appwindow.cpp','main.cpp'])) - - -where ``sub1`` is a folder that gets scanned recursively for cxx files by ``lupdate``. -But like this, you lose all dependency information for the subdir, i.e. if a file -inside the folder changes, the .ts file is not updated automatically! In this case -you should tell SCons to always update the target: - -:: - - ts = env.Ts5('app_en',['sub1','appwindow.cpp','main.cpp']) - env.AlwaysBuild(ts) - - -Last note: specifying the current folder "``.``" as input to Ts5() and storing the resulting -.ts file in the same directory, leads to a dependency cycle! You then have to store the .ts -and .qm files outside of the current folder, or use ``Glob('*.cpp'))`` instead. - - - diff --git a/tests/site_scons/site_tools/qt5/__init__.py b/tests/site_scons/site_tools/qt5/__init__.py deleted file mode 100644 index 46db788..0000000 --- a/tests/site_scons/site_tools/qt5/__init__.py +++ /dev/null @@ -1,1004 +0,0 @@ - -"""SCons.Tool.qt5 - -Tool-specific initialization for Qt5. - -There normally shouldn't be any need to import this module directly. -It will usually be imported through the generic SCons.Tool.Tool() -selection method. - -""" - -# -# Copyright (c) 2001-7,2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -import os.path -import re - -import SCons.Action -import SCons.Builder -import SCons.Defaults -import SCons.Scanner -import SCons.Tool -import SCons.Util - -class ToolQt5Warning(SCons.Warnings.Warning): - pass - -class GeneratedMocFileNotIncluded(ToolQt5Warning): - pass - -class QtdirNotFound(ToolQt5Warning): - pass - -SCons.Warnings.enableWarningClass(ToolQt5Warning) - -try: - sorted -except NameError: - # Pre-2.4 Python has no sorted() function. - # - # The pre-2.4 Python list.sort() method does not support - # list.sort(key=) nor list.sort(reverse=) keyword arguments, so - # we must implement the functionality of those keyword arguments - # by hand instead of passing them to list.sort(). - def sorted(iterable, cmp=None, key=None, reverse=0): - if key is not None: - result = [(key(x), x) for x in iterable] - else: - result = iterable[:] - if cmp is None: - # Pre-2.3 Python does not support list.sort(None). - result.sort() - else: - result.sort(cmp) - if key is not None: - result = [t1 for t0,t1 in result] - if reverse: - result.reverse() - return result - -qrcinclude_re = re.compile(r']*>([^<]*)', re.M) - -mocver_re = re.compile(r'.*(\d+)\.(\d+)\.(\d+).*') - -def transformToWinePath(path) : - return os.popen('winepath -w "%s"'%path).read().strip().replace('\\','/') - -header_extensions = [".h", ".hxx", ".hpp", ".hh"] -if SCons.Util.case_sensitive_suffixes('.h', '.H'): - header_extensions.append('.H') -# TODO: The following two lines will work when integrated back to SCons -# TODO: Meanwhile the third line will do the work -#cplusplus = __import__('c++', globals(), locals(), []) -#cxx_suffixes = cplusplus.CXXSuffixes -cxx_suffixes = [".c", ".cxx", ".cpp", ".cc"] - -def checkMocIncluded(target, source, env): - moc = target[0] - cpp = source[0] - # looks like cpp.includes is cleared before the build stage :-( - # not really sure about the path transformations (moc.cwd? cpp.cwd?) :-/ - path = SCons.Defaults.CScan.path_function(env, moc.cwd) - includes = SCons.Defaults.CScan(cpp, env, path) - if not moc in includes: - SCons.Warnings.warn( - GeneratedMocFileNotIncluded, - "Generated moc file '%s' is not included by '%s'" % - (str(moc), str(cpp))) - -def find_file(filename, paths, node_factory): - for dir in paths: - node = node_factory(filename, dir) - if node.rexists(): - return node - return None - -class _Automoc: - """ - Callable class, which works as an emitter for Programs, SharedLibraries and - StaticLibraries. - """ - - def __init__(self, objBuilderName): - self.objBuilderName = objBuilderName - # some regular expressions: - # Q_OBJECT detection - self.qo_search = re.compile(r'[^A-Za-z0-9]Q_OBJECT[^A-Za-z0-9]') - # cxx and c comment 'eater' - self.ccomment = re.compile(r'/\*(.*?)\*/',re.S) - self.cxxcomment = re.compile(r'//.*$',re.M) - # we also allow Q_OBJECT in a literal string - self.literal_qobject = re.compile(r'"[^\n]*Q_OBJECT[^\n]*"') - - def create_automoc_options(self, env): - """ - Create a dictionary with variables related to Automocing, - based on the current environment. - Is executed once in the __call__ routine. - """ - moc_options = {'auto_scan' : True, - 'auto_scan_strategy' : 0, - 'gobble_comments' : 0, - 'debug' : 0, - 'auto_cpppath' : True, - 'cpppaths' : []} - try: - if int(env.subst('$QT5_AUTOSCAN')) == 0: - moc_options['auto_scan'] = False - except ValueError: - pass - try: - moc_options['auto_scan_strategy'] = int(env.subst('$QT5_AUTOSCAN_STRATEGY')) - except ValueError: - pass - try: - moc_options['gobble_comments'] = int(env.subst('$QT5_GOBBLECOMMENTS')) - except ValueError: - pass - try: - moc_options['debug'] = int(env.subst('$QT5_DEBUG')) - except ValueError: - pass - try: - if int(env.subst('$QT5_AUTOMOC_SCANCPPPATH')) == 0: - moc_options['auto_cpppath'] = False - except ValueError: - pass - if moc_options['auto_cpppath']: - paths = env.get('QT5_AUTOMOC_CPPPATH', []) - if not paths: - paths = env.get('CPPPATH', []) - moc_options['cpppaths'].extend(paths) - - return moc_options - - def __automoc_strategy_simple(self, env, moc_options, - cpp, cpp_contents, out_sources): - """ - Default Automoc strategy (Q_OBJECT driven): detect a header file - (alongside the current cpp/cxx) that contains a Q_OBJECT - macro...and MOC it. - If a Q_OBJECT macro is also found in the cpp/cxx itself, - it gets MOCed too. - """ - - h=None - for h_ext in header_extensions: - # try to find the header file in the corresponding source - # directory - hname = self.splitext(cpp.name)[0] + h_ext - h = find_file(hname, [cpp.get_dir()]+moc_options['cpppaths'], env.File) - if h: - if moc_options['debug']: - print "scons: qt5: Scanning '%s' (header of '%s')" % (str(h), str(cpp)) - h_contents = h.get_contents() - if moc_options['gobble_comments']: - h_contents = self.ccomment.sub('', h_contents) - h_contents = self.cxxcomment.sub('', h_contents) - h_contents = self.literal_qobject.sub('""', h_contents) - break - if not h and moc_options['debug']: - print "scons: qt5: no header for '%s'." % (str(cpp)) - if h and self.qo_search.search(h_contents): - # h file with the Q_OBJECT macro found -> add moc_cpp - moc_cpp = env.Moc5(h) - if moc_options['debug']: - print "scons: qt5: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp)) - - # Now, check whether the corresponding CPP file - # includes the moc'ed output directly... - inc_moc_cpp = r'^\s*#\s*include\s+"%s"' % str(moc_cpp[0]) - if cpp and re.search(inc_moc_cpp, cpp_contents, re.M): - if moc_options['debug']: - print "scons: qt5: CXX file '%s' directly includes the moc'ed output '%s', no compiling required" % (str(cpp), str(moc_cpp)) - env.Depends(cpp, moc_cpp) - else: - moc_o = self.objBuilder(moc_cpp) - if moc_options['debug']: - print "scons: qt5: compiling '%s' to '%s'" % (str(cpp), str(moc_o)) - out_sources.extend(moc_o) - if cpp and self.qo_search.search(cpp_contents): - # cpp file with Q_OBJECT macro found -> add moc - # (to be included in cpp) - moc = env.Moc5(cpp) - env.Ignore(moc, moc) - if moc_options['debug']: - print "scons: qt5: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(cpp), str(moc)) - - def __automoc_strategy_include_driven(self, env, moc_options, - cpp, cpp_contents, out_sources): - """ - Automoc strategy #1 (include driven): searches for "include" - statements of MOCed files in the current cpp/cxx file. - This strategy tries to add support for the compilation - of the qtsolutions... - """ - if self.splitext(str(cpp))[1] in cxx_suffixes: - added = False - h_moc = "%s%s%s" % (env.subst('$QT5_XMOCHPREFIX'), - self.splitext(cpp.name)[0], - env.subst('$QT5_XMOCHSUFFIX')) - cxx_moc = "%s%s%s" % (env.subst('$QT5_XMOCCXXPREFIX'), - self.splitext(cpp.name)[0], - env.subst('$QT5_XMOCCXXSUFFIX')) - inc_h_moc = r'#include\s+"%s"' % h_moc - inc_cxx_moc = r'#include\s+"%s"' % cxx_moc - - # Search for special includes in qtsolutions style - if cpp and re.search(inc_h_moc, cpp_contents): - # cpp file with #include directive for a MOCed header found -> add moc - - # Try to find header file - h=None - hname="" - for h_ext in header_extensions: - # Try to find the header file in the - # corresponding source directory - hname = self.splitext(cpp.name)[0] + h_ext - h = find_file(hname, [cpp.get_dir()]+moc_options['cpppaths'], env.File) - if h: - if moc_options['debug']: - print "scons: qt5: Scanning '%s' (header of '%s')" % (str(h), str(cpp)) - h_contents = h.get_contents() - if moc_options['gobble_comments']: - h_contents = self.ccomment.sub('', h_contents) - h_contents = self.cxxcomment.sub('', h_contents) - h_contents = self.literal_qobject.sub('""', h_contents) - break - if not h and moc_options['debug']: - print "scons: qt5: no header for '%s'." % (str(cpp)) - if h and self.qo_search.search(h_contents): - # h file with the Q_OBJECT macro found -> add moc_cpp - moc_cpp = env.XMoc5(h) - env.Ignore(moc_cpp, moc_cpp) - added = True - # Removing file from list of sources, because it is not to be - # compiled but simply included by the cpp/cxx file. - for idx, s in enumerate(out_sources): - if hasattr(s, "sources") and len(s.sources) > 0: - if str(s.sources[0]) == h_moc: - out_sources.pop(idx) - break - if moc_options['debug']: - print "scons: qt5: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(h_moc)) - else: - if moc_options['debug']: - print "scons: qt5: found no Q_OBJECT macro in '%s', but a moc'ed version '%s' gets included in '%s'" % (str(h), inc_h_moc, cpp.name) - - if cpp and re.search(inc_cxx_moc, cpp_contents): - # cpp file with #include directive for a MOCed cxx file found -> add moc - if self.qo_search.search(cpp_contents): - moc = env.XMoc5(target=cxx_moc, source=cpp) - env.Ignore(moc, moc) - added = True - if moc_options['debug']: - print "scons: qt5: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(cpp), str(moc)) - else: - if moc_options['debug']: - print "scons: qt5: found no Q_OBJECT macro in '%s', although a moc'ed version '%s' of itself gets included" % (cpp.name, inc_cxx_moc) - - if not added: - # Fallback to default Automoc strategy (Q_OBJECT driven) - self.__automoc_strategy_simple(env, moc_options, cpp, - cpp_contents, out_sources) - - def __call__(self, target, source, env): - """ - Smart autoscan function. Gets the list of objects for the Program - or Lib. Adds objects and builders for the special qt5 files. - """ - moc_options = self.create_automoc_options(env) - - # some shortcuts used in the scanner - self.splitext = SCons.Util.splitext - self.objBuilder = getattr(env, self.objBuilderName) - - # The following is kind of hacky to get builders working properly (FIXME) - objBuilderEnv = self.objBuilder.env - self.objBuilder.env = env - mocBuilderEnv = env.Moc5.env - env.Moc5.env = env - xMocBuilderEnv = env.XMoc5.env - env.XMoc5.env = env - - # make a deep copy for the result; MocH objects will be appended - out_sources = source[:] - - for obj in source: - if not moc_options['auto_scan']: - break - if isinstance(obj,basestring): # big kludge! - print "scons: qt5: '%s' MAYBE USING AN OLD SCONS VERSION AND NOT CONVERTED TO 'File'. Discarded." % str(obj) - continue - if not obj.has_builder(): - # binary obj file provided - if moc_options['debug']: - print "scons: qt5: '%s' seems to be a binary. Discarded." % str(obj) - continue - cpp = obj.sources[0] - if not self.splitext(str(cpp))[1] in cxx_suffixes: - if moc_options['debug']: - print "scons: qt5: '%s' is no cxx file. Discarded." % str(cpp) - # c or fortran source - continue - try: - cpp_contents = cpp.get_contents() - if moc_options['gobble_comments']: - cpp_contents = self.ccomment.sub('', cpp_contents) - cpp_contents = self.cxxcomment.sub('', cpp_contents) - cpp_contents = self.literal_qobject.sub('""', cpp_contents) - except: continue # may be an still not generated source - - if moc_options['auto_scan_strategy'] == 0: - # Default Automoc strategy (Q_OBJECT driven) - self.__automoc_strategy_simple(env, moc_options, - cpp, cpp_contents, out_sources) - else: - # Automoc strategy #1 (include driven) - self.__automoc_strategy_include_driven(env, moc_options, - cpp, cpp_contents, out_sources) - - # restore the original env attributes (FIXME) - self.objBuilder.env = objBuilderEnv - env.Moc5.env = mocBuilderEnv - env.XMoc5.env = xMocBuilderEnv - - # We return the set of source entries as sorted sequence, else - # the order might accidentally change from one build to another - # and trigger unwanted rebuilds. For proper sorting, a key function - # has to be specified...FS.Entry (and Base nodes in general) do not - # provide a __cmp__, for performance reasons. - return (target, sorted(set(out_sources), key=lambda entry : str(entry))) - -AutomocShared = _Automoc('SharedObject') -AutomocStatic = _Automoc('StaticObject') - -def _detect(env): - """Not really safe, but fast method to detect the Qt5 library""" - try: return env['QT5DIR'] - except KeyError: pass - - try: return env['QTDIR'] - except KeyError: pass - - try: return os.environ['QT5DIR'] - except KeyError: pass - - try: return os.environ['QTDIR'] - except KeyError: pass - - moc = env.WhereIs('moc-qt5') or env.WhereIs('moc5') or env.WhereIs('moc') - if moc: - vernumber = os.popen3('%s -v' % moc)[2].read() - vernumber = mocver_re.match(vernumber) - if vernumber: - vernumber = [ int(x) for x in vernumber.groups() ] - if vernumber < [5, 0, 0]: - vernumber = '.'.join([str(x) for x in vernumber]) - moc = None - SCons.Warnings.warn( - QtdirNotFound, - "QT5DIR variable not defined, and detected moc is for Qt %s" % vernumber) - - QT5DIR = os.path.dirname(os.path.dirname(moc)) - SCons.Warnings.warn( - QtdirNotFound, - "QT5DIR variable is not defined, using moc executable as a hint (QT5DIR=%s)" % QT5DIR) - return QT5DIR - - raise SCons.Errors.StopError( - QtdirNotFound, - "Could not detect Qt 5 installation") - return None - - -def __scanResources(node, env, path, arg): - # Helper function for scanning .qrc resource files - # I've been careful on providing names relative to the qrc file - # If that was not needed this code could be simplified a lot - def recursiveFiles(basepath, path) : - result = [] - for item in os.listdir(os.path.join(basepath, path)) : - itemPath = os.path.join(path, item) - if os.path.isdir(os.path.join(basepath, itemPath)) : - result += recursiveFiles(basepath, itemPath) - else: - result.append(itemPath) - return result - contents = node.get_contents() - includes = qrcinclude_re.findall(contents) - qrcpath = os.path.dirname(node.path) - dirs = [included for included in includes if os.path.isdir(os.path.join(qrcpath,included))] - # dirs need to include files recursively - for dir in dirs : - includes.remove(dir) - includes+=recursiveFiles(qrcpath,dir) - return includes - -# -# Scanners -# -__qrcscanner = SCons.Scanner.Scanner(name = 'qrcfile', - function = __scanResources, - argument = None, - skeys = ['.qrc']) - -# -# Emitters -# -def __qrc_path(head, prefix, tail, suffix): - if head: - if tail: - return os.path.join(head, "%s%s%s" % (prefix, tail, suffix)) - else: - return "%s%s%s" % (prefix, head, suffix) - else: - return "%s%s%s" % (prefix, tail, suffix) -def __qrc_emitter(target, source, env): - sourceBase, sourceExt = os.path.splitext(SCons.Util.to_String(source[0])) - sHead = None - sTail = sourceBase - if sourceBase: - sHead, sTail = os.path.split(sourceBase) - - t = __qrc_path(sHead, env.subst('$QT5_QRCCXXPREFIX'), - sTail, env.subst('$QT5_QRCCXXSUFFIX')) - - return t, source - -# -# Action generators -# -def __moc_generator_from_h(source, target, env, for_signature): - pass_defines = False - try: - if int(env.subst('$QT5_CPPDEFINES_PASSTOMOC')) == 1: - pass_defines = True - except ValueError: - pass - - if pass_defines: - return '$QT5_MOC $QT5_MOCDEFINES $QT5_MOCFROMHFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE' - else: - return '$QT5_MOC $QT5_MOCFROMHFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE' - -def __moc_generator_from_cxx(source, target, env, for_signature): - pass_defines = False - try: - if int(env.subst('$QT5_CPPDEFINES_PASSTOMOC')) == 1: - pass_defines = True - except ValueError: - pass - - if pass_defines: - return ['$QT5_MOC $QT5_MOCDEFINES $QT5_MOCFROMCXXFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE', - SCons.Action.Action(checkMocIncluded,None)] - else: - return ['$QT5_MOC $QT5_MOCFROMCXXFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE', - SCons.Action.Action(checkMocIncluded,None)] - -def __mocx_generator_from_h(source, target, env, for_signature): - pass_defines = False - try: - if int(env.subst('$QT5_CPPDEFINES_PASSTOMOC')) == 1: - pass_defines = True - except ValueError: - pass - - if pass_defines: - return '$QT5_MOC $QT5_MOCDEFINES $QT5_MOCFROMHFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE' - else: - return '$QT5_MOC $QT5_MOCFROMHFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE' - -def __mocx_generator_from_cxx(source, target, env, for_signature): - pass_defines = False - try: - if int(env.subst('$QT5_CPPDEFINES_PASSTOMOC')) == 1: - pass_defines = True - except ValueError: - pass - - if pass_defines: - return ['$QT5_MOC $QT5_MOCDEFINES $QT5_MOCFROMCXXFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE', - SCons.Action.Action(checkMocIncluded,None)] - else: - return ['$QT5_MOC $QT5_MOCFROMCXXFLAGS $QT5_MOCINCFLAGS -o $TARGET $SOURCE', - SCons.Action.Action(checkMocIncluded,None)] - -def __qrc_generator(source, target, env, for_signature): - name_defined = False - try: - if env.subst('$QT5_QRCFLAGS').find('-name') >= 0: - name_defined = True - except ValueError: - pass - - if name_defined: - return '$QT5_RCC $QT5_QRCFLAGS $SOURCE -o $TARGET' - else: - qrc_suffix = env.subst('$QT5_QRCSUFFIX') - src = str(source[0]) - head, tail = os.path.split(src) - if tail: - src = tail - qrc_suffix = env.subst('$QT5_QRCSUFFIX') - if src.endswith(qrc_suffix): - qrc_stem = src[:-len(qrc_suffix)] - else: - qrc_stem = src - return '$QT5_RCC $QT5_QRCFLAGS -name %s $SOURCE -o $TARGET' % qrc_stem - -# -# Builders -# -__ts_builder = SCons.Builder.Builder( - action = SCons.Action.Action('$QT5_LUPDATECOM','$QT5_LUPDATECOMSTR'), - suffix = '.ts', - source_factory = SCons.Node.FS.Entry) -__qm_builder = SCons.Builder.Builder( - action = SCons.Action.Action('$QT5_LRELEASECOM','$QT5_LRELEASECOMSTR'), - src_suffix = '.ts', - suffix = '.qm') -__qrc_builder = SCons.Builder.Builder( - action = SCons.Action.CommandGeneratorAction(__qrc_generator, {'cmdstr':'$QT5_QRCCOMSTR'}), - source_scanner = __qrcscanner, - src_suffix = '$QT5_QRCSUFFIX', - suffix = '$QT5_QRCCXXSUFFIX', - prefix = '$QT5_QRCCXXPREFIX', - single_source = 1) -__ex_moc_builder = SCons.Builder.Builder( - action = SCons.Action.CommandGeneratorAction(__moc_generator_from_h, {'cmdstr':'$QT5_MOCCOMSTR'})) -__ex_uic_builder = SCons.Builder.Builder( - action = SCons.Action.Action('$QT5_UICCOM', '$QT5_UICCOMSTR'), - src_suffix = '.ui') - - -# -# Wrappers (pseudo-Builders) -# -def Ts5(env, target, source=None, *args, **kw): - """ - A pseudo-Builder wrapper around the LUPDATE executable of Qt5. - lupdate [options] [source-file|path]... -ts ts-files - """ - if not SCons.Util.is_List(target): - target = [target] - if not source: - source = target[:] - if not SCons.Util.is_List(source): - source = [source] - - # Check QT5_CLEAN_TS and use NoClean() function - clean_ts = False - try: - if int(env.subst('$QT5_CLEAN_TS')) == 1: - clean_ts = True - except ValueError: - pass - - result = [] - for t in target: - obj = __ts_builder.__call__(env, t, source, **kw) - # Prevent deletion of the .ts file, unless explicitly specified - if not clean_ts: - env.NoClean(obj) - # Always make our target "precious", such that it is not deleted - # prior to a rebuild - env.Precious(obj) - # Add to resulting target list - result.extend(obj) - - return result - -def Qm5(env, target, source=None, *args, **kw): - """ - A pseudo-Builder wrapper around the LRELEASE executable of Qt5. - lrelease [options] ts-files [-qm qm-file] - """ - if not SCons.Util.is_List(target): - target = [target] - if not source: - source = target[:] - if not SCons.Util.is_List(source): - source = [source] - - result = [] - for t in target: - result.extend(__qm_builder.__call__(env, t, source, **kw)) - - return result - -def Qrc5(env, target, source=None, *args, **kw): - """ - A pseudo-Builder wrapper around the RCC executable of Qt5. - rcc [options] qrc-files -o out-file - """ - if not SCons.Util.is_List(target): - target = [target] - if not source: - source = target[:] - if not SCons.Util.is_List(source): - source = [source] - - result = [] - for t, s in zip(target, source): - result.extend(__qrc_builder.__call__(env, t, s, **kw)) - - return result - -def ExplicitMoc5(env, target, source, *args, **kw): - """ - A pseudo-Builder wrapper around the MOC executable of Qt5. - moc [options] - """ - if not SCons.Util.is_List(target): - target = [target] - if not SCons.Util.is_List(source): - source = [source] - - result = [] - for t in target: - # Is it a header or a cxx file? - result.extend(__ex_moc_builder.__call__(env, t, source, **kw)) - - return result - -def ExplicitUic5(env, target, source, *args, **kw): - """ - A pseudo-Builder wrapper around the UIC executable of Qt5. - uic [options] - """ - if not SCons.Util.is_List(target): - target = [target] - if not SCons.Util.is_List(source): - source = [source] - - result = [] - for t in target: - result.extend(__ex_uic_builder.__call__(env, t, source, **kw)) - - return result - -def generate(env): - """Add Builders and construction variables for qt5 to an Environment.""" - - suffixes = [ - '-qt5', - '-qt5.exe', - '5', - '5.exe', - '', - '.exe', - ] - command_suffixes = ['-qt5', '5', ''] - - def locateQt5Command(env, command, qtdir) : - triedPaths = [] - for suffix in suffixes : - fullpath = os.path.join(qtdir,'bin',command + suffix) - if os.access(fullpath, os.X_OK) : - return fullpath - triedPaths.append(fullpath) - - fullpath = env.Detect([command+s for s in command_suffixes]) - if not (fullpath is None) : return fullpath - - raise Exception("Qt5 command '" + command + "' not found. Tried: " + ', '.join(triedPaths)) - - CLVar = SCons.Util.CLVar - Action = SCons.Action.Action - Builder = SCons.Builder.Builder - - env['QT5DIR'] = _detect(env) - # TODO: 'Replace' should be 'SetDefault' -# env.SetDefault( - env.Replace( - QT5DIR = _detect(env), - QT5_BINPATH = os.path.join('$QT5DIR', 'bin'), - # TODO: This is not reliable to QT5DIR value changes but needed in order to support '-qt5' variants - QT5_MOC = locateQt5Command(env,'moc', env['QT5DIR']), - QT5_UIC = locateQt5Command(env,'uic', env['QT5DIR']), - QT5_RCC = locateQt5Command(env,'rcc', env['QT5DIR']), - QT5_LUPDATE = locateQt5Command(env,'lupdate', env['QT5DIR']), - QT5_LRELEASE = locateQt5Command(env,'lrelease', env['QT5DIR']), - - QT5_AUTOSCAN = 1, # Should the qt5 tool try to figure out, which sources are to be moc'ed? - QT5_AUTOSCAN_STRATEGY = 0, # While scanning for files to moc, should we search for includes in qtsolutions style? - QT5_GOBBLECOMMENTS = 0, # If set to 1, comments are removed before scanning cxx/h files. - QT5_CPPDEFINES_PASSTOMOC = 1, # If set to 1, all CPPDEFINES get passed to the moc executable. - QT5_CLEAN_TS = 0, # If set to 1, translation files (.ts) get cleaned on 'scons -c' - QT5_AUTOMOC_SCANCPPPATH = 1, # If set to 1, the CPPPATHs (or QT5_AUTOMOC_CPPPATH) get scanned for moc'able files - QT5_AUTOMOC_CPPPATH = [], # Alternative paths that get scanned for moc files - - # Some Qt5 specific flags. I don't expect someone wants to - # manipulate those ... - QT5_UICFLAGS = CLVar(''), - QT5_MOCFROMHFLAGS = CLVar(''), - QT5_MOCFROMCXXFLAGS = CLVar('-i'), - QT5_QRCFLAGS = '', - QT5_LUPDATEFLAGS = '', - QT5_LRELEASEFLAGS = '', - - # suffixes/prefixes for the headers / sources to generate - QT5_UISUFFIX = '.ui', - QT5_UICDECLPREFIX = 'ui_', - QT5_UICDECLSUFFIX = '.h', - QT5_MOCINCPREFIX = '-I', - QT5_MOCHPREFIX = 'moc_', - QT5_MOCHSUFFIX = '$CXXFILESUFFIX', - QT5_MOCCXXPREFIX = '', - QT5_MOCCXXSUFFIX = '.moc', - QT5_QRCSUFFIX = '.qrc', - QT5_QRCCXXSUFFIX = '$CXXFILESUFFIX', - QT5_QRCCXXPREFIX = 'qrc_', - QT5_MOCDEFPREFIX = '-D', - QT5_MOCDEFSUFFIX = '', - QT5_MOCDEFINES = '${_defines(QT5_MOCDEFPREFIX, CPPDEFINES, QT5_MOCDEFSUFFIX, __env__)}', - QT5_MOCCPPPATH = [], - QT5_MOCINCFLAGS = '$( ${_concat(QT5_MOCINCPREFIX, QT5_MOCCPPPATH, INCSUFFIX, __env__, RDirs)} $)', - - # Commands for the qt5 support ... - QT5_UICCOM = '$QT5_UIC $QT5_UICFLAGS -o $TARGET $SOURCE', - QT5_LUPDATECOM = '$QT5_LUPDATE $QT5_LUPDATEFLAGS $SOURCES -ts $TARGET', - QT5_LRELEASECOM = '$QT5_LRELEASE $QT5_LRELEASEFLAGS -qm $TARGET $SOURCES', - - # Specialized variables for the Extended Automoc support - # (Strategy #1 for qtsolutions) - QT5_XMOCHPREFIX = 'moc_', - QT5_XMOCHSUFFIX = '.cpp', - QT5_XMOCCXXPREFIX = '', - QT5_XMOCCXXSUFFIX = '.moc', - - ) - - try: - env.AddMethod(Ts5, "Ts5") - env.AddMethod(Qm5, "Qm5") - env.AddMethod(Qrc5, "Qrc5") - env.AddMethod(ExplicitMoc5, "ExplicitMoc5") - env.AddMethod(ExplicitUic5, "ExplicitUic5") - except AttributeError: - # Looks like we use a pre-0.98 version of SCons... - from SCons.Script.SConscript import SConsEnvironment - SConsEnvironment.Ts5 = Ts5 - SConsEnvironment.Qm5 = Qm5 - SConsEnvironment.Qrc5 = Qrc5 - SConsEnvironment.ExplicitMoc5 = ExplicitMoc5 - SConsEnvironment.ExplicitUic5 = ExplicitUic5 - - # Interface builder - uic5builder = Builder( - action = SCons.Action.Action('$QT5_UICCOM', '$QT5_UICCOMSTR'), - src_suffix='$QT5_UISUFFIX', - suffix='$QT5_UICDECLSUFFIX', - prefix='$QT5_UICDECLPREFIX', - single_source = True - #TODO: Consider the uiscanner on new scons version - ) - env['BUILDERS']['Uic5'] = uic5builder - - # Metaobject builder - mocBld = Builder(action={}, prefix={}, suffix={}) - for h in header_extensions: - act = SCons.Action.CommandGeneratorAction(__moc_generator_from_h, {'cmdstr':'$QT5_MOCCOMSTR'}) - mocBld.add_action(h, act) - mocBld.prefix[h] = '$QT5_MOCHPREFIX' - mocBld.suffix[h] = '$QT5_MOCHSUFFIX' - for cxx in cxx_suffixes: - act = SCons.Action.CommandGeneratorAction(__moc_generator_from_cxx, {'cmdstr':'$QT5_MOCCOMSTR'}) - mocBld.add_action(cxx, act) - mocBld.prefix[cxx] = '$QT5_MOCCXXPREFIX' - mocBld.suffix[cxx] = '$QT5_MOCCXXSUFFIX' - env['BUILDERS']['Moc5'] = mocBld - - # Metaobject builder for the extended auto scan feature - # (Strategy #1 for qtsolutions) - xMocBld = Builder(action={}, prefix={}, suffix={}) - for h in header_extensions: - act = SCons.Action.CommandGeneratorAction(__mocx_generator_from_h, {'cmdstr':'$QT5_MOCCOMSTR'}) - xMocBld.add_action(h, act) - xMocBld.prefix[h] = '$QT5_XMOCHPREFIX' - xMocBld.suffix[h] = '$QT5_XMOCHSUFFIX' - for cxx in cxx_suffixes: - act = SCons.Action.CommandGeneratorAction(__mocx_generator_from_cxx, {'cmdstr':'$QT5_MOCCOMSTR'}) - xMocBld.add_action(cxx, act) - xMocBld.prefix[cxx] = '$QT5_XMOCCXXPREFIX' - xMocBld.suffix[cxx] = '$QT5_XMOCCXXSUFFIX' - env['BUILDERS']['XMoc5'] = xMocBld - - # Add the Qrc5 action to the CXX file builder (registers the - # *.qrc extension with the Environment) - cfile_builder, cxxfile_builder = SCons.Tool.createCFileBuilders(env) - qrc_act = SCons.Action.CommandGeneratorAction(__qrc_generator, {'cmdstr':'$QT5_QRCCOMSTR'}) - cxxfile_builder.add_action('$QT5_QRCSUFFIX', qrc_act) - cxxfile_builder.add_emitter('$QT5_QRCSUFFIX', __qrc_emitter) - - # We use the emitters of Program / StaticLibrary / SharedLibrary - # to scan for moc'able files - # We can't refer to the builders directly, we have to fetch them - # as Environment attributes because that sets them up to be called - # correctly later by our emitter. - env.AppendUnique(PROGEMITTER =[AutomocStatic], - SHLIBEMITTER=[AutomocShared], - LIBEMITTER =[AutomocStatic], - ) - - # TODO: Does dbusxml2cpp need an adapter - try: - env.AddMethod(enable_modules, "EnableQt5Modules") - except AttributeError: - # Looks like we use a pre-0.98 version of SCons... - from SCons.Script.SConscript import SConsEnvironment - SConsEnvironment.EnableQt5Modules = enable_modules - -def enable_modules(self, modules, debug=False, crosscompiling=False) : - import sys - - validModules = [ - # Qt Essentials - 'QtCore', - 'QtGui', - 'QtMultimedia', - 'QtMultimediaQuick_p', - 'QtMultimediaWidgets', - 'QtNetwork', - 'QtPlatformSupport', - 'QtQml', - 'QtQmlDevTools', - 'QtQuick', - 'QtQuickParticles', - 'QtSql', - 'QtQuickTest', - 'QtTest', - 'QtWebKit', - 'QtWebKitWidgets', - 'QtWidgets', - # Qt Add-Ons - 'QtConcurrent', - 'QtDBus', - 'QtOpenGL', - 'QtPrintSupport', - 'QtDeclarative', - 'QtScript', - 'QtScriptTools', - 'QtSvg', - 'QtUiTools', - 'QtXml', - 'QtXmlPatterns', - # Qt Tools - 'QtHelp', - 'QtDesigner', - 'QtDesignerComponents', - # Other - 'QtCLucene', - 'QtConcurrent', - 'QtV8' - ] - pclessModules = [ - ] - staticModules = [ - ] - invalidModules=[] - for module in modules: - if module not in validModules : - invalidModules.append(module) - if invalidModules : - raise Exception("Modules %s are not Qt5 modules. Valid Qt5 modules are: %s"% ( - str(invalidModules),str(validModules))) - - moduleDefines = { - 'QtScript' : ['QT_SCRIPT_LIB'], - 'QtSvg' : ['QT_SVG_LIB'], - 'QtSql' : ['QT_SQL_LIB'], - 'QtXml' : ['QT_XML_LIB'], - 'QtOpenGL' : ['QT_OPENGL_LIB'], - 'QtGui' : ['QT_GUI_LIB'], - 'QtNetwork' : ['QT_NETWORK_LIB'], - 'QtCore' : ['QT_CORE_LIB'], - 'QtWidgets' : ['QT_WIDGETS_LIB'], - } - for module in modules : - try : self.AppendUnique(CPPDEFINES=moduleDefines[module]) - except: pass - debugSuffix = '' - if sys.platform in ["darwin", "linux2"] and not crosscompiling : - if debug : debugSuffix = '_debug' - for module in modules : - if module not in pclessModules : continue - self.AppendUnique(LIBS=[module.replace('Qt','Qt5')+debugSuffix]) - self.AppendUnique(LIBPATH=[os.path.join("$QT5DIR","lib")]) - self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include")]) - self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include",module)]) - pcmodules = [module.replace('Qt','Qt5')+debugSuffix for module in modules if module not in pclessModules ] - if 'Qt5DBus' in pcmodules: - self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include","Qt5DBus")]) - if "Qt5Assistant" in pcmodules: - self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include","Qt5Assistant")]) - pcmodules.remove("Qt5Assistant") - pcmodules.append("Qt5AssistantClient") - self.AppendUnique(RPATH=[os.path.join("$QT5DIR","lib")]) - self.ParseConfig('pkg-config %s --libs --cflags'% ' '.join(pcmodules)) - self["QT5_MOCCPPPATH"] = self["CPPPATH"] - return - if sys.platform == "win32" or crosscompiling : - if crosscompiling: - transformedQtdir = transformToWinePath(self['QT5DIR']) - self['QT5_MOC'] = "QT5DIR=%s %s"%( transformedQtdir, self['QT5_MOC']) - self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include")]) - try: modules.remove("QtDBus") - except: pass - if debug : debugSuffix = 'd' - if "QtAssistant" in modules: - self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include","QtAssistant")]) - modules.remove("QtAssistant") - modules.append("QtAssistantClient") - self.AppendUnique(LIBS=['qtmain'+debugSuffix]) - self.AppendUnique(LIBS=[lib.replace("Qt","Qt5")+debugSuffix for lib in modules if lib not in staticModules]) - self.PrependUnique(LIBS=[lib+debugSuffix for lib in modules if lib in staticModules]) - if 'QtOpenGL' in modules: - self.AppendUnique(LIBS=['opengl32']) - self.AppendUnique(CPPPATH=[ '$QT5DIR/include/']) - self.AppendUnique(CPPPATH=[ '$QT5DIR/include/'+module for module in modules]) - if crosscompiling : - self["QT5_MOCCPPPATH"] = [ - path.replace('$QT5DIR', transformedQtdir) - for path in self['CPPPATH'] ] - else : - self["QT5_MOCCPPPATH"] = self["CPPPATH"] - self.AppendUnique(LIBPATH=[os.path.join('$QT5DIR','lib')]) - return - - """ - if sys.platform=="darwin" : - # TODO: Test debug version on Mac - self.AppendUnique(LIBPATH=[os.path.join('$QT5DIR','lib')]) - self.AppendUnique(LINKFLAGS="-F$QT5DIR/lib") - self.AppendUnique(LINKFLAGS="-L$QT5DIR/lib") #TODO clean! - if debug : debugSuffix = 'd' - for module in modules : -# self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include")]) -# self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include",module)]) -# port qt5-mac: - self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include", "qt5")]) - self.AppendUnique(CPPPATH=[os.path.join("$QT5DIR","include", "qt5", module)]) - if module in staticModules : - self.AppendUnique(LIBS=[module+debugSuffix]) # TODO: Add the debug suffix - self.AppendUnique(LIBPATH=[os.path.join("$QT5DIR","lib")]) - else : -# self.Append(LINKFLAGS=['-framework', module]) -# port qt5-mac: - self.Append(LIBS=module) - if 'QtOpenGL' in modules: - self.AppendUnique(LINKFLAGS="-F/System/Library/Frameworks") - self.Append(LINKFLAGS=['-framework', 'AGL']) #TODO ughly kludge to avoid quotes - self.Append(LINKFLAGS=['-framework', 'OpenGL']) - self["QT5_MOCCPPPATH"] = self["CPPPATH"] - return -# This should work for mac but doesn't -# env.AppendUnique(FRAMEWORKPATH=[os.path.join(env['QT5DIR'],'lib')]) -# env.AppendUnique(FRAMEWORKS=['QtCore','QtGui','QtOpenGL', 'AGL']) - """ - -def exists(env): - return _detect(env) diff --git a/tests/site_scons/site_tools/qt5/docs/SConstruct b/tests/site_scons/site_tools/qt5/docs/SConstruct deleted file mode 100644 index e4afdf7..0000000 --- a/tests/site_scons/site_tools/qt5/docs/SConstruct +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -import os - -env = Environment(ENV = os.environ, - tools = ['docbook']) - -env.DocbookPdf('manual', DOCBOOK_XSL='pdf.xsl') -env.DocbookPdf('reference', DOCBOOK_XSL='pdf.xsl') - -env.DocbookHtml('manual', DOCBOOK_XSL='html.xsl') -env.DocbookHtml('reference', DOCBOOK_XSL='html.xsl') - diff --git a/tests/site_scons/site_tools/qt5/docs/html.xsl b/tests/site_scons/site_tools/qt5/docs/html.xsl deleted file mode 100644 index dd7bf5f..0000000 --- a/tests/site_scons/site_tools/qt5/docs/html.xsl +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - diff --git a/tests/site_scons/site_tools/qt5/docs/manual.xml b/tests/site_scons/site_tools/qt5/docs/manual.xml deleted file mode 100644 index 490a410..0000000 --- a/tests/site_scons/site_tools/qt5/docs/manual.xml +++ /dev/null @@ -1,388 +0,0 @@ - - - -
- The SCons qt5 tool - - - - Dirk Baechle - - - 2012-12-13 - - -
- Basics - - This tool can be used to compile Qt projects, designed for versions - 5.x.y and higher. It is not usable for Qt3 and older versions, since some - of the helper tools (moc, uic) - behave different. - -
- Install - - Installing it, requires you to copy (or, even better: checkout) - the contents of the package's qt5 folder to - - - - /path_to_your_project/site_scons/site_tools/qt5, - if you need the Qt5 Tool in one project only, or - - - - ~/.scons/site_scons/site_tools/qt5, - for a system-wide installation under your current login. - - - - For more infos about this, please refer to - - - - the SCons User's Guide, sect. "Where to put your custom - Builders and Tools" and - - - - the SCons Tools Wiki page at http://scons.org/wiki/ToolsIndex. - - -
- -
- How to activate - - For activating the tool "qt5", you have to add its name to the - Environment constructor, like this - - env = Environment(tools=['default','qt5']) - - - On its startup, the Qt5 tool tries to read the variable - QT5DIR from the current Environment and - os.environ. If it is not set, the value of - QTDIR (in Environment/os.environ) - is used as a fallback. - - So, you either have to explicitly give the path of your Qt5 - installation to the Environment with - - env['QT5DIR'] = '/usr/local/Trolltech/Qt-5.2.3' - - - or set the QT5DIR as environment variable in - your shell. -
- -
- Requirements - - Under Linux, "qt5" uses the system tool - pkg-config for automatically setting the required - compile and link flags of the single Qt5 modules (like QtCore, - QtGui,...). This means that - - - - you should have pkg-config installed, - and - - - - you additionally have to set - PKG_CONFIG_PATH in your shell environment, such - that it points to $QT5DIR/lib/pkgconfig (or - $QT5DIR/lib for some older versions). - - - - Based on these two environment variables - (QT5DIR and PKG_CONFIG_PATH), the - "qt5" tool initializes all QT5_* construction - variables listed in the Reference manual. This happens when the tool is - "detected" during Environment construction. As a consequence, the setup - of the tool gets a two-stage process, if you want to override the values - provided by your current shell settings: - - # Stage 1: create plain environment -qtEnv = Environment() -# Set new vars -qtEnv['QT5DIR'] = '/usr/local/Trolltech/Qt-5.2.3 -qtEnv['ENV']['PKG_CONFIG_PATH'] = '/usr/local/Trolltech/Qt-5.2.3/lib/pkgconfig' -# Stage 2: add qt5 tool -qtEnv.Tool('qt5') - -
-
- -
- Suggested boilerplate - - Based on the requirements above, we suggest a simple ready-to-go - setup as follows: - - SConstruct - - # Detect Qt version -qtdir = detectLatestQtDir() - -# Create base environment -baseEnv = Environment() -#...further customization of base env - -# Clone Qt environment -qtEnv = baseEnv.Clone() -# Set QT5DIR and PKG_CONFIG_PATH -qtEnv['ENV']['PKG_CONFIG_PATH'] = os.path.join(qtdir, 'lib/pkgconfig') -qtEnv['QT5DIR'] = qtdir -# Add qt5 tool -qtEnv.Tool('qt5') -#...further customization of qt env - -# Export environments -Export('baseEnv qtEnv') - -# Your other stuff... -# ...including the call to your SConscripts - - - In a SConscript - - # Get the Qt5 environment -Import('qtEnv') -# Clone it -env = qtEnv.clone() -# Patch it -env.Append(CCFLAGS=['-m32']) # or whatever -# Use it -env.StaticLibrary('foo', Glob('*.cpp')) - - - The detection of the Qt directory could be as simple as directly - assigning a fixed path - - def detectLatestQtDir(): - return "/usr/local/qt5.3.2" - - - or a little more sophisticated - - # Tries to detect the path to the installation of Qt with -# the highest version number -def detectLatestQtDir(): - if sys.platform.startswith("linux"): - # Simple check: inspect only '/usr/local/Trolltech' - paths = glob.glob('/usr/local/Trolltech/*') - if len(paths): - paths.sort() - return paths[-1] - else: - return "" - else: - # Simple check: inspect only 'C:\Qt' - paths = glob.glob('C:\\Qt\\*') - if len(paths): - paths.sort() - return paths[-1] - else: - return os.environ.get("QTDIR","") - -
- -
- A first project - - The following SConscript is for a simple project with some cxx - files, using the QtCore, QtGui and QtNetwork modules: - - Import('qtEnv') -env = qtEnv.Clone() -env.EnableQt5Modules([ - 'QtGui', - 'QtCore', - 'QtNetwork' - ]) -# Add your CCFLAGS and CPPPATHs to env here... - -env.Program('foo', Glob('*.cpp')) - -
- -
- MOC it up - - For the basic support of automocing, nothing needs to be done by the - user. The tool usually detects the Q_OBJECT macro and - calls the moc executable - accordingly. - - If you don't want this, you can switch off the automocing by - a - - env['QT5_AUTOSCAN'] = 0 - - - in your SConscript file. Then, you have to moc your files - explicitly, using the Moc5 builder. - - You can also switch to an extended automoc strategy with - - env['QT5_AUTOSCAN_STRATEGY'] = 1 - - - Please read the description of the - QT5_AUTOSCAN_STRATEGY variable in the Reference manual - for details. - - For debugging purposes, you can set the variable - QT5_DEBUG with - - env['QT5_DEBUG'] = 1 - - - which outputs a lot of messages during automocing. -
- -
- Forms (.ui) - - The header files with setup code for your GUI classes, are not - compiled automatically from your .ui files. You always - have to call the Uic5 builder explicitly like - - env.Uic5(Glob('*.ui')) -env.Program('foo', Glob('*.cpp')) - -
- -
- Resource files (.qrc) - - Resource files are not built automatically, you always have to add - the names of the .qrc files to the source list for your - program or library: - - env.Program('foo', Glob('*.cpp')+Glob('*.qrc')) - - - For each of the Resource input files, its prefix defines the name of - the resulting resource. An appropriate - -name option is added to the call of the - rcc executable by default. - - You can also call the Qrc5 builder explicitly as - - qrccc = env.Qrc5('foo') # ['foo.qrc'] -> ['qrc_foo.cc'] - - - or (overriding the default suffix) - - qrccc = env.Qrc5('myprefix_foo.cxx','foo.qrc') # -> ['qrc_myprefix_foo.cxx'] - - - and then add the resulting cxx file to the sources of your - Program/Library: - - env.Program('foo', Glob('*.cpp') + qrccc) - -
- -
- Translation files - - The update of the .ts files and the conversion to - binary .qm files is not done automatically. You have to - call the corresponding builders on your own. - - Example for updating a translation file: - - env.Ts5('foo.ts','.') # -> ['foo.ts'] - - - By default, the .ts files are treated as - precious targets. This means that they are not - removed prior to a rebuild, but simply get updated. Additionally, they do - not get cleaned on a scons -c. If you - want to delete the translation files on the - -c SCons command, you can set the - variable QT5_CLEAN_TS like this - - env['QT5_CLEAN_TS']=1 - - - Example for releasing a translation file, i.e. compiling it to a - .qm binary file: - - env.Qm5('foo') # ['foo.ts'] -> ['foo.qm'] - - - or (overriding the output prefix) - - env.Qm5('myprefix','foo') # ['foo.ts'] -> ['myprefix.qm'] - - - As an extension both, the Ts5() and Qm5 builder, support the - definition of multiple targets. So, calling - - env.Ts5(['app_en','app_de'], Glob('*.cpp')) - - - and - - env.Qm5(['app','copy'], Glob('*.ts')) - - - should work fine. - - Finally, two short notes about the support of directories for the - Ts5() builder. You can pass an arbitrary mix of cxx files and subdirs to - it, as in - - env.Ts5('app_en',['sub1','appwindow.cpp','main.cpp'])) - - - where sub1 is a folder that gets scanned - recursively for cxx files by lupdate. But like this, - you lose all dependency information for the subdir, i.e. if a file inside - the folder changes, the .ts file is not updated automatically! In this - case you should tell SCons to always update the target: - - ts = env.Ts5('app_en',['sub1','appwindow.cpp','main.cpp']) -env.AlwaysBuild(ts) - - - Last note: specifying the current folder - . as input to Ts5() and storing the - resulting .ts file in the same directory, leads to a dependency cycle! You - then have to store the .ts and .qm files outside of the current folder, or - use Glob('*.cpp')) instead. -
-
diff --git a/tests/site_scons/site_tools/qt5/docs/pdf.xsl b/tests/site_scons/site_tools/qt5/docs/pdf.xsl deleted file mode 100644 index fbdc591..0000000 --- a/tests/site_scons/site_tools/qt5/docs/pdf.xsl +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - -0pt - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - - - - - diff --git a/tests/site_scons/site_tools/qt5/docs/qt5.xml b/tests/site_scons/site_tools/qt5/docs/qt5.xml deleted file mode 100644 index d067cad..0000000 --- a/tests/site_scons/site_tools/qt5/docs/qt5.xml +++ /dev/null @@ -1,600 +0,0 @@ - - - -Sets construction variables for building Qt5 applications. - - -QT5DIR -QT5_BINPATH -QT5_MOC -QT5_UIC -QT5_RCC -QT5_AUTOSCAN -QT5_AUTOSCAN_STRATEGY -QT5_AUTOMOC_CPPPATH -QT5_AUTOMOC_SCANCPPPATH -QT5_UICFLAGS -QT5_MOCFROMHFLAGS -QT5_MOCFROMCXXFLAGS -QT5_UICDECLPREFIX -QT5_UICDECLSUFFIX -QT5_MOCHPREFIX -QT5_MOCHSUFFIX -QT5_MOCCXXPREFIX -QT5_MOCCXXSUFFIX -QT5_MOCDEFPREFIX -QT5_MOCDEFSUFFIX -QT5_UISUFFIX -QT5_UICCOM -QT5_GOBBLECOMMENTS -QT5_CPPDEFINES_PASSTOMOC -QT5_CLEAN_TS -QT5_DEBUG -QT5_XMOCHPREFIX -QT5_XMOCHSUFFIX -QT5_XMOCCXXPREFIX -QT5_XMOCCXXSUFFIX -QT5_LUPDATE -QT5_LRELEASE -QT5_LUPDATEFLAGS -QT5_LRELEASEFLAGS -QT5_QRCFLAGS -QT5_UICDECLPREFIX -QT5_UICDECLSUFFIX -QT5_MOCINCPREFIX -QT5_QRCSUFFIX -QT5_QRCCXXSUFFIX -QT5_QRCCXXPREFIX -QT5_MOCDEFINES -QT5_MOCCPPPATH -QT5_MOCINCFLAGS -QT5_LUPDATECOM -QT5_LRELEASECOM - - - - - - - -Builds an output file from a moc input file. Moc input files are either -header files or cxx files. This builder is only available after using the -tool 'qt5'. It should be your first choice when manually Mocing files -and is the builder for the Q_OBJECT driven Automoc strategy (#0, the default). -It can can be controlled via the QT5_MOC* variables. See the &cv-link-QT5DIR; and -&cv-link-QT5_AUTOSCAN_STRATEGY; variables for more information. -Example: - - -env.Moc5('foo.h') # generates moc_foo.cc -env.Moc5('foo.cpp') # generates foo.moc - - - - - - -Just like the &b-Moc5; builder, it builds an output file from a moc input file. -Moc input files are either header files or cxx files. This builder is only available after using the -tool 'qt5'. It is defined separately for the include driven Automoc strategy (#1) -and can be controlled via the QT5_XMOC* variables. See the &cv-link-QT5DIR; and -&cv-link-QT5_AUTOSCAN_STRATEGY; variables for more information. -Example: - - -env.XMoc5('foo.h') # generates moc_foo.cpp -env.XMoc5('foo.cpp') # generates foo.moc - - - - - - -Just like the &b-Moc5; builder, it builds an output file from a moc input file. -However, it does not use any default prefix or suffix for the filenames. -You can, and have to, specify the full source and target names explicitly. -This builder is only available after using the -tool 'qt5'. It can be your last resort, when you have to moc single files -from/to exotic filenames. -Example: - - -env.ExplicitMoc5('moced_foo.cxx','foo.h') # generates moced_foo.cxx - - - - - - - -Builds a header file from an .ui file, where the former -contains the setup code for a GUI class. -This builder is only available after using the tool 'qt5'. -Using this builder lets you override the standard -naming conventions (be careful: prefixes are always prepended to names of -built files; if you don't want prefixes, you may set them to ``). -See the &cv-link-QT5DIR; variable for more information. -Example: - - -env.Uic5('foo.ui') # -> 'ui_foo.h' - - - - - - -Just like the &b-Uic5; builder, it builds a header file from a .ui input file. -However, it does not use any default prefix or suffix for the filenames. -You can, and have to, specify the full source and target names explicitly. -This builder is only available after using the -tool 'qt5'. It can be your last resort, when you have to convert .ui -files to exotic filenames. -Example: - - -env.ExplicitUic5('uiced_foo.hpp','foo.ui') # generates uiced_foo.hpp - - - - - - -Builds a cxx file, containing all resources from the given -.qrc file. -This builder is only available after using the tool 'qt5'. - -Example: - - -env.Qrc5('foo.qrc') # -> ['qrc_foo.cc'] - - - - - - -Scans the source files in the given path for tr() marked strings, -that should get translated. Writes a .ts file for the Qt Linguist. -This builder is only available after using the tool 'qt5'. - -Example: - - -env.Ts5('foo.ts','.') # -> ['foo.ts'] - - - - - - - -Compiles a given .ts file (Qt Linguist) into a binary .qm file. -This builder is only available after using the tool 'qt5'. - -Example: - - -env.Qm5('foo.ts') # -> ['foo.qm'] - - - - - - - -The Qt5 tool tries to read this from the current Environment and then from os.environ. -If it is not set and found, the value of QTDIR (in the Environment and os.environ) is -used as a fallback. -It also initializes all QT5_* -construction variables listed below. -(Note that all paths are constructed -with python's os.path.join() method, -but are listed here with the '/' separator -for easier reading.) -In addition, the construction environment -variables &cv-link-CPPPATH;, -&cv-link-LIBPATH; and -&cv-link-LIBS; may be modified -and the variables -PROGEMITTER, SHLIBEMITTER and LIBEMITTER -are modified. Because the build-performance is affected when using this tool, -you have to explicitly specify it at Environment creation: - - -Environment(tools=['default','qt5']) - - -The Qt5 tool supports the following operations: - -Automatic moc file generation from header files. -You do not have to specify moc files explicitly, the tool does it for you. -However, there are a few preconditions to do so: Your header file must have -the same filebase as your implementation file and must stay in the same -directory. It must have one of the suffixes .h, .hpp, .H, .hxx, .hh. You -can turn off automatic moc file generation by setting &cv-link-QT5_AUTOSCAN; to 0. -See also the corresponding builder method -&b-Moc5;(). - -Automatic moc file generation from cxx files. -As stated in the Qt documentation, include the moc file at the end of -the cxx file. Note that you have to include the file, which is generated -by the transformation ${QT5_MOCCXXPREFIX}<basename>${QT5_MOCCXXSUFFIX}, by default -<basename>.moc. A warning is generated after building the moc file, if you -do not include the correct file. If you are using VariantDir, you may -need to specify duplicate=1. You can turn off automatic moc file generation -by setting &cv-link-QT5_AUTOSCAN; to 0. See also the corresponding -&b-Moc5; -builder method. - -Handling of .ui files. -TODO: describe a little -See also the corresponding -&b-Uic5; -builder method. - -Handling translation files (.ts and .qm). -TODO: describe a little -See also the corresponding -builder methods &b-Ts5; and &b-Qm5;. - -Compiling resource files (.qrc). -TODO: describe a little -See also the corresponding -&b-Qrc5; builder method. - - - - - - -The default is '1', which means that the tool is automatically -scanning for mocable files (see also &cv-link-QT5_AUTOSCAN_STRATEGY;). -You can set this variable to '0' to -switch it off, and then use the &b-Moc5; Builder to explicitly -specify files to run moc on. - - - - - -The path where the Qt5 binaries are installed. -The default value is '&cv-link-QT5DIR;/bin'. - - - - - -The path where the Qt5 header files are installed. -The default value is '&cv-link-QT5DIR;/include'. -Note: If you set this variable to None, -the tool won't change the &cv-link-CPPPATH; -construction variable. - - - - - -Prints lots of debugging information while scanning for moc files. - - - - - -The path to the Qt5 moc executable. -Default value is '&cv-link-QT5_BINPATH;/moc'. - - - - - -Default value is ''. Prefix for moc output files, when source is a cxx file and the -Automoc strategy #0 (Q_OBJECT driven) is used. - - - - - -Default value is '.moc'. Suffix for moc output files, when source is a cxx file and the -Automoc strategy #0 (Q_OBJECT driven) is used. - - - - - -Default value is '-i'. These flags are passed to moc, when moccing a -C++ file. - - - - - -Default value is ''. These flags are passed to moc, when moccing a header -file. - - - - - -Default value is 'moc_'. Prefix for moc output files, when the source file is a header -and the Automoc strategy #0 (Q_OBJECT driven) is used. - - - - - -Default value is '&cv-link-CXXFILESUFFIX;'. Suffix for moc output files, when -the source file is a header and the Automoc strategy #0 (Q_OBJECT driven) is used. - - - - - -Default value is '&cv-link-QT5_BINPATH;/uic'. The path to the Qt5 uic executable. - - - - - -Command to generate the required header and source files from .ui form files. -Is compiled from &cv-link-QT5_UIC; and &cv-link-QT5_UICFLAGS;. - - - - - -The string displayed when generating header and source files from .ui form files. -If this is not set, then &cv-link-QT5_UICCOM; (the command line) is displayed. - - - - - -Default value is ''. These flags are passed to the Qt5 uic executable, when creating header -and source files from a .ui form file. - - - - - -Default value is 'ui_'. Prefix for uic generated header files. - - - - - -Default value is '.h'. Suffix for uic generated header files. - - - - - -Default value is '.ui'. Suffix of designer input files (form files) in Qt5. - - - - - -Default value is '0'. When using the Automoc feature of the Qt5 tool, you -can select different strategies for detecting which files should get moced. -The simple approach ('0' as the default) scans header and source files for -the Q_OBJECT macro, so the trigger 'moc or not' is Q_OBJECT driven. If it is -found, the corresponding file gets moced with -the &b-Moc5; builder. This results in the files 'moc_foo.cc' and 'foo.moc' for header -and source file, respectively. They get added to the list of sources, for compiling -the current library or program. - -In older Qt manuals, a different technique for mocing is recommended. A cxx file -includes the moced output of itself or its header at the end. This approach is somewhat -deprecated, but the 'qtsolutions' by Qt are still based on it, for example. You also -might have to switch older Qt sources to a new version 5.x.y. Then you can set -this variable to '1', for 'include driven' mocing. This means that the tool searches -for '#include' statements in all cxx files, containing a file pattern 'moc_foo.cpp' -and 'foo.moc' for header and source file, respectively. If the file 'foo.h/foo.cpp' -then contains a Q_OBJECT macro, it gets moced but is NOT added to the list of sources. -This is the important difference between the two strategies. If no matching -include patterns are found for the current cxx file, the Q_OBJECT driven method (#0) -is tried as fallback. - - - - - -The default is '1', meaning that the tool scans -for mocable files not only in the current directory, but -also in all CPPPATH folders (see also &cv-link-QT5_AUTOMOC_CPPPATH;). -You can set this variable to '0' to -switch it off on rare occasions, e.g. when too many search -folders give you a bad performance in large projects. - - - - - -The list of paths to scan for mocable files -(see also &cv-link-QT5_AUTOMOC_SCANCPPPATH;), it is empty by default -which means that the CPPPATH variable is used. -You can set this variable to a subset of CPPPATH in order -to improve performance, i.e. to minimize the search space. - - - - - -Default value is '0' (disabled). When you set this variable to '1', -you enable the automatic removal of C/C++ comments, while searching for -the Q_OBJECT keyword during the Automoc process. This can be helpful if you -have the string Q_OBJECT in one of your comments, but don't want this -file to get moced. - - - - - -Default value is '1' (enabled). When you set this variable to '1', -all currently set CPPDEFINES get passed to the moc executable. It does not matter -which strategy you selected with &cv-link-QT5_AUTOSCAN_STRATEGY; or whether you -call the &b-Moc5; builder directly. - - - - - -Default value is '0' (disabled). When you set this variable to '1', -the &b-Ts5; builder will delete your .ts files on a 'scons -c'. Normally, -these files for the QtLinguist are treated as 'precious' (they are not removed -prior to a rebuild) and do not get cleaned. - - - - - -Default value is 'moc_'. -Like &cv-link-QT5_MOCHPREFIX;, this is the prefix for moc output files, when -the source file is a header -and the Automoc strategy #1 (include driven) is used. - - - - - -Default value is '.cpp'. -Like &cv-link-QT5_MOCHSUFFIX;, this is the suffix for moc output files, when -the source file is a header and the Automoc strategy #1 -(include driven) is used. - - - - - -Default value is ''. -Like &cv-link-QT5_MOCCXXPREFIX;, this is the -prefix for moc output files, when source is a cxx file and the -Automoc strategy #1 (include driven) is used. - - - - - -Default value is '.moc'. -Like &cv-link-QT5_MOCCXXSUFFIX;, this is the -suffix for moc output files, when source is a cxx file and the -Automoc strategy #1 (include driven) is used. - - - - - -Default value is '&cv-link-QT5_BINPATH;/rcc'. The path to the Qt5 rcc -executable (resource file compiler). - - - - - -Default value is '&cv-link-QT5_BINPATH;/lupdate'. The path to the Qt5 lupdate -executable (updates the .ts files from sources). - - - - - -Default value is '&cv-link-QT5_BINPATH;/lrelease'. The path to the Qt5 lrelease -executable (converts .ts files to binary .qm files). - - - - - -Default value is ''. These flags are passed to the Qt5 rcc executable, -when compiling a resource file. - - - - - -Default value is ''. These flags are passed to the Qt5 lupdate executable, -when updating .ts files from sources. - - - - - -Default value is ''. These flags are passed to the Qt5 lrelease executable, -when compiling .ts files into binary .qm files. - - - - - -Default value is '-I'. The prefix for specifying include directories to the -Qt5 moc executable. - - - - - -Default value is '.qrc'. Suffix of Qt5 resource files. - - - - - -Default value is '$CXXFILESUFFIX'. -This is the suffix for compiled .qrc resource files. - - - - - -Default value is 'qrc_'. -This is the prefix for compiled .qrc resource files. - - - - - -List of include paths for the Qt5 moc executable, is compiled from -&cv-link-QT5_MOCINCPREFIX;, &cv-link-QT5_MOCCPPPATH; and &cv-link-INCSUFFIX;. - - - - - -List of CPP defines that are passed to the Qt5 moc executable, -is compiled from &cv-link-QT5_MOCDEFPREFIX;, &cv-link-CPPDEFINES; and &cv-link-QT5_MOCDEFSUFFIX;. - - - - - -Command to update .ts files for translation from the sources. - - - - - -The string displayed when updating .ts files from the sources. -If this is not set, then &cv-link-QT5_LUPDATECOM; (the command line) is displayed. - - - - - -Command to convert .ts files to binary .qm files. - - - - - -The string displayed when converting .ts files to binary .qm files. -If this is not set, then &cv-link-QT5_RCC; (the command line) is displayed. - - - - diff --git a/tests/site_scons/site_tools/qt5/docs/reference.xml b/tests/site_scons/site_tools/qt5/docs/reference.xml deleted file mode 100644 index a9b459a..0000000 --- a/tests/site_scons/site_tools/qt5/docs/reference.xml +++ /dev/null @@ -1,717 +0,0 @@ - - - -
- - SCons tool <quote>qt5</quote> - Reference - - - Dirk - - Baechle - - - 2012-12-13 - - - - This reference lists all the variables that are used within the - qt5 tool, and the available builders. It is intended for - SCons tool developers and core programmers, as a normal user you should - read the manual instead. - - -
- What it does - - The qt5 tool sets construction variables and - registers builders for creating applications and libraries that use the - Qt5 framework by Trolltech/Nokia. - - It supports the following operations: - -
- Automatic moc file generation from header files - - You do not have to specify moc files explicitly, the tool does it - for you. However, there are a few preconditions to do so: Your header - file must have the same filebase as your implementation file. It must - have one of the suffixes .h, .hpp, - .H, .hxx, .hh. - You can turn off automatic moc file generation by setting - QT5_AUTOSCAN to 0. See also the corresponding builder - method Moc5(). -
- -
- Automatic moc file generation from cxx files - - As stated in the Qt documentation, include the moc file at the end - of the cxx file. Note that you have to include the file, which is - generated by the transformation - - ${QT5_MOCCXXPREFIX}<basename>${QT5_MOCCXXSUFFIX}, - by default <basename>.moc. A warning is - generated after building the moc file, if you do not include the correct - file. If you are using VariantDir, you may need to specify - duplicate=1. You can turn off automatic moc file - generation by setting QT5_AUTOSCAN to 0. See also the - corresponding Moc5 builder method. -
- -
- Handling of .ui files - - TODO: describe in a little more detail. - - See also the corresponding Uic5 builder - method. -
- -
- Handling translation files (.ts and .qm) - - TODO: describe in a little more detail. - - See also the corresponding builder methods Ts5 and Qm5. -
- -
- Compiling resource files (.qrc) - - TODO: describe in a little more detail. - - See also the corresponding Qrc5 builder method. -
-
- -
- Builders - - - -
- Moc5 - - Builds an output file from a moc input file. Moc input files are - either header files or cxx files. This builder is only available after - using the tool 'qt5'. - - Example: - - env.Moc5('foo.h') # generates moc_foo.cc -env.Moc5('foo.cpp') # generates foo.moc - -
- -
- XMoc5 - - Just like the Moc5 builder, it builds an output file from a moc - input file. Moc input files are either header files or cxx files. This - builder is only available after using the tool 'qt5'. It is defined - separately for the include driven Automoc strategy (#1) and can be - controlled via the QT5_XMOC* variables. - - Example: - - env.XMoc5('foo.h') # generates moc_foo.cpp -env.XMoc5('foo.cpp') # generates foo.moc - -
- -
- ExplicitMoc5 - - Just like the Moc5 builder, it builds an output - file from a moc input file. However, it does not use any default prefix - or suffix for the filenames. You can, and have to, specify the full - source and target names explicitly. This builder is only available after - using the tool 'qt5'. It can be your last resort, when you have to moc - single files from/to exotic filenames. - - Example: - - env.ExplicitMoc5('moced_foo.cxx','foo.h') # generates moced_foo.cxx - -
- -
- Uic5 - - Builds a header file from an .ui file, where the former contains - the setup code for a GUI class. This builder is only available after - using the tool 'qt5'. Using this builder lets you override the standard - naming conventions (be careful: prefixes are always prepended to names - of built files; if you don't want prefixes, you may set them to - ``). - - Example: - - env.Uic5('foo.ui') # -> 'ui_foo.h' - -
- -
- ExplicitUic5 - - Just like the Uic5 builder, it builds a header - file from a .ui input file. However, it does not use any default prefix - or suffix for the filenames. You can, and have to, specify the full - source and target names explicitly. This builder is only available after - using the tool 'qt5'. It can be your last resort, when you have to - convert .ui files to exotic filenames. - - Example: - - env.ExplicitUic5('uiced_foo.hpp','foo.ui') # generates uiced_foo.hpp - -
- -
- Qrc5 - - Builds a cxx file, containing all resources from the given - .qrc file. This builder is only available after using - the tool 'qt5'. - - Example: - - env.Qrc5('foo.qrc') # -> ['qrc_foo.cc'] - -
- -
- Ts5 - - Scans the source files in the given path for tr() marked strings, - that should get translated. Writes a .ts file for the - Qt Linguist. This builder is only available after using the tool - 'qt5'. - - Example: - - env.Ts5('foo.ts','.') # -> ['foo.ts'] - -
- -
- Qm5 - - Compiles a given .ts file (Qt Linguist) into a - binary .qm file. This builder is only available after - using the tool 'qt5'. - - Example: - - env.Qm5('foo.ts') # -> ['foo.qm'] - -
-
- -
- Variables - - - - QT5DIR - - - The Qt5 tool tries to read this from the current Environment - and os.environ. If it is not set and found, the - value of QTDIR (in Environment/os.environ) is - used as a fallback. It is used to initialize all QT5_* - construction variables listed below. - - - - - QT5_AUTOSCAN - - - The default is '1', which means that the tool is - automatically scanning for mocable files (see also - QT5_AUTOSCAN_STRATEGY). You can set this - variable to '0' to switch it off, and then use the - Moc5 Builder to explicitly specify files to run - moc on. - - - - - QT5_BINPATH - - - The path where the Qt5 binaries are installed. The default - value is 'QT5DIR/bin'. - - - - - QT5_MOCCPPPATH - - - The path where the Qt5 header files are installed. The - default value is 'QT5DIR/include'. Note: If you - set this variable to None, the tool won't change the - CPPPATH construction variable. - - - - - QT5_DEBUG - - - Prints lots of debugging information while scanning for moc - files. - - - - - QT5_MOC - - - The path to the Qt5 moc executable. Default value is - 'QT5_BINPATH/moc'. - - - - - QT5_MOCCXXPREFIX - - - Default value is ''. Prefix for moc output files, when - source is a cxx file and the Automoc strategy #0 (Q_OBJECT driven) - is used. - - - - - QT5_MOCCXXSUFFIX - - - Default value is '.moc'. Suffix for moc output files, when - source is a cxx file and the Automoc strategy #0 (Q_OBJECT driven) - is used. - - - - - QT5_MOCFROMCXXFLAGS - - - Default value is '-i'. These flags are passed to moc, when - moccing a C++ file. - - - - - QT5_MOCFROMHFLAGS - - - Default value is ''. These flags are passed to moc, when - moccing a header file. - - - - - QT5_MOCHPREFIX - - - Default value is 'moc_'. Prefix for moc output files, when - the source file is a header and the Automoc strategy #0 (Q_OBJECT - driven) is used. - - - - - QT5_MOCHSUFFIX - - - Default value is 'CXXFILESUFFIX'. Suffix - for moc output files, when the source file is a header and the - Automoc strategy #0 (Q_OBJECT driven) is used. - - - - - QT5_UIC - - - Default value is 'QT5_BINPATH/uic'. The - path to the Qt5 uic executable. - - - - - QT5_UICCOM - - - Command to generate the required header and source files - from .ui form files. Is compiled from QT5_UIC - and QT5_UICFLAGS. - - - - - QT5_UICCOMSTR - - - The string displayed when generating header and source files - from .ui form files. If this is not set, then - QT5_UICCOM (the command line) is - displayed. - - - - - QT5_UICFLAGS - - - Default value is ''. These flags are passed to the Qt5 uic - executable, when creating header and source files from a .ui form - file. - - - - - QT5_UICDECLPREFIX - - - Default value is 'ui_'. Prefix for uic generated header - files. - - - - - QT5_UICDECLSUFFIX - - - Default value is '.h'. Suffix for uic generated header - files. - - - - - QT5_UISUFFIX - - - Default value is '.ui'. Suffix of designer input files (form - files) in Qt5. - - - - - QT5_AUTOSCAN_STRATEGY - - - Default value is '0'. When using the Automoc feature of the - Qt5 tool, you can select different strategies for detecting which - files should get moced. The simple approach ('0' as the default) - scans header and source files for the Q_OBJECT macro, so the - trigger 'moc or not' is Q_OBJECT driven. If it is found, the - corresponding file gets moced with the Moc5 - builder. This results in the files 'moc_foo.cc' and 'foo.moc' for - header and source file, respectively. They get added to the list - of sources, for compiling the current library or program. In older - Qt manuals, a different technique for mocing is recommended. A cxx - file includes the moced output of itself or its header at the end. - This approach is somewhat deprecated, but the 'qtsolutions' by Qt - are still based on it, for example. You also might have to switch - older Qt sources to a new version 5.x.y. Then you can set this - variable to '1', for 'include driven' mocing. This means that the - tool searches for '#include' statements in all cxx files, - containing a file pattern 'moc_foo.cpp' and 'foo.moc' for header - and source file, respectively. If the file 'foo.h/foo.cpp' then - contains a Q_OBJECT macro, it gets moced but is NOT added to the - list of sources. This is the important difference between the two - strategies. If no matching include patterns are found for the - current cxx file, the Q_OBJECT driven method (#0) is tried as - fallback. - - - - - QT5_AUTOMOC_SCANCPPPATH - - - The default is '1', meaning that the tool scans for mocable - files not only in the current directory, but also in all CPPPATH - folders (see also QT5_AUTOMOC_CPPPATH). You can - set this variable to '0' to switch it off on rare occasions, e.g. - when too many search folders give you a bad performance in large - projects. - - - - - QT5_AUTOMOC_CPPPATH - - - The list of paths to scan for mocable files (see also - QT5_AUTOMOC_SCANCPPPATH), it is empty by - default which means that the CPPPATH variable is used. You can set - this variable to a subset of CPPPATH in order to improve - performance, i.e. to minimize the search space. - - - - - QT5_GOBBLECOMMENTS - - - Default value is '0' (disabled). When you set this variable - to '1', you enable the automatic removal of C/C++ comments, while - searching for the Q_OBJECT keyword during the Automoc process. - This can be helpful if you have the string Q_OBJECT in one of your - comments, but don't want this file to get moced. - - - - - QT5_CPPDEFINES_PASSTOMOC - - - Default value is '1' (enabled). When you set this variable - to '1', all currently set CPPDEFINES get passed to the moc - executable. It does not matter which strategy you selected with - QT5_AUTOSCAN_STRATEGY or whether you call the - Moc5 builder directly. - - - - - QT5_CLEAN_TS - - - Default value is '0' (disabled). When you set this variable - to '1', the Ts5 builder will delete your .ts - files on a 'scons -c'. Normally, these files for the QtLinguist - are treated as 'precious' (they are not removed prior to a - rebuild) and do not get cleaned. - - - - - QT5_XMOCHPREFIX - - - Default value is 'moc_'. Like - QT5_MOCHPREFIX, this is the prefix for moc - output files, when the source file is a header and the Automoc - strategy #1 (include driven) is used. - - - - - QT5_XMOCHSUFFIX - - - Default value is '.cpp'. Like - QT5_MOCHSUFFIX, this is the suffix for moc - output files, when the source file is a header and the Automoc - strategy #1 (include driven) is used. - - - - - QT5_XMOCCXXPREFIX - - - Default value is ''. Like - QT5_MOCCXXPREFIX, this is the prefix for moc - output files, when source is a cxx file and the Automoc strategy - #1 (include driven) is used. - - - - - QT5_XMOCCXXSUFFIX - - - Default value is '.moc'. Like - QT5_MOCCXXSUFFIX, this is the suffix for moc - output files, when source is a cxx file and the Automoc strategy - #1 (include driven) is used. - - - - - QT5_RCC - - - Default value is 'QT5_BINPATH/rcc'. The - path to the Qt5 rcc executable (resource file compiler). - - - - - QT5_LUPDATE - - - Default value is 'QT5_BINPATH/lupdate'. - The path to the Qt5 lupdate executable (updates the .ts files from - sources). - - - - - QT5_LRELEASE - - - Default value is 'QT5_BINPATH/lrelease'. - The path to the Qt5 lrelease executable (converts .ts files to - binary .qm files). - - - - - QT5_QRCFLAGS - - - Default value is ''. These flags are passed to the Qt5 rcc - executable, when compiling a resource file. - - - - - QT5_LUPDATEFLAGS - - - Default value is ''. These flags are passed to the Qt5 - lupdate executable, when updating .ts files from sources. - - - - - QT5_LRELEASEFLAGS - - - Default value is ''. These flags are passed to the Qt5 - lrelease executable, when compiling .ts files into binary .qm - files. - - - - - QT5_MOCINCPREFIX - - - Default value is '-I'. The prefix for specifying include - directories to the Qt5 moc executable. - - - - - QT5_QRCSUFFIX - - - Default value is '.qrc'. Suffix of Qt5 resource - files. - - - - - QT5_QRCCXXSUFFIX - - - Default value is '$CXXFILESUFFIX'. This is the suffix for - compiled .qrc resource files. - - - - - QT5_QRCCXXPREFIX - - - Default value is 'qrc_'. This is the prefix for compiled - .qrc resource files. - - - - - QT5_MOCINCFLAGS - - - List of include paths for the Qt5 moc executable, is - compiled from QT5_MOCINCPREFIX, - QT5_MOCCPPPATH and - INCSUFFIX. - - - - - QT5_MOCDEFINES - - - List of CPP defines that are passed to the Qt5 moc - executable, is compiled from QT5_MOCDEFPREFIX, - CPPDEFINES and - QT5_MOCDEFSUFFIX. - - - - - QT5_LUPDATECOM - - - Command to update .ts files for translation from the - sources. - - - - - QT5_LUPDATECOMSTR - - - The string displayed when updating .ts files from the - sources. If this is not set, then - QT5_LUPDATECOM (the command line) is - displayed. - - - - - QT5_LRELEASECOM - - - Command to convert .ts files to binary .qm files. - - - - - QT5_LRELEASECOMSTR - - - The string displayed when converting .ts files to binary .qm - files. If this is not set, then QT5_RCC (the - command line) is displayed. - - - -
-
\ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/docs/scons.css b/tests/site_scons/site_tools/qt5/docs/scons.css deleted file mode 100644 index 6941abb..0000000 --- a/tests/site_scons/site_tools/qt5/docs/scons.css +++ /dev/null @@ -1,263 +0,0 @@ -body { - background: #ffffff; - margin: 10px; - padding: 0; - font-family:palatino, georgia, verdana, arial, sans-serif; - } - - -a { - color: #80572a; - } - -a:hover { - color: #d72816; - text-decoration: none; - } - -tt { - color: #a14447; - } - -pre { - background: #e0e0e0; - } - -#main { - border: 1px solid; - border-color: black; - background-color: white; - background-image: url(../images/sconsback.png); - background-repeat: repeat-y 50% 0; - background-position: right top; - margin: 30px auto; - width: 750px; - } - -#banner { - background-image: url(../images/scons-banner.jpg); - border-bottom: 1px solid; - height: 95px; - } - -#menu { - font-family: sans-serif; - font-size: small; - line-height: 0.9em; - float: right; - width: 220px; - clear: both; - margin-top: 10px; - } - -#menu li { - margin-bottom: 7px; - } - -#menu li li { - margin-bottom: 2px; - } - -#menu li.submenuitems { - margin-bottom: 2px; - } - -#menu a { - text-decoration: none; - } - -#footer { - border-top: 1px solid black; - text-align: center; - font-size: small; - color: #822; - margin-top: 4px; - background: #eee; - } - -ul.hack { - list-style-position:inside; - } - -ul.menuitems { - list-style-type: none; - } - -ul.submenuitems { - list-style-type: none; - font-size: smaller; - margin-left: 0; - padding-left: 16px; - } - -ul.subsubmenuitems { - list-style-type: none; - font-size: smaller; - margin-left: 0; - padding-left: 16px; - } - -ol.upper-roman { - list-style-type: upper-roman; - } - -ol.decimal { - list-style-type: decimal; - } - -#currentpage { - font-weight: bold; - } - -#bodycontent { - margin: 15px; - width: 520px; - font-size: small; - line-height: 1.5em; - } - -#bodycontent li { - margin-bottom: 6px; - list-style-type: square; - } - -#sconsdownloadtable downloadtable { - display: table; - margin-left: 5%; - border-spacing: 12px 3px; - } - -#sconsdownloadtable downloadrow { - display: table-row; - } - -#sconsdownloadtable downloadentry { - display: table-cell; - text-align: center; - vertical-align: bottom; - } - -#sconsdownloadtable downloaddescription { - display: table-cell; - font-weight: bold; - text-align: left; - } - -#sconsdownloadtable downloadversion { - display: table-cell; - font-weight: bold; - text-align: center; - } - -#sconsdocversiontable sconsversiontable { - display: table; - margin-left: 10%; - border-spacing: 12px 3px; - } - -#sconsdocversiontable sconsversionrow { - display: table-row; - } - -#sconsdocversiontable docformat { - display: table-cell; - font-weight: bold; - text-align: center; - vertical-align: bottom; - } - -#sconsdocversiontable sconsversion { - display: table-cell; - font-weight: bold; - text-align: left; - } - -#sconsdocversiontable docversion { - display: table-cell; - font-weight: bold; - text-align: center; - } - -#osrating { - margin-left: 35px; - } - - -h2 { - color: #272; - color: #c01714; - font-family: sans-serif; - font-weight: normal; - } - -h2.pagetitle { - font-size: xx-large; - } -h3 { - margin-bottom: 10px; - } - -.date { - font-size: small; - color: gray; - } - -.link { - margin-bottom: 22px; - } - -.linkname { - } - -.linkdesc { - margin: 10px; - margin-top: 0; - } - -.quote { - margin-top: 20px; - margin-bottom: 10px; - background: #f8f8f8; - border: 1px solid; - border-color: #ddd; - } - -.quotetitle { - font-weight: bold; - font-size: large; - margin: 10px; - } - -.quotedesc { - margin-left: 20px; - margin-right: 10px; - margin-bottom: 15px; - } - -.quotetext { - margin-top: 20px; - margin-left: 20px; - margin-right: 10px; - font-style: italic; - } - -.quoteauthor { - font-size: small; - text-align: right; - margin-top: 10px; - margin-right: 7px; - } - -.sconslogo { - font-style: normal; - font-weight: bold; - color: #822; - } - -.downloadlink { - } - -.downloaddescription { - margin-left: 1em; - margin-bottom: 0.4em; - } diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-after b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-after deleted file mode 100644 index 9a0eb95..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-after +++ /dev/null @@ -1,6 +0,0 @@ - -Import("qtEnv") -qtEnv.Append(CPPPATH=['./local_include']) -qtEnv.EnableQt5Modules(['QtCore']) -qtEnv.Program(target = 'aaa', source = 'aaa.cpp') - diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-before b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-before deleted file mode 100644 index d5677bb..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/SConscript-before +++ /dev/null @@ -1,5 +0,0 @@ - -Import("qtEnv") -qtEnv.EnableQt5Modules(['QtCore']) -qtEnv.Program(target = 'aaa', source = 'aaa.cpp') - diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConscript deleted file mode 100644 index f392a40..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConscript +++ /dev/null @@ -1,2 +0,0 @@ - -SConscript('sub/SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConstruct deleted file mode 100644 index d9d897d..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.cpp deleted file mode 100644 index 36dc229..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "aaa.h" - -aaa::aaa() -{ - ; -} - -int main() -{ - aaa a; - return 0; -} - diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.h deleted file mode 100644 index f397b48..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/aaa.h +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include "local_include.h" - -class aaa : public QObject -{ - Q_OBJECT -public: - - aaa(); -}; - - diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/local_include/local_include.h b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/local_include/local_include.h deleted file mode 100644 index b427f9a..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/image/sub/local_include/local_include.h +++ /dev/null @@ -1,3 +0,0 @@ - -/* empty; just needs to be found */ - diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended-fail.py b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended-fail.py deleted file mode 100644 index 8c236b5..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended-fail.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Test that an appended relative CPPPATH works with generated files. - -This is basically the same as CPPPATH.py, but the include path -is env.Append-ed and everything goes into sub directory "sub". -The SConscript does not add the necessary path, such that -the compile run actually fails. Together with the second -test, this demonstrates that the CPPPATH has an effect. - -""" - -import os.path - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('SConscript-before','sub/SConscript') -test.file_fixture('../../../qtenv.py') -test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run(status=2, stderr=None) - -test.pass_test() - - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended.py b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended.py deleted file mode 100644 index 3d3dd7c..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH-appended/sconstest-CPPPATH-appended.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Test that an appended relative CPPPATH works with generated files. - -This is basically the same as CPPPATH.py, but the include path -is env.Append-ed and everything goes into sub directory "sub". -In the SConscript we really add the necessary path, such that -the compile run is successful. See also the accompanying test -that is supposed to fail. - -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('SConscript-after','sub/SConscript') -test.file_fixture('../../../qtenv.py') -test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run(stderr=None) - -test.pass_test() - - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-after b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-after deleted file mode 100644 index 43b0b91..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-after +++ /dev/null @@ -1,3 +0,0 @@ -Import("qtEnv") -qtEnv.EnableQt5Modules(['QtCore']) -qtEnv.Program(target = 'aaa', source = 'aaa.cpp', CPPPATH=['$CPPPATH', './local_include']) diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-before b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-before deleted file mode 100644 index 95ff8a3..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/SConscript-before +++ /dev/null @@ -1,3 +0,0 @@ -Import("qtEnv") -qtEnv.EnableQt5Modules(['QtCore']) -qtEnv.Program(target = 'aaa', source = 'aaa.cpp') diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/SConstruct deleted file mode 100644 index d9d897d..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.cpp deleted file mode 100644 index 36dc229..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "aaa.h" - -aaa::aaa() -{ - ; -} - -int main() -{ - aaa a; - return 0; -} - diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.h deleted file mode 100644 index f397b48..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/aaa.h +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include "local_include.h" - -class aaa : public QObject -{ - Q_OBJECT -public: - - aaa(); -}; - - diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/local_include/local_include.h b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/local_include/local_include.h deleted file mode 100644 index ad85bb2..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/image/local_include/local_include.h +++ /dev/null @@ -1,2 +0,0 @@ - -/* empty; just needs to be found */ diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH-fail.py b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH-fail.py deleted file mode 100644 index ad0ca4a..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH-fail.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Test that CPPPATH works with generated files. - -The SConscript does not add the necessary path, such that -the compile run actually fails. Together with the second -test, this demonstrates that the CPPPATH has an effect. - -""" - -import os.path - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('SConscript-before','SConscript') -test.file_fixture('../../../qtenv.py') -test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run(status=2, stderr=None) - -test.pass_test() - - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH.py b/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH.py deleted file mode 100644 index 293933f..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/CPPPATH/CPPPATH/sconstest-CPPPATH.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Test that CPPPATH works with generated files. - -In the SConscript we really add the necessary path, such that -the compile run is successful. See also the accompanying test -that is supposed to fail. -""" - -import os.path - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('SConscript-after','SConscript') -test.file_fixture('../../../qtenv.py') -test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run(stderr=None) - -test.pass_test() - - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.cpp deleted file mode 100644 index b5f3f8f..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.cpp +++ /dev/null @@ -1,5 +0,0 @@ - -#include "MyFile.h" -void useit() { - aaa(); -} diff --git a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.h deleted file mode 100644 index 8b2a3f8..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/MyFile.h +++ /dev/null @@ -1,2 +0,0 @@ - -void aaa(void) {}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConscript deleted file mode 100644 index fc7668b..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConscript +++ /dev/null @@ -1,11 +0,0 @@ -Import("qtEnv") -qtEnv.Append(CPPDEFINES = ['FOOBAZ']) - -copy = qtEnv.Clone() -copy.Append(CPPDEFINES = ['MYLIB_IMPL']) -copy.EnableQt5Modules(['QtCore']) - -copy.SharedLibrary( - target = 'MyLib', - source = ['MyFile.cpp'] -) diff --git a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConstruct deleted file mode 100644 index d9d897d..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/copied-env/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - diff --git a/tests/site_scons/site_tools/qt5/test/basic/copied-env/sconstest-copied-env.py b/tests/site_scons/site_tools/qt5/test/basic/copied-env/sconstest-copied-env.py deleted file mode 100644 index 95b3ed0..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/copied-env/sconstest-copied-env.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Test Qt with a copied construction environment. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run() - -cpp_MyFile = [x for x in test.stdout().split('\n') if x.find('MyFile.cpp') != -1] - -for x in cpp_MyFile: - if ((x.find('MYLIB_IMPL') < 0) or (x.find('FOOBAZ') < 0)): - print "Did not find MYLIB_IMPL and FOOBAZ on MyFile.cpp compilation line:" - print test.stdout() - test.fail_test() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/SConstruct deleted file mode 100755 index f7c3e64..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/SConstruct +++ /dev/null @@ -1,4 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -qtEnv.Program('main', 'main.cpp', CPPDEFINES=['FOO'], LIBS=[]) diff --git a/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/foo6.h b/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/foo6.h deleted file mode 100644 index 734d7c7..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/foo6.h +++ /dev/null @@ -1,8 +0,0 @@ -#include -void -foo6(void) -{ -#ifdef FOO - printf("qt/include/foo6.h\n"); -#endif -} diff --git a/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/main.cpp b/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/main.cpp deleted file mode 100755 index cedf3cb..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/empty-env/image/main.cpp +++ /dev/null @@ -1,3 +0,0 @@ - -#include "foo6.h" -int main() { foo6(); return 0; } diff --git a/tests/site_scons/site_tools/qt5/test/basic/empty-env/sconstest-empty-env.py b/tests/site_scons/site_tools/qt5/test/basic/empty-env/sconstest-empty-env.py deleted file mode 100755 index bc894b3..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/empty-env/sconstest-empty-env.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test Qt creation from a copied empty environment. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run() - -test.run(program = test.workpath('main' + TestSCons._exe), - stderr = None, - stdout = 'qt/include/foo6.h\n') - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConscript deleted file mode 100755 index 085947e..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConscript +++ /dev/null @@ -1,20 +0,0 @@ -Import("qtEnv") -sources = ['aaa.cpp', 'bbb.cpp', 'ddd.cpp', 'eee.cpp', 'main.cpp'] - -qtEnv.EnableQt5Modules(['QtCore','QtGui']) - -# normal invocation -sources.append(qtEnv.Moc5('include/aaa.h')) -sources.append(qtEnv.Moc5('ui/ccc.h')) -qtEnv.Moc5('bbb.cpp') -qtEnv.Uic5('ui/ccc.ui') - -# manual target specification -sources.append(qtEnv.ExplicitMoc5('moc-ddd.cpp','include/ddd.h')) -qtEnv.ExplicitMoc5('moc_eee.cpp','eee.cpp') -qtEnv.ExplicitUic5('include/uic_fff.hpp','ui/fff.ui') - -qtEnv.Program(target='aaa', - source=sources, - CPPPATH=['$CPPPATH', './include'], - QT5_AUTOSCAN=0) diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConstruct deleted file mode 100755 index d9d897d..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/aaa.cpp deleted file mode 100755 index cbd37c1..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/aaa.cpp +++ /dev/null @@ -1,2 +0,0 @@ - -#include "aaa.h" diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.cpp deleted file mode 100755 index 159cc07..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "bbb.h" - -#include - -class bbb : public QObject -{ - Q_OBJECT - -public: - bbb() {}; -}; - -#include "bbb.moc" - -void b_dummy() -{ - bbb b; -} diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.h b/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.h deleted file mode 100755 index c3ec38e..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/bbb.h +++ /dev/null @@ -1,2 +0,0 @@ - -extern void b_dummy(void); diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ddd.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ddd.cpp deleted file mode 100755 index cd59f26..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ddd.cpp +++ /dev/null @@ -1,2 +0,0 @@ - -#include "ddd.h" diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.cpp deleted file mode 100755 index 38cb3e3..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include - -class eee : public QObject -{ - Q_OBJECT - -public: - eee() {}; -}; - -#include "moc_eee.cpp" - -void e_dummy() -{ - eee e; -} diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.h b/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.h deleted file mode 100755 index cb2fe43..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/eee.h +++ /dev/null @@ -1,2 +0,0 @@ - -extern void e_dummy(void); diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/fff.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/fff.cpp deleted file mode 100755 index 9e5f80d..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/fff.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "uic_fff.hpp" diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/aaa.h deleted file mode 100755 index 3438edd..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/aaa.h +++ /dev/null @@ -1,9 +0,0 @@ -#include - -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa() {}; -}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/ddd.h b/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/ddd.h deleted file mode 100755 index 872a4b2..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/include/ddd.h +++ /dev/null @@ -1,9 +0,0 @@ -#include - -class ddd : public QObject -{ - Q_OBJECT - -public: - ddd() {}; -}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/main.cpp b/tests/site_scons/site_tools/qt5/test/basic/manual/image/main.cpp deleted file mode 100755 index 74af94a..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/main.cpp +++ /dev/null @@ -1,17 +0,0 @@ - -#include "aaa.h" -#include "bbb.h" -#include "ui/ccc.h" -#include "ddd.h" -#include "eee.h" -#include "uic_fff.hpp" - -int main() { - aaa a; - b_dummy(); - ccc c; - ddd d; - e_dummy(); - - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.h b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.h deleted file mode 100755 index 073dd1a..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.h +++ /dev/null @@ -1,9 +0,0 @@ -#include - -class ccc : public QObject -{ - Q_OBJECT - -public: - ccc() {}; -}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.ui b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.ui deleted file mode 100644 index 87fffd4..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/ccc.ui +++ /dev/null @@ -1,19 +0,0 @@ - - - Form - - - - 0 - 0 - 288 - 108 - - - - Form - - - - - diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/fff.ui b/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/fff.ui deleted file mode 100644 index 180d91f..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/image/ui/fff.ui +++ /dev/null @@ -1,19 +0,0 @@ - - - Form2 - - - - 0 - 0 - 288 - 108 - - - - Form2 - - - - - diff --git a/tests/site_scons/site_tools/qt5/test/basic/manual/sconstest-manual.py b/tests/site_scons/site_tools/qt5/test/basic/manual/sconstest-manual.py deleted file mode 100755 index 8b30365..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/manual/sconstest-manual.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test the manual QT builder calls. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -test.run() - -# normal invocation -test.must_exist(test.workpath('include', 'moc_aaa.cc')) -test.must_exist(test.workpath('bbb.moc')) -test.must_exist(test.workpath('ui', 'ccc.h')) -test.must_exist(test.workpath('ui', 'moc_ccc.cc')) - -# manual target spec. -test.must_exist(test.workpath('moc-ddd.cpp')) -test.must_exist(test.workpath('moc_eee.cpp')) -test.must_exist(test.workpath('include', 'uic_fff.hpp')) -test.must_exist(test.workpath('fff.cpp')) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConscript deleted file mode 100755 index 571778e..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConscript +++ /dev/null @@ -1,7 +0,0 @@ -Import("qtEnv dup") - -qtEnv.EnableQt5Modules(['QtCore','QtGui']) - -if dup == 0: qtEnv.Append(CPPPATH=['.']) -aaa_lib = qtEnv.StaticLibrary('aaa',['aaa.cpp','useit.cpp']) -qtEnv.Alias('aaa_lib', aaa_lib) diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConstruct deleted file mode 100755 index 28a7941..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/SConstruct +++ /dev/null @@ -1,24 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() - -dup = 1 -if ARGUMENTS.get('variant_dir', 0): - if ARGUMENTS.get('chdir', 0): - SConscriptChdir(1) - else: - SConscriptChdir(0) - dup=int(ARGUMENTS.get('dup', 1)) - if dup == 0: - builddir = 'build_dup0' - qtEnv['QT5_DEBUG'] = 1 - else: - builddir = 'build' - VariantDir(builddir, '.', duplicate=dup) - print builddir, dup - sconscript = Dir(builddir).File('SConscript') -else: - sconscript = File('SConscript') - -Export("qtEnv dup") -SConscript( sconscript ) diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.cpp deleted file mode 100755 index 07a28ef..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "aaa.h" - -#include - -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa() {}; -}; - -#include "aaa.moc" - -void dummy_a() -{ - aaa a; -} diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.h deleted file mode 100755 index 8626f9f..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/aaa.h +++ /dev/null @@ -1,2 +0,0 @@ - -extern void dummy_a(void); diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/useit.cpp b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/useit.cpp deleted file mode 100755 index 0942ec3..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/image/useit.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "aaa.h" -void useit() { - dummy_a(); -} diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/sconstest-moc-from-cpp.py b/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/sconstest-moc-from-cpp.py deleted file mode 100755 index feee87c..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-cpp/sconstest-moc-from-cpp.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Create a moc file from a cpp file. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -lib_aaa = 'aaa_lib' # Alias for the Library -moc = 'aaa.moc' - -test.run(arguments=lib_aaa, - stderr=TestSCons.noisy_ar, - match=TestSCons.match_re_dotall) - -test.up_to_date(options = '-n', arguments = lib_aaa) - -test.write('aaa.cpp', r""" -#include "aaa.h" - -#include - -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa() {}; -}; - -#include "%s" - -// Using the class -void dummy_a() -{ - aaa a; -} -""" % moc) - -test.not_up_to_date(options = '-n', arguments = moc) - -test.run(options = '-c', arguments = lib_aaa) - -test.run(arguments = "variant_dir=1 " + lib_aaa, - stderr=TestSCons.noisy_ar, - match=TestSCons.match_re_dotall) - -test.run(arguments = "variant_dir=1 chdir=1 " + lib_aaa) - -test.must_exist(test.workpath('build', moc)) - -test.run(arguments = "variant_dir=1 dup=0 " + lib_aaa, - stderr=TestSCons.noisy_ar, - match=TestSCons.match_re_dotall) - -test.must_exist(test.workpath('build_dup0', moc)) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConscript deleted file mode 100755 index 4307a75..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConscript +++ /dev/null @@ -1,8 +0,0 @@ -Import("qtEnv dup") - -qtEnv.EnableQt5Modules(['QtCore','QtGui']) - -if dup == 0: qtEnv.Append(CPPPATH=['.', '#build_dup0']) -qtEnv.Program('aaa', 'aaa.cpp', - QT5_MOCHPREFIX = 'moc_', - QT5_MOCHSUFFIX = '.cc') diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConstruct deleted file mode 100755 index 28a7941..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/SConstruct +++ /dev/null @@ -1,24 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() - -dup = 1 -if ARGUMENTS.get('variant_dir', 0): - if ARGUMENTS.get('chdir', 0): - SConscriptChdir(1) - else: - SConscriptChdir(0) - dup=int(ARGUMENTS.get('dup', 1)) - if dup == 0: - builddir = 'build_dup0' - qtEnv['QT5_DEBUG'] = 1 - else: - builddir = 'build' - VariantDir(builddir, '.', duplicate=dup) - print builddir, dup - sconscript = Dir(builddir).File('SConscript') -else: - sconscript = File('SConscript') - -Export("qtEnv dup") -SConscript( sconscript ) diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.cpp deleted file mode 100644 index d8b45aa..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "moc_aaa.cc" - -int main() -{ - aaa a; - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.h deleted file mode 100755 index 3438edd..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/image/aaa.h +++ /dev/null @@ -1,9 +0,0 @@ -#include - -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa() {}; -}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/sconstest-moc-from-header-nocompile.py b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/sconstest-moc-from-header-nocompile.py deleted file mode 100755 index 3e905a7..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header-nocompile/sconstest-moc-from-header-nocompile.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Create a moc file from a header file, but don't -compile it to an Object because the moc'ed output gets directly -included to the CXX file. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -aaa_exe = 'aaa' + TestSCons._exe -build_aaa_exe = test.workpath('build', aaa_exe) -moc = 'moc_aaa.cc' -moc_obj = 'moc_aaa' + TestSCons._obj - -test.run() - -# Ensure that the object file for the MOC output wasn't generated -test.must_not_exist(moc_obj) - -test.up_to_date(options = '-n', arguments=aaa_exe) -test.up_to_date(options = '-n', arguments=aaa_exe) - -test.write('aaa.h', r""" -#include - -// Introducing a change... -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa() {}; -}; -""") - -test.not_up_to_date(options='-n', arguments = moc) - -test.run(arguments = "variant_dir=1 " + build_aaa_exe) - -test.run(arguments = "variant_dir=1 chdir=1 " + build_aaa_exe) - -test.must_exist(test.workpath('build', moc)) -test.must_not_exist(test.workpath('build', moc_obj)) - -test.run(options='-c') - -test.run(arguments = "variant_dir=1 chdir=1 dup=0 " + - test.workpath('build_dup0', aaa_exe) ) - -test.must_exist(test.workpath('build_dup0', moc)) -test.must_not_exist(moc_obj) -test.must_not_exist(test.workpath('build_dup0', moc_obj)) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConscript deleted file mode 100755 index 4486ee8..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConscript +++ /dev/null @@ -1,6 +0,0 @@ -Import("qtEnv dup") - -qtEnv.EnableQt5Modules(['QtCore','QtGui']) - -if dup == 0: qtEnv.Append(CPPPATH=['.']) -qtEnv.Program('aaa','aaa.cpp') diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConstruct deleted file mode 100755 index 28a7941..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/SConstruct +++ /dev/null @@ -1,24 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() - -dup = 1 -if ARGUMENTS.get('variant_dir', 0): - if ARGUMENTS.get('chdir', 0): - SConscriptChdir(1) - else: - SConscriptChdir(0) - dup=int(ARGUMENTS.get('dup', 1)) - if dup == 0: - builddir = 'build_dup0' - qtEnv['QT5_DEBUG'] = 1 - else: - builddir = 'build' - VariantDir(builddir, '.', duplicate=dup) - print builddir, dup - sconscript = Dir(builddir).File('SConscript') -else: - sconscript = File('SConscript') - -Export("qtEnv dup") -SConscript( sconscript ) diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.cpp deleted file mode 100644 index 054d582..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "aaa.h" - -int main() -{ - aaa a; - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.h b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.h deleted file mode 100755 index 3438edd..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/image/aaa.h +++ /dev/null @@ -1,9 +0,0 @@ -#include - -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa() {}; -}; diff --git a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/sconstest-moc-from-header.py b/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/sconstest-moc-from-header.py deleted file mode 100755 index ab5a0de..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/moc-from-header/sconstest-moc-from-header.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Create a moc file from a header file. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -aaa_exe = 'aaa' + TestSCons._exe -build_aaa_exe = test.workpath('build', aaa_exe) -moc = 'moc_aaa.cc' - -test.run() - -test.up_to_date(options = '-n', arguments=aaa_exe) -test.up_to_date(options = '-n', arguments=aaa_exe) - -test.write('aaa.h', r""" -#include - -// Introducing a change... -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa() {}; -}; -""") - -test.not_up_to_date(options='-n', arguments = moc) - -test.run(arguments = "variant_dir=1 " + build_aaa_exe) - -test.run(arguments = "variant_dir=1 chdir=1 " + build_aaa_exe) - -test.must_exist(test.workpath('build', moc)) - -test.run(arguments = "variant_dir=1 chdir=1 dup=0 " + - test.workpath('build_dup0', aaa_exe) ) - -test.must_exist(['build_dup0', moc]) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConscript b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConscript deleted file mode 100755 index 163e252..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConscript +++ /dev/null @@ -1,4 +0,0 @@ -Import("qtEnv") -env = qtEnv.Clone(tool='qt5') - -env.Program('main', 'main.cpp', CPPDEFINES=['FOO'], LIBS=[]) diff --git a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConstruct deleted file mode 100755 index d9d897d..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - diff --git a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/foo5.h b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/foo5.h deleted file mode 100644 index 5ac79c8..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/foo5.h +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#ifdef FOO -void foo5(void) -{ - printf("qt/include/foo5.h\\n"); -} -#endif diff --git a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/main.cpp b/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/main.cpp deleted file mode 100755 index 0ea9300..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/reentrant/image/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "foo5.h" - -int main() -{ - foo5(); - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/basic/reentrant/sconstest-reentrant.py b/tests/site_scons/site_tools/qt5/test/basic/reentrant/sconstest-reentrant.py deleted file mode 100755 index 97487f5..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/reentrant/sconstest-reentrant.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test creation from a copied environment that already has QT variables. -This makes sure the tool initialization is re-entrant. -""" - -import TestSCons - -test = TestSCons.TestSCons() - -test.dir_fixture('image') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.cpp b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.cpp deleted file mode 100644 index cdeb4a6..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "MyForm.h" - -#include - -MyForm::MyForm(QWidget *parent) : QWidget(parent) -{ - ui.setupUi(this); -} - -void MyForm::testSlot() -{ - printf("Hello World\n"); -} - diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.h b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.h deleted file mode 100644 index fa2d119..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/MyForm.h +++ /dev/null @@ -1,18 +0,0 @@ -#include "ui_anUiFile.h" - -#include - -class MyForm : public QWidget -{ - Q_OBJECT - - public: - MyForm(QWidget *parent = 0); - - public slots: - void testSlot(); - - private: - Ui::Form ui; -}; - diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/SConstruct b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/SConstruct deleted file mode 100644 index 56d7a18..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/SConstruct +++ /dev/null @@ -1,12 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -qtEnv.EnableQt5Modules(['QtCore','QtWidgets']) - -qtEnv.VariantDir('bld', '.') -qtEnv.Uic5('bld/anUiFile.ui') -qtEnv.Program('bld/test_realqt', ['bld/mocFromCpp.cpp', - 'bld/mocFromH.cpp', - 'bld/MyForm.cpp', - 'bld/main.cpp']) - diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/anUiFile.ui b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/anUiFile.ui deleted file mode 100644 index 87fffd4..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/anUiFile.ui +++ /dev/null @@ -1,19 +0,0 @@ - - - Form - - - - 0 - 0 - 288 - 108 - - - - Form - - - - - diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/main.cpp b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/main.cpp deleted file mode 100644 index 5212903..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "mocFromCpp.h" -#include "mocFromH.h" -#include "MyForm.h" - -#include -#include - -int main(int argc, char **argv) { - QApplication app(argc, argv); - mocFromCpp(); - mocFromH(); - MyForm mywidget; - mywidget.testSlot(); - printf("Hello World\n"); - return 0; -} - diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.cpp deleted file mode 100644 index 1d5b560..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include - -#include "mocFromCpp.h" - -class MyClass1 : public QObject { - Q_OBJECT - public: - MyClass1() : QObject() {}; - public slots: - void myslot() {}; -}; -void mocFromCpp() { - MyClass1 myclass; -} -#include "mocFromCpp.moc" - diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.h deleted file mode 100644 index fc1e04c..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromCpp.h +++ /dev/null @@ -1,2 +0,0 @@ -void mocFromCpp(); - diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.cpp deleted file mode 100644 index 586aafb..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "mocFromH.h" - -MyClass2::MyClass2() : QObject() {} -void MyClass2::myslot() {} -void mocFromH() { - MyClass2 myclass; -} - diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.h b/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.h deleted file mode 100644 index 48fdd7e..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/variantdir/image/mocFromH.h +++ /dev/null @@ -1,11 +0,0 @@ -#include - -class MyClass2 : public QObject { - Q_OBJECT; - public: - MyClass2(); - public slots: - void myslot(); -}; -void mocFromH(); - diff --git a/tests/site_scons/site_tools/qt5/test/basic/variantdir/sconstest-installed.py b/tests/site_scons/site_tools/qt5/test/basic/variantdir/sconstest-installed.py deleted file mode 100644 index 7cef5c4..0000000 --- a/tests/site_scons/site_tools/qt5/test/basic/variantdir/sconstest-installed.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -A simple test for VariantDir, in connection with basic -automocing from cxx and header files and the Uic5 builder. -""" - -import sys - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -test.run(arguments="bld/test_realqt" + TestSCons._exe) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConscript b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConscript deleted file mode 100644 index d560985..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConscript +++ /dev/null @@ -1,9 +0,0 @@ -Import("qtEnv") - -env = qtEnv.Clone() -env['QT5_GOBBLECOMMENTS']=1 -env['QT5_DEBUG']=1 -env.EnableQt5Modules(['QtCore','QtWidgets']) - -env.Program('main', Glob('*.cpp')) - diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConstruct deleted file mode 100644 index 9754f10..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') - -SConscript('SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/main.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/main.cpp deleted file mode 100644 index 6d8b713..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "mocFromCpp.h" -#include "mocFromH.h" - -#include -#include - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - mocFromCpp(); - mocFromH(); - printf("Hello World\n"); - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.cpp deleted file mode 100644 index b4a24ec..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#include "mocFromCpp.h" - - -/* - -class MyClass1 : public QObject { - Q_OBJECT - public: - MyClass1() : QObject() {}; - public slots: - void myslot() {}; -}; -void mocFromCpp() { - MyClass1 myclass; -} -#include "mocFromCpp.moc" - -*/ - -// class MyClass1 : public QObject { Q_OBJECT; }; - -class MyClass1 -{ - // Q_OBJECT - - /* and another Q_OBJECT but in - * a C comment, - * ... next Q_OBJECT - */ - -public: - MyClass1() {}; - void myslot() {}; -}; - -void mocFromCpp() -{ - MyClass1 myclass; -} diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.h deleted file mode 100644 index fc1e04c..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromCpp.h +++ /dev/null @@ -1,2 +0,0 @@ -void mocFromCpp(); - diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.cpp deleted file mode 100644 index 7cfb2be..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mocFromH.h" - -MyClass2::MyClass2(){} - -void MyClass2::myslot() {} - -void mocFromH() { - MyClass2 myclass; -} - diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.h b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.h deleted file mode 100644 index 6a96ca2..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/image/mocFromH.h +++ /dev/null @@ -1,32 +0,0 @@ -#include - -/* -class MyClass2 : public QObject { - // Here we define a Q_OBJECT - Q_OBJECT; - public: - MyClass2(); - public slots: - void myslot(); -}; -void mocFromH(); - -*/ - -// class MyClass2 : public QObject { Q_OBJECT; }; - -class MyClass2 -{ - // Q_OBJECT - - /* and another Q_OBJECT but in - * a C comment, - * ... next Q_OBJECT - */ - -public: - MyClass2(); - void myslot(); -}; - -void mocFromH(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/sconstest-ccomment.py b/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/sconstest-ccomment.py deleted file mode 100644 index 842909c..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/ccomment/sconstest-ccomment.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -A simple test for a few C/C++ comments, containing the -string Q_OBJECT. With the QT5_GOBBLECOMMENTS variable set, -no automocing should get triggered. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('../../../qtenv.py') -test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConscript b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConscript deleted file mode 100644 index 1366183..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConscript +++ /dev/null @@ -1,6 +0,0 @@ -Import("qtEnv") - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) - -env.Program('main', Glob('*.cpp')) diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConstruct deleted file mode 100644 index 9754f10..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') - -SConscript('SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/main.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/main.cpp deleted file mode 100644 index 6d8b713..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "mocFromCpp.h" -#include "mocFromH.h" - -#include -#include - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - mocFromCpp(); - mocFromH(); - printf("Hello World\n"); - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.cpp deleted file mode 100644 index 407cc41..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "mocFromCpp.h" - -#include -#include - -class MyClass1 -{ -public: - MyClass1() {}; - void myslot() {}; - void printme() - { - printf("It's a Q_OBJECT!"); - printf("Concatenating " - "a Q_OBJECT" - " with another " - "Q_OBJECT" - "and a " - "Q_OBJECT, finally"); - }; - -}; - -void mocFromCpp() -{ - MyClass1 myclass; -} diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.h deleted file mode 100644 index fc1e04c..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromCpp.h +++ /dev/null @@ -1,2 +0,0 @@ -void mocFromCpp(); - diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.cpp deleted file mode 100644 index 7cfb2be..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mocFromH.h" - -MyClass2::MyClass2(){} - -void MyClass2::myslot() {} - -void mocFromH() { - MyClass2 myclass; -} - diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.h b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.h deleted file mode 100644 index 6868c89..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/image/mocFromH.h +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include - -class MyClass2 -{ -public: - MyClass2(); - void myslot(); - void printme() - { - printf("It's a Q_OBJECT!"); - printf("Concatenating " - "a Q_OBJECT" - " with another " - "Q_OBJECT" - "and a " - "Q_OBJECT, finally"); - }; -}; - -void mocFromH(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/sconstest-literalstring.py b/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/sconstest-literalstring.py deleted file mode 100644 index 3d63113..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/auto/literalstring/sconstest-literalstring.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -A simple test, ensuring that the Q_OBJECT keyword in a -literal C/C++ string does not trigger automocing. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('../../../qtenv.py') -test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript deleted file mode 100644 index 81a9851..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript +++ /dev/null @@ -1,8 +0,0 @@ -Import("qtEnv") - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) -env.Append(CPPPATH=['include']) - -env.Program('main', Glob('src/*.cpp')) - diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript-fails b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript-fails deleted file mode 100644 index 8e3fcc6..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/SConscript-fails +++ /dev/null @@ -1,9 +0,0 @@ -Import("qtEnv") - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) -env.Append(CPPPATH=['include']) -env['QT5_AUTOMOC_SCANCPPPATH']='0' - -env.Program('main', Glob('src/*.cpp')) - diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/SConstruct deleted file mode 100644 index 9754f10..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') - -SConscript('SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromCpp.h deleted file mode 100644 index 84097dd..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromCpp.h +++ /dev/null @@ -1 +0,0 @@ -void mocFromCpp(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromH.h b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromH.h deleted file mode 100644 index 79fda5a..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/include/mocFromH.h +++ /dev/null @@ -1,11 +0,0 @@ -#include - -class MyClass2 : public QObject { - // Here we define a Q_OBJECT - Q_OBJECT; - public: - MyClass2(); - public slots: - void myslot(); -}; -void mocFromH(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/main.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/main.cpp deleted file mode 100644 index 6d8b713..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "mocFromCpp.h" -#include "mocFromH.h" - -#include -#include - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - mocFromCpp(); - mocFromH(); - printf("Hello World\n"); - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromCpp.cpp deleted file mode 100644 index e18d1b8..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromCpp.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include - -#include "mocFromCpp.h" - -class MyClass1 : public QObject { - Q_OBJECT - public: - MyClass1() : QObject() {}; - public slots: - void myslot() {}; -}; -void mocFromCpp() { - MyClass1 myclass; -} -#include "mocFromCpp.moc" diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromH.cpp deleted file mode 100644 index 7cfb2be..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/image/src/mocFromH.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mocFromH.h" - -MyClass2::MyClass2(){} - -void MyClass2::myslot() {} - -void mocFromH() { - MyClass2 myclass; -} - diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default-fails.py b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default-fails.py deleted file mode 100644 index 469c0b5..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default-fails.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Disabled the CPPPATH support of the Automoc feature: -uses the CPPPATH list of the current environment, but still fails. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('SConscript-fails','SConscript') -test.file_fixture('../../../qtenv.py') -test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -test.run(status=2, stderr=None) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default.py b/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default.py deleted file mode 100644 index 586deb3..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/default/sconstest-default.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Default settings for the CPPPATH support of the Automoc feature: -it is enabled and uses the CPPPATH list of the current environment. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('SConscript','SConscript') -test.file_fixture('../../../qtenv.py') -test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript deleted file mode 100644 index ea6157e..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript +++ /dev/null @@ -1,9 +0,0 @@ -Import("qtEnv") - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) -env.Append(CPPPATH=['include']) -env['QT5_AUTOMOC_CPPPATH']=['include'] - -env.Program('main', Glob('src/*.cpp')) - diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript-fails b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript-fails deleted file mode 100644 index 90689ee..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/SConscript-fails +++ /dev/null @@ -1,9 +0,0 @@ -Import("qtEnv") - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) -env.Append(CPPPATH=['include']) -env['QT5_AUTOMOC_CPPPATH']=['wrongdir'] - -env.Program('main', Glob('src/*.cpp')) - diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/SConstruct deleted file mode 100644 index 9754f10..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') - -SConscript('SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromCpp.h deleted file mode 100644 index 84097dd..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromCpp.h +++ /dev/null @@ -1 +0,0 @@ -void mocFromCpp(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromH.h b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromH.h deleted file mode 100644 index 79fda5a..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/include/mocFromH.h +++ /dev/null @@ -1,11 +0,0 @@ -#include - -class MyClass2 : public QObject { - // Here we define a Q_OBJECT - Q_OBJECT; - public: - MyClass2(); - public slots: - void myslot(); -}; -void mocFromH(); diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/main.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/main.cpp deleted file mode 100644 index 6d8b713..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "mocFromCpp.h" -#include "mocFromH.h" - -#include -#include - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - mocFromCpp(); - mocFromH(); - printf("Hello World\n"); - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromCpp.cpp deleted file mode 100644 index e18d1b8..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromCpp.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include - -#include "mocFromCpp.h" - -class MyClass1 : public QObject { - Q_OBJECT - public: - MyClass1() : QObject() {}; - public slots: - void myslot() {}; -}; -void mocFromCpp() { - MyClass1 myclass; -} -#include "mocFromCpp.moc" diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromH.cpp deleted file mode 100644 index 7cfb2be..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/image/src/mocFromH.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mocFromH.h" - -MyClass2::MyClass2(){} - -void MyClass2::myslot() {} - -void mocFromH() { - MyClass2 myclass; -} - diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific-fails.py b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific-fails.py deleted file mode 100644 index b301e80..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific-fails.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Explicitly sets the path list to scan for mocable files, -but to a wrong folder. -Although the correct CPPPATH is used, this lets the test -fail...and proves that the option QT5_AUTOMOC_CPPPATH -really has an effect. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('SConscript-fails','SConscript') -test.file_fixture('../../../qtenv.py') -test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -test.run(status=2, stderr=None) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific.py b/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific.py deleted file mode 100644 index a9ba087..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/cpppath/specific/sconstest-specific.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Explicitly sets the path list to scan for moc'able files. -The correct CPPPATH is used too, but gets only searched for -normal implicit header dependencies (as is proved by the -the accompanying test that fails). -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('SConscript','SConscript') -test.file_fixture('../../../qtenv.py') -test.file_fixture('../../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConscript b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConscript deleted file mode 100644 index f224ec9..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConscript +++ /dev/null @@ -1,10 +0,0 @@ -Import("qtEnv") - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) -env['QT5_AUTOSCAN']=0 - -env.ExplicitMoc5('explicitly_moced_FromHeader.cpp','mocFromH.h') -env.ExplicitMoc5('explicitly_moced_FromCpp.strange_cpp_moc_prefix','mocFromCpp.cpp') - -env.Program('main', Glob('*.cpp')) diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConstruct deleted file mode 100644 index 9754f10..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') - -SConscript('SConscript') diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/main.cpp b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/main.cpp deleted file mode 100644 index 6d8b713..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "mocFromCpp.h" -#include "mocFromH.h" - -#include -#include - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - mocFromCpp(); - mocFromH(); - printf("Hello World\n"); - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.cpp b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.cpp deleted file mode 100644 index 669d7a1..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include - -#include "mocFromCpp.h" - -class MyClass1 : public QObject { - Q_OBJECT - public: - MyClass1() : QObject() {}; - public slots: - void myslot() {}; -}; -void mocFromCpp() { - MyClass1 myclass; -} -#include "explicitly_moced_FromCpp.strange_cpp_moc_prefix" - diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.h b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.h deleted file mode 100644 index fc1e04c..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromCpp.h +++ /dev/null @@ -1,2 +0,0 @@ -void mocFromCpp(); - diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.cpp b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.cpp deleted file mode 100644 index 586aafb..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "mocFromH.h" - -MyClass2::MyClass2() : QObject() {} -void MyClass2::myslot() {} -void mocFromH() { - MyClass2 myclass; -} - diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.h b/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.h deleted file mode 100644 index 48fdd7e..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/explicit/image/mocFromH.h +++ /dev/null @@ -1,11 +0,0 @@ -#include - -class MyClass2 : public QObject { - Q_OBJECT; - public: - MyClass2(); - public slots: - void myslot(); -}; -void mocFromH(); - diff --git a/tests/site_scons/site_tools/qt5/test/moc/explicit/sconstest-explicit.py b/tests/site_scons/site_tools/qt5/test/moc/explicit/sconstest-explicit.py deleted file mode 100644 index f5e78fe..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/explicit/sconstest-explicit.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Test of the explicit Moc5 builder, with arbitrary filenames -for the created files. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConscript b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConscript deleted file mode 100644 index a8b791c..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConscript +++ /dev/null @@ -1,12 +0,0 @@ -Import("qtEnv dup reverted") - -qtEnv.EnableQt5Modules(['QtCore','QtGui']) - -if dup == 0: - qtEnv.Append(CPPPATH=['.']) - -if reverted == 0: - qtEnv.Program('aaa',['aaa.cpp','bbb.cpp']) -else: - qtEnv.Program('aaa',['bbb.cpp','aaa.cpp']) - diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConstruct b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConstruct deleted file mode 100644 index 3ee88b6..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/SConstruct +++ /dev/null @@ -1,25 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() - -reverted=int(ARGUMENTS.get('reverted', 0)) -dup = 1 -if ARGUMENTS.get('variant_dir', 0): - if ARGUMENTS.get('chdir', 0): - SConscriptChdir(1) - else: - SConscriptChdir(0) - dup=int(ARGUMENTS.get('dup', 1)) - if dup == 0: - builddir = 'build_dup0' - qtEnv['QT5_DEBUG'] = 1 - else: - builddir = 'build' - VariantDir(builddir, '.', duplicate=dup) - print builddir, dup - sconscript = Dir(builddir).File('SConscript') -else: - sconscript = File('SConscript') - -Export("qtEnv dup reverted") -SConscript( sconscript ) diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.cpp b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.cpp deleted file mode 100644 index 054d582..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "aaa.h" - -int main() -{ - aaa a; - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.h b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.h deleted file mode 100644 index 3438edd..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/aaa.h +++ /dev/null @@ -1,9 +0,0 @@ -#include - -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa() {}; -}; diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/bbb.cpp b/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/bbb.cpp deleted file mode 100644 index 6fc20da..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/order_independent/image/bbb.cpp +++ /dev/null @@ -1,4 +0,0 @@ -int bbb() -{ - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/moc/order_independent/sconstest-order-independent.py b/tests/site_scons/site_tools/qt5/test/moc/order_independent/sconstest-order-independent.py deleted file mode 100644 index 083bd7b..0000000 --- a/tests/site_scons/site_tools/qt5/test/moc/order_independent/sconstest-order-independent.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -""" -Ensures that no rebuilds get triggered when the order of the source -list changes in the Automoc routine(s). -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture('image') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') - -test.run() -test.up_to_date(options="-n", arguments=".") -test.up_to_date(options="-n reverted=1", arguments=".") -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript deleted file mode 100644 index 1bcb156..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript +++ /dev/null @@ -1,8 +0,0 @@ -Import('qtEnv') - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) - -source_files = Glob('*.cpp')+Glob('*.qrc') - -env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript-wflags b/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript-wflags deleted file mode 100644 index bf987fc..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/basic/SConscript-wflags +++ /dev/null @@ -1,9 +0,0 @@ -Import('qtEnv') - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) - -source_files = Glob('*.cpp')+Glob('*.qrc') -env['QT5_QRCFLAGS'] = ['-name', 'icons'] - -env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/basic/image/SConstruct deleted file mode 100644 index 00e5705..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/basic/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons.qrc deleted file mode 100644 index 86fe71b..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - icons/scons.png - - diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/basic/image/icons/scons.png deleted file mode 100644 index 7d85f1f8c28e010a122c55baf3de8185609c95a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/image/main.cpp b/tests/site_scons/site_tools/qt5/test/qrc/basic/image/main.cpp deleted file mode 100644 index 304dc3a..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/basic/image/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - Q_INIT_RESOURCE(icons); - - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basic.py b/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basic.py deleted file mode 100644 index e88cc9e..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basic.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Basic test for the Qrc() builder. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('SConscript') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basicwflags.py b/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basicwflags.py deleted file mode 100644 index 4d1b92d..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/basic/sconstest-basicwflags.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Basic test for the Qrc() builder, with '-name' flag set. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('SConscript-wflags','SConscript') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript deleted file mode 100644 index 8445a06..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript +++ /dev/null @@ -1,9 +0,0 @@ -Import('qtEnv') - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) - -source_files = Glob('*.cpp') -source_files.append(env.Qrc5('icons')) - -env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript-wflags b/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript-wflags deleted file mode 100644 index 961c00b..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/manual/SConscript-wflags +++ /dev/null @@ -1,11 +0,0 @@ -Import('qtEnv') - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) - -source_files = Glob('*.cpp') -source_files.append(env.Qrc5('icons')) - -env['QT5_QRCFLAGS'] = ['-name', 'icons'] - -env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/manual/image/SConstruct deleted file mode 100644 index 00e5705..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/manual/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons.qrc deleted file mode 100644 index 86fe71b..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - icons/scons.png - - diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/manual/image/icons/scons.png deleted file mode 100644 index 7d85f1f8c28e010a122c55baf3de8185609c95a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/image/main.cpp b/tests/site_scons/site_tools/qt5/test/qrc/manual/image/main.cpp deleted file mode 100644 index 304dc3a..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/manual/image/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - Q_INIT_RESOURCE(icons); - - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manual.py b/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manual.py deleted file mode 100644 index 0a8fac9..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manual.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Basic test for the Qrc() builder, called explicitly. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('SConscript') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manualwflags.py b/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manualwflags.py deleted file mode 100644 index aef66c7..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/manual/sconstest-manualwflags.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Basic test for the Qrc() builder, called explicitly with '-name' flag set. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('SConscript-wflags','SConscript') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript deleted file mode 100644 index 1bcb156..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript +++ /dev/null @@ -1,8 +0,0 @@ -Import('qtEnv') - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) - -source_files = Glob('*.cpp')+Glob('*.qrc') - -env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript-manual b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript-manual deleted file mode 100644 index d77c2f8..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/SConscript-manual +++ /dev/null @@ -1,9 +0,0 @@ -Import('qtEnv') - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) - -source_files = Glob('*.cpp') -qrc_files = env.Qrc5(['icons','other']) - -env.Program('main', source_files+qrc_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/SConstruct deleted file mode 100644 index 00e5705..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons.qrc deleted file mode 100644 index 86fe71b..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - icons/scons.png - - diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/icons/scons.png deleted file mode 100644 index 7d85f1f8c28e010a122c55baf3de8185609c95a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/main.cpp b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/main.cpp deleted file mode 100644 index 325478d..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/main.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - Q_INIT_RESOURCE(icons); - Q_INIT_RESOURCE(other); - - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other.qrc b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other.qrc deleted file mode 100644 index 12ed5e8..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - other/rocks.png - - diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other/rocks.png b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/image/other/rocks.png deleted file mode 100644 index 7d85f1f8c28e010a122c55baf3de8185609c95a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles-manual.py b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles-manual.py deleted file mode 100644 index ad54686..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles-manual.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Tests the Qrc() builder, when more than one .qrc file is given. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('SConscript-manual','SConscript') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles.py b/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles.py deleted file mode 100644 index ca41695..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/multifiles/sconstest-multifiles.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Tests the Qrc() builder, when more than one .qrc file is given to the -Program/Library builders directly. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('SConscript') -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConscript deleted file mode 100644 index 560f0cc..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConscript +++ /dev/null @@ -1,11 +0,0 @@ -Import('qtEnv') - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) - -source_files = Glob('*.cpp') -source_files.append(env.Qrc5('icons')) - -env['QT5_QRCFLAGS'] = ['-name', 'othername'] - -env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConstruct deleted file mode 100644 index 00e5705..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons.qrc deleted file mode 100644 index 86fe71b..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - icons/scons.png - - diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/icons/scons.png deleted file mode 100644 index 7d85f1f8c28e010a122c55baf3de8185609c95a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/main.cpp b/tests/site_scons/site_tools/qt5/test/qrc/othername/image/main.cpp deleted file mode 100644 index 0457bcd..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/othername/image/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - Q_INIT_RESOURCE(othername); - - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/othername/sconstest-othername.py b/tests/site_scons/site_tools/qt5/test/qrc/othername/sconstest-othername.py deleted file mode 100644 index a62937d..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/othername/sconstest-othername.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Rename test for the Qrc() builder, uses the '-name' flag to set a different -name for the resulting .cxx file. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConscript deleted file mode 100644 index 1bcb156..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConscript +++ /dev/null @@ -1,8 +0,0 @@ -Import('qtEnv') - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) - -source_files = Glob('*.cpp')+Glob('*.qrc') - -env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConstruct deleted file mode 100644 index 00e5705..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.cpp b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.cpp deleted file mode 100644 index 304dc3a..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - Q_INIT_RESOURCE(icons); - - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.qrc deleted file mode 100644 index 86fe71b..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - icons/scons.png - - diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/image/icons/scons.png deleted file mode 100644 index 7d85f1f8c28e010a122c55baf3de8185609c95a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F diff --git a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/sconstest-samefilename.py b/tests/site_scons/site_tools/qt5/test/qrc/samefilename/sconstest-samefilename.py deleted file mode 100644 index 91178ac..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/samefilename/sconstest-samefilename.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Check that the correct prefixes/suffixes are appended to the target of -the Qrc() builder. Else, we could not add .qrc and CXX files with the -same prefix to the Program/Library builders. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConscript b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConscript deleted file mode 100644 index 53ef724..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConscript +++ /dev/null @@ -1,8 +0,0 @@ -Import('qtEnv') - -env = qtEnv.Clone() -env.EnableQt5Modules(['QtCore','QtWidgets']) - -source_files = Glob('*.cpp')+['qrc/icons.qrc'] - -env.Program('main', source_files) diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConstruct b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConstruct deleted file mode 100644 index 00e5705..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - \ No newline at end of file diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/main.cpp b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/main.cpp deleted file mode 100644 index 304dc3a..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - Q_INIT_RESOURCE(icons); - - return 0; -} diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons.qrc b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons.qrc deleted file mode 100644 index 86fe71b..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - icons/scons.png - - diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons/scons.png b/tests/site_scons/site_tools/qt5/test/qrc/subdir/image/qrc/icons/scons.png deleted file mode 100644 index 7d85f1f8c28e010a122c55baf3de8185609c95a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1613 zcmV-T2D15yP)$y00004b3#c}2nYxW zd`K zafCm^j`0LMfo9-CV1%t0RMo2BrvP0sII2~{%XM165)FvBfCqd9jI$Ak*m|TLk%NPR zfpJxLmpi7#R&&*5V{M#Gb#b@RQ%7L8!g5vJ-Cc255iBATfjvvhBUDC8+TD+P9$(fq zu(2lQ*14Wz;IId80$WtoyQ#6*5Nt%Y_jAl6+eZv?dWqbyU9&3RUT$DrP0T%$avcLF zJXj8FP}Sy}5lgoV7LhT)Z}ZCfGAkPP<>LW6>l3WK6!VTJQ^vq~4^{ymsA{ZB@mLW2 zdC17qJ4XyMrN(sbkbz&~O?+Gv)5D3R7^wGP4e++AUd$_=?i4H{A%WP)-a%*OkSIff zfxP>wZfs_4O-%R38bu)K!AHOs7l)KMWeW+9JLI}P_E)oD{ z7+CDVJ!JvMeJ&byruHi#Wc&%=b|t~mGqnJZsp`&7ISVQHS`Z=vJYnE94<>{i<31B9 zb!PN0rLWWRQdW8LynCuSb@ZyIqkVA|c!Wz-wIRcHzrYfO$weaGv`C4W**{Eq&}rxY zQ@n|nPhSFKZA?jEn5v%X zZtmREmo7p?9AIjOdA$v>PyoTeM4&9g_L(j6LI|$R_`f`DXee^de-*_G2Lcmo9Rz^yw?3cM8xG^qXbz6&P zLJAi7^N5AcE1Ak~n)v~)_bC#Y@dSc2% z6FH7RwxM*j|Sh@PEP0SR7rjELc^K0h>t+^?-w_y5D9D z0Z4yN@M&$_x6>83OBI>Lq^p)GU}3(UY`vW5^q{RRsvBEA0t$*8Adf}dKm#x)&qDkn zd=}ob_>O7e&N=3w$N?ce%Kmp9*U_x1i9GzejFtoSUU|62d&K#$O$aa=m|&4}tE!#@ z5Rr0Vibd}I7^o-zu7{;lQLL^9IG6d7M! z#PY%UWO}(_eNCJVwXtvjpx6k}95Ro55zO+1PEhP{7q@&QQ;0%*L2+B~t&ZD*Z*>F! z4kePjf3d#X$^J=Q&1$p3eJGJk{}B|~h26z}S(}Z=GMn5%kzM}*w<<2%`cNe700000 LNkvXXu0mjfGb--F diff --git a/tests/site_scons/site_tools/qt5/test/qrc/subdir/sconstest-subdir.py b/tests/site_scons/site_tools/qt5/test/qrc/subdir/sconstest-subdir.py deleted file mode 100644 index bd03a96..0000000 --- a/tests/site_scons/site_tools/qt5/test/qrc/subdir/sconstest-subdir.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -In this test the QRC file is placed in a subfolder (qrc/icons.qrc). The -Qrc5() builder should correctly strip the leading path and set the "-name" -option for the RCC executable to "icons" only. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run() - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/qt_examples/create_scons_tests.py b/tests/site_scons/site_tools/qt5/test/qt_examples/create_scons_tests.py deleted file mode 100644 index 0ffbf02..0000000 --- a/tests/site_scons/site_tools/qt5/test/qt_examples/create_scons_tests.py +++ /dev/null @@ -1,748 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# -# create_scons_test.py -# -# Populates a Qt "examples" directory with files for the -# SCons test framework. -# -# -# -# Usage: -# -# Step 1: Copy the "examples" folder of your Qt source tree into -# this directory. -# Step 2: Run "python create_scons_tests.py" to create all files -# for the SCons test framework. -# Step 3: Execute "python runtest.py -a" to run all tests -# -# Additional options for this script are: -# -# -local Creates the test files in the local directory, -# also copies qtenv.py and qt5.py to their correct -# places. -# -clean Removes all intermediate test files. -# -# - -import os, sys, re, glob, shutil - -# cxx file extensions -cxx_ext = ['.c', '.cpp', '.cxx', '.cc'] -# header file extensions -h_ext = ['.h', '.hpp', '.hxx'] -# regex for includes -inc_re = re.compile(r'#include\s+<([^>]+)>') -# regex for qtLibraryTarget function -qtlib_re = re.compile(r'\$\$qtLibraryTarget\(([^\)]+)\)') -qrcinit_re = re.compile('Q_INIT_RESOURCE\(([^\)]+)\)') -localvar_re = re.compile("\\$\\$([^/\s]+)") -qthave_re = re.compile("qtHaveModule\([^\)]+\)\s*:\s") - -updir = '..'+os.sep - -# we currently skip all .pro files that use these config values -complicated_configs = ['qdbus','phonon','plugin'] -# for the following CONFIG values we have to provide default qt modules -config_modules = {'designer' : ['QtCore','QtGui','QtXml','QtWidgets','QtDesigner','QtDesignerComponents'], - 'uitools' : ['QtCore','QtGui','QtUiTools'], - 'assistant' : ['QtCore','QtGui','QtXml','QtScript','QtAssistant'], - 'core' : ['QtCore'], - 'gui' : ['QtCore', 'QtGui'], - 'concurrent' : ['QtCore', 'QtConcurrent'], - 'dbus' : ['QtCore', 'QtDBus'], - 'declarative' : ['QtCore', 'QtGui', 'QtScript', 'QtSql', 'QtNetwork', 'QtWidgets', 'QtXmlPatterns', 'QtDeclarative'], - 'printsupport' : ['QtCore', 'QtGui', 'QtWidgets', 'QtPrintSupport'], - 'mediawidgets' : ['QtCore', 'QtGui', 'QtOpenGL', 'QtNetwork', 'QtWidgets', 'QtMultimedia', 'QtMultimediaWidgets'], - 'webkitwidgets' : ['QtCore', 'QtGui', 'QtOpenGL', 'QtNetwork', 'QtWidgets', 'QtPrintSupport', 'QtWebKit', 'QtQuick', 'QtQml', 'QtSql', 'QtV8', 'QtWebKitWidgets'], - 'qml' : ['QtCore', 'QtGui', 'QtNetwork', 'QtV8', 'QtQml'], - 'quick' : ['QtCore', 'QtGui', 'QtNetwork', 'QtV8', 'QtQml', 'QtQuick'], - 'axcontainer' : [], - 'axserver' : [], - 'testlib' : ['QtCore', 'QtTest'], - 'xmlpatterns' : ['QtCore', 'QtNetwork', 'QtXmlPatterns'], - 'qt' : ['QtCore','QtGui'], - 'xml' : ['QtCore','QtGui','QtXml'], - 'webkit' : ['QtCore','QtGui','QtQuick','QtQml','QtNetwork','QtSql','QtV8','QtWebKit'], - 'network' : ['QtCore','QtNetwork'], - 'svg' : ['QtCore','QtGui','QtWidgets','QtSvg'], - 'script' : ['QtCore','QtScript'], - 'scripttools' : ['QtCore','QtGui','QtWidgets','QtScript','QtScriptTools'], - 'multimedia' : ['QtCore','QtGui','QtNetwork','QtMultimedia'], - 'script' : ['QtCore','QtScript'], - 'help' : ['QtCore','QtGui','QtWidgets','QtCLucene','QtSql','QtNetwork','QtHelp'], - 'qtestlib' : ['QtCore','QtTest'], - 'opengl' : ['QtCore','QtGui','QtOpenGL'], - 'widgets' : ['QtCore','QtGui','QtWidgets'] - } -# for the following CONFIG values we have to provide additional CPP defines -config_defines = {'plugin' : ['QT_PLUGIN'], - 'designer' : ['QDESIGNER_EXPORT_WIDGETS'] - } - -# dictionary of special Qt Environment settings for all single tests/pro files -qtenv_flags = {'QT5_GOBBLECOMMENTS' : '1' - } - -# available qt modules -validModules = [ - # Qt Essentials - 'QtCore', - 'QtGui', - 'QtMultimedia', - 'QtMultimediaQuick_p', - 'QtMultimediaWidgets', - 'QtNetwork', - 'QtPlatformSupport', - 'QtQml', - 'QtQmlDevTools', - 'QtQuick', - 'QtQuickParticles', - 'QtSql', - 'QtQuickTest', - 'QtTest', - 'QtWebKit', - 'QtWebKitWidgets', - 'QtWidgets', - # Qt Add-Ons - 'QtConcurrent', - 'QtDBus', - 'QtOpenGL', - 'QtPrintSupport', - 'QtDeclarative', - 'QtScript', - 'QtScriptTools', - 'QtSvg', - 'QtUiTools', - 'QtXml', - 'QtXmlPatterns', - # Qt Tools - 'QtHelp', - 'QtDesigner', - 'QtDesignerComponents', - # Other - 'QtCLucene', - 'QtConcurrent', - 'QtV8' - ] - -def findQtBinParentPath(qtpath): - """ Within the given 'qtpath', search for a bin directory - containing the 'lupdate' executable and return - its parent path. - """ - for path, dirs, files in os.walk(qtpath): - for d in dirs: - if d == 'bin': - if sys.platform.startswith("linux"): - lpath = os.path.join(path, d, 'lupdate') - else: - lpath = os.path.join(path, d, 'lupdate.exe') - if os.path.isfile(lpath): - return path - - return "" - -def findMostRecentQtPath(dpath): - paths = glob.glob(dpath) - if len(paths): - paths.sort() - return findQtBinParentPath(paths[-1]) - - return "" - -def detectLatestQtVersion(): - if sys.platform.startswith("linux"): - # Inspect '/usr/local/Qt' first... - p = findMostRecentQtPath(os.path.join('/usr','local','Qt-*')) - if not p: - # ... then inspect '/usr/local/Trolltech'... - p = findMostRecentQtPath(os.path.join('/usr','local','Trolltech','*')) - if not p: - # ...then try to find a binary install... - p = findMostRecentQtPath(os.path.join('/opt','Qt*')) - if not p: - # ...then try to find a binary SDK. - p = findMostRecentQtPath(os.path.join('/opt','qtsdk*')) - - else: - # Simple check for Windows: inspect only 'C:\Qt' - paths = glob.glob(os.path.join('C:\\', 'Qt', 'Qt*')) - p = "" - if len(paths): - paths.sort() - # Select version with highest release number - paths = glob.glob(os.path.join(paths[-1], '5*')) - if len(paths): - paths.sort() - # Is it a MinGW or VS installation? - p = findMostRecentQtPath(os.path.join(paths[-1], 'mingw*')) - if not p: - # No MinGW, so try VS... - p = findMostRecentQtPath(os.path.join(paths[-1], 'msvc*')) - - return os.environ.get("QT5DIR", p) - -def detectPkgconfigPath(qtdir): - pkgpath = os.path.join(qtdir, 'lib', 'pkgconfig') - if os.path.exists(os.path.join(pkgpath,'Qt5Core.pc')): - return pkgpath - pkgpath = os.path.join(qtdir, 'lib') - if os.path.exists(os.path.join(pkgpath,'Qt5Core.pc')): - return pkgpath - - return "" - -def expandProFile(fpath): - """ Read the given file into a list of single lines, - while expanding included files (mainly *.pri) - recursively. - """ - lines = [] - f = open(fpath,'r') - content = f.readlines() - f.close() - pwdhead, tail = os.path.split(fpath) - head = pwdhead - if pwdhead: - pwdhead = os.path.abspath(pwdhead) - else: - pwdhead = os.path.abspath(os.getcwd()) - for idx, l in enumerate(content): - l = l.rstrip('\n') - l = l.rstrip() - if '$$PWD' in l: - l = l.replace("$$PWD", pwdhead) - if l.startswith('include('): - # Expand include file - l = l.rstrip(')') - l = l.replace('include(','') - while '$$' in l: - # Try to replace the used local variable by - # searching back in the content - m = localvar_re.search(l) - if m: - key = m.group(1) - tidx = idx-1 - skey = "%s = " % key - while tidx >= 0: - if content[tidx].startswith(skey): - # Key found - l = l.replace('$$%s' % key, content[tidx][len(skey):].rstrip('\n')) - if os.path.join('..','..','qtbase','examples') in l: - # Quick hack to cope with erroneous *.pro files - l = l.replace(os.path.join('..','..','qtbase','examples'), os.path.join('..','examples')) - break - tidx -= 1 - if tidx < 0: - print "Error: variable %s could not be found during parsing!" % key - break - ipath = l - if head: - ipath = os.path.join(head, l) - # Does the file exist? - if not os.path.isfile(ipath): - # Then search for it the hard way - ihead, tail = os.path.split(ipath) - for spath, dirs, files in os.walk('.'): - for f in files: - if f == tail: - ipath = os.path.join(spath, f) - lines.extend(expandProFile(ipath)) - else: - lines.append(l) - - return lines - -def parseProFile(fpath): - """ Parse the .pro file fpath and return the defined - variables in a dictionary. - """ - keys = {} - curkey = None - curlist = [] - for l in expandProFile(fpath): - # Strip off qtHaveModule part - m = qthave_re.search(l) - if m: - l = qthave_re.sub("", l) - kl = l.split('=') - if len(kl) > 1: - # Close old key - if curkey: - if keys.has_key(curkey): - keys[curkey].extend(curlist) - else: - keys[curkey] = curlist - - # Split off trailing + - nkey = kl[0].rstrip('+') - nkey = nkey.rstrip() - # Split off optional leading part with "contains():" - cl = nkey.split(':') - if ('lesock' not in l) and ((len(cl) < 2) or ('msvc' in cl[0])): - nkey = cl[-1] - # Open new key - curkey = nkey.split()[0] - value = kl[1].lstrip() - if value.endswith('\\'): - # Key is continued on next line - value = value[:-1] - curlist = value.split() - else: - # Single line key - if keys.has_key(curkey): - keys[curkey].extend(value.split()) - else: - keys[curkey] = value.split() - curkey = None - curlist = [] - else: - if l.endswith('\\'): - # Continue current key - curlist.extend(l[:-1].split()) - else: - # Unknown, so go back to VOID state - if curkey: - # Append last item for current key... - curlist.extend(l.split()) - if keys.has_key(curkey): - keys[curkey].extend(curlist) - else: - keys[curkey] = curlist - - # ... and reset parse state. - curkey = None - curlist = [] - - return keys - -def writeSConstruct(dirpath): - """ Create a SConstruct file in dirpath. - """ - sc = open(os.path.join(dirpath,'SConstruct'),'w') - sc.write("""import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - """) - sc.close() - -def collectModulesFromFiles(fpath): - """ Scan source files in dirpath for included - Qt5 modules, and return the used modules in a list. - """ - mods = [] - try: - f = open(fpath,'r') - content = f.read() - f.close() - except: - return mods - - for m in inc_re.finditer(content): - mod = m.group(1) - if (mod in validModules) and (mod not in mods): - mods.append(mod) - return mods - -def findQResourceName(fpath): - """ Scan the source file fpath and return the name - of the QRC instance that gets initialized via - QRC_INIT_RESOURCE. - """ - name = "" - - try: - f = open(fpath,'r') - content = f.read() - f.close() - except: - return name - - m = qrcinit_re.search(content) - if m: - name = m.group(1) - - return name - -def validKey(key, pkeys): - """ Helper function - """ - if pkeys.has_key(key) and len(pkeys[key]) > 0: - return True - - return False - -def collectModules(dirpath, pkeys): - """ Scan source files in dirpath for included - Qt5 modules, and return the used modules in a list. - """ - mods = [] - defines = [] - # Scan subdirs - if validKey('SUBDIRS', pkeys): - for s in pkeys['SUBDIRS']: - flist = glob.glob(os.path.join(dirpath, s, '*.*')) - for f in flist: - root, ext = os.path.splitext(f) - if (ext and ((ext in cxx_ext) or - (ext in h_ext))): - mods.extend(collectModulesFromFiles(f)) - - # Scan sources - if validKey('SOURCES', pkeys): - for s in pkeys['SOURCES']: - f = os.path.join(dirpath,s) - mods.extend(collectModulesFromFiles(f)) - - # Scan headers - if validKey('HEADERS', pkeys): - for s in pkeys['HEADERS']: - f = os.path.join(dirpath,s) - mods.extend(collectModulesFromFiles(f)) - - # Check CONFIG keyword - if validKey('CONFIG', pkeys): - for k in pkeys['CONFIG']: - if config_modules.has_key(k): - mods.extend(config_modules[k]) - if config_defines.has_key(k): - defines.extend(config_defines[k]) - - # Check QT keyword - if validKey('QT', pkeys): - for k in pkeys['QT']: - if config_modules.has_key(k): - mods.extend(config_modules[k]) - - # Make lists unique - unique_mods = [] - for m in mods: - if m not in unique_mods: - unique_mods.append(m) - unique_defines = [] - for d in defines: - if d not in unique_defines: - unique_defines.append(d) - - # Safety hack, if no modules are found so far - # assume that this is a normal Qt GUI application... - if len(unique_mods) == 0: - unique_mods = ['QtCore','QtGui'] - - return (unique_mods, unique_defines) - -def relOrAbsPath(dirpath, rpath): - if rpath.startswith('..'): - return os.path.abspath(os.path.normpath(os.path.join(dirpath, rpath))) - - return rpath - -def writeSConscript(dirpath, profile, pkeys): - """ Create a SConscript file in dirpath. - """ - - # Activate modules - mods, defines = collectModules(dirpath, pkeys) - if validKey('CONFIG', pkeys) and isComplicated(pkeys['CONFIG'][0]): - return False - - qrcname = "" - if not validKey('SOURCES', pkeys): - # No SOURCES specified, try to find CPP files - slist = glob.glob(os.path.join(dirpath,'*.cpp')) - if len(slist) == 0: - # Nothing to build here - return False - else: - # Scan for Q_INIT_RESOURCE - for s in slist: - qrcname = findQResourceName(s) - if qrcname: - break - - allmods = True - for m in mods: - if m not in pkeys['qtmodules']: - print " no module %s" % m - allmods = False - if not allmods: - return False - - sc = open(os.path.join(dirpath,'SConscript'),'w') - sc.write("""Import('qtEnv') - -env = qtEnv.Clone() -""") - - if len(mods): - sc.write('env.EnableQt5Modules([\n') - for m in mods[:-1]: - sc.write("'%s',\n" % m) - sc.write("'%s'\n" % mods[-1]) - sc.write('])\n\n') - - # Add CPPDEFINEs - if len(defines): - sc.write('env.AppendUnique(CPPDEFINES=[\n') - for d in defines[:-1]: - sc.write("'%s',\n" % d) - sc.write("'%s'\n" % defines[-1]) - sc.write('])\n\n') - - # Add LIBS - if validKey('LIBS', pkeys): - sc.write('env.AppendUnique(LIBS=[\n') - for d in pkeys['LIBS'][:-1]: - sc.write("'%s',\n" % d) - sc.write("'%s'\n" % pkeys['LIBS'][-1]) - sc.write('])\n\n') - - # Collect INCLUDEPATHs - incpaths = [] - if validKey('INCLUDEPATH', pkeys): - incpaths = pkeys['INCLUDEPATH'] - if validKey('FORMS', pkeys): - for s in pkeys['FORMS']: - head, tail = os.path.split(s) - if head and head not in incpaths: - incpaths.append(head) - if incpaths: - sc.write('env.Append(CPPPATH=[\n') - for d in incpaths[:-1]: - sc.write("'%s',\n" % relOrAbsPath(dirpath, d)) - sc.write("'%s'\n" % relOrAbsPath(dirpath, incpaths[-1])) - sc.write('])\n\n') - - # Add special environment flags - if len(qtenv_flags): - for key, value in qtenv_flags.iteritems(): - sc.write("env['%s']=%s\n" % (key, value)) - - - # Write source files - if validKey('SOURCES', pkeys): - sc.write('source_files = [\n') - for s in pkeys['SOURCES'][:-1]: - sc.write("'%s',\n" % relOrAbsPath(dirpath, s)) - if not qrcname: - qrcname = findQResourceName(os.path.join(dirpath,s)) - - sc.write("'%s'\n" % relOrAbsPath(dirpath, pkeys['SOURCES'][-1])) - if not qrcname: - qrcname = findQResourceName(os.path.join(dirpath,pkeys['SOURCES'][-1])) - sc.write(']\n\n') - - # Write .ui files - if validKey('FORMS', pkeys): - sc.write('ui_files = [\n') - for s in pkeys['FORMS'][:-1]: - sc.write("'%s',\n" % relOrAbsPath(dirpath, s)) - sc.write("'%s'\n" % relOrAbsPath(dirpath, pkeys['FORMS'][-1])) - sc.write(']\n') - sc.write('env.Uic5(ui_files)\n\n') - - # Write .qrc files - if validKey('RESOURCES', pkeys): - qrc_name = pkeys['RESOURCES'][0] - if qrcname: - if qrc_name.endswith('.qrc'): - qrc_name = qrc_name[:-4] - sc.write("qrc_out = env.Qrc5('%s')\nsource_files.append(qrc_out)\nenv['QT5_QRCFLAGS'] = ['-name', '%s']\n" % (qrc_name, qrcname)) - else: - if not qrc_name.endswith('.qrc'): - qrc_name += '.qrc' - sc.write("source_files.append('%s')\n" % qrc_name) - - # Select module - type = 'Program' - if validKey('TEMPLATE', pkeys): - if pkeys['TEMPLATE'][0] == 'lib': - type = 'StaticLibrary' - if pkeys['TEMPLATE'][0] == 'dll': - type = 'SharedLibrary' - - # TARGET may be wrapped by qtLibraryTarget function... - target = profile - if validKey('TARGET', pkeys): - t = pkeys['TARGET'][0] - m = qtlib_re.search(t) - if m: - t = "Qt" + m.group(1) - target = t.replace("$$TARGET", profile) - - # Create program/lib/dll - else: - if validKey('SOURCES', pkeys): - sc.write("env.%s('%s', source_files)\n\n" % (type, target)) - else: - sc.write("env.%s('%s', Glob('*.cpp'))\n\n" % (type, target)) - - sc.close() - - return True - -def writeSConsTestFile(dirpath, folder): - dirnums = dirpath.count(os.sep)+1 - f = open(os.path.join(dirpath, "sconstest-%s.py" % folder),'w') - f.write(""" -import os -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("%s") -test.file_fixture('%sqtenv.py') -test.file_fixture('%s__init__.py', os.path.join('site_scons','site_tools','qt5','__init__.py')) -test.run() - -test.pass_test() - """ % (folder, updir*dirnums, updir*(dirnums+1))) - f.close() - -def installLocalFiles(dirpath): - dirnums = dirpath.count(os.sep)+1 - shutil.copy(os.path.join(dirpath,updir*dirnums+'qtenv.py'), - os.path.join(dirpath,'qtenv.py')) - toolpath = os.path.join(dirpath,'site_scons','site_tools','qt5') - if not os.path.exists(toolpath): - os.makedirs(toolpath) - shutil.copy(os.path.join(dirpath,updir*(dirnums+1)+'__init__.py'), - os.path.join(dirpath,'site_scons','site_tools','qt5','__init__.py')) - -def isComplicated(keyvalues): - for s in keyvalues: - if s in complicated_configs: - return True - - return False - -# Folders that should get skipped while creating the SConscripts -skip_folders = ['activeqt', 'declarative', 'dbus'] - -def createSConsTest(dirpath, profile, options): - """ Create files for the SCons test framework in dirpath. - """ - pkeys = parseProFile(os.path.join(dirpath, profile)) - if validKey('TEMPLATE', pkeys) and pkeys['TEMPLATE'][0] == 'subdirs': - return - if validKey('CONFIG', pkeys) and isComplicated(pkeys['CONFIG']): - return - if validKey('QT', pkeys) and isComplicated(pkeys['QT']): - return - - head, tail = os.path.split(dirpath) - if head and tail: - print os.path.join(dirpath, profile) - for s in skip_folders: - if s in dirpath: - return - pkeys['qtmodules'] = options['qtmodules'] - if not writeSConscript(dirpath, profile[:-4], pkeys): - return - writeSConstruct(dirpath) - writeSConsTestFile(head, tail) - if options['local']: - installLocalFiles(dirpath) - -def cleanSConsTest(dirpath, profile, options): - """ Remove files for the SCons test framework in dirpath. - """ - try: - os.remove(os.path.join(dirpath,'SConstruct')) - except: - pass - try: - os.remove(os.path.join(dirpath,'SConscript')) - except: - pass - try: - os.remove(os.path.join(dirpath,'qtenv.py')) - except: - pass - try: - shutil.rmtree(os.path.join(dirpath,'site_scons'), - ignore_errors=True) - except: - pass - head, tail = os.path.split(dirpath) - if head and tail: - try: - os.remove(os.path.join(head, "sconstest-%s.py" % tail)) - except: - pass - -def main(): - """ The main program. - """ - - # Parse command line options - options = {'local' : False, # Install qtenv.py and qt5.py in local folder - 'qtpath' : None, - 'pkgconfig' : None - } - clean = False - qtpath = None - for o in sys.argv[1:]: - if o == "-local": - options['local'] = True - elif o == "-clean": - clean = True - else: - options['qtpath'] = o - - if not options['qtpath']: - qtpath = detectLatestQtVersion() - if qtpath == "": - print "No Qt installation found!" - sys.exit(1) - - is_win = sys.platform.startswith('win') - if not is_win: - # Use pkgconfig to detect the available modules - options['pkgconfig'] = detectPkgconfigPath(qtpath) - if options['pkgconfig'] == "": - print "No pkgconfig files found!" - sys.exit(1) - - options['qtpath'] = qtpath - options['qtmodules'] = [] - for v in validModules: - if is_win or os.path.exists(os.path.join(options['pkgconfig'],v.replace('Qt','Qt5')+'.pc')): - options['qtmodules'].append(v) - - if not clean: - doWork = createSConsTest - else: - doWork = cleanSConsTest - - # Detect .pro files - for path, dirs, files in os.walk('.'): - for f in files: - if f.endswith('.pro'): - doWork(path, f, options) - -if __name__ == "__main__": - main() diff --git a/tests/site_scons/site_tools/qt5/test/qt_examples/sconstest.skip b/tests/site_scons/site_tools/qt5/test/qt_examples/sconstest.skip deleted file mode 100644 index e69de29..0000000 diff --git a/tests/site_scons/site_tools/qt5/test/qtenv.py b/tests/site_scons/site_tools/qt5/test/qtenv.py deleted file mode 100644 index f37faf2..0000000 --- a/tests/site_scons/site_tools/qt5/test/qtenv.py +++ /dev/null @@ -1,107 +0,0 @@ -# -# Copyright (c) 2001-2010 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -import os, sys, glob -from SCons import Environment - -def findQtBinParentPath(qtpath): - """ Within the given 'qtpath', search for a bin directory - containing the 'lupdate' executable and return - its parent path. - """ - for path, dirs, files in os.walk(qtpath): - for d in dirs: - if d == 'bin': - if sys.platform.startswith("linux"): - lpath = os.path.join(path, d, 'lupdate') - else: - lpath = os.path.join(path, d, 'lupdate.exe') - if os.path.isfile(lpath): - return path - - return "" - -def findMostRecentQtPath(dpath): - paths = glob.glob(dpath) - if len(paths): - paths.sort() - return findQtBinParentPath(paths[-1]) - - return "" - -def detectLatestQtVersion(): - if sys.platform.startswith("linux"): - # Inspect '/usr/local/Qt' first... - p = findMostRecentQtPath('/usr/local/Qt-*') - if not p: - # ... then inspect '/usr/local/Trolltech'... - p = findMostRecentQtPath('/usr/local/Trolltech/*') - if not p: - # ...then try to find a binary install... - p = findMostRecentQtPath('/opt/Qt*') - if not p: - # ...then try to find a binary SDK. - p = findMostRecentQtPath('/opt/qtsdk*') - - else: - # Simple check for Windows: inspect only 'C:\Qt' - paths = glob.glob(os.path.join('C:\\', 'Qt', 'Qt*')) - p = "" - if len(paths): - paths.sort() - # Select version with highest release number - paths = glob.glob(os.path.join(paths[-1], '5*')) - if len(paths): - paths.sort() - # Is it a MinGW or VS installation? - p = findMostRecentQtPath(os.path.join(paths[-1], 'mingw*')) - if not p: - # No MinGW, so try VS... - p = findMostRecentQtPath(os.path.join(paths[-1], 'msvc*')) - - return os.environ.get("QT5DIR", p) - -def detectPkgconfigPath(qtdir): - pkgpath = os.path.join(qtdir, 'lib', 'pkgconfig') - if os.path.exists(os.path.join(pkgpath,'Qt5Core.pc')): - return pkgpath - pkgpath = os.path.join(qtdir, 'lib') - if os.path.exists(os.path.join(pkgpath,'Qt5Core.pc')): - return pkgpath - - return "" - -def createQtEnvironment(qtdir=None, env=None): - if not env: - env = Environment.Environment(tools=['default']) - if not qtdir: - qtdir = detectLatestQtVersion() - env['QT5DIR'] = qtdir - if sys.platform.startswith("linux"): - env['ENV']['PKG_CONFIG_PATH'] = detectPkgconfigPath(qtdir) - env.Tool('qt5') - env.Append(CXXFLAGS=['-fPIC']) - - return env - diff --git a/tests/site_scons/site_tools/qt5/test/sconstest.skip b/tests/site_scons/site_tools/qt5/test/sconstest.skip deleted file mode 100644 index e69de29..0000000 diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.cpp deleted file mode 100644 index 09e27c6..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "MyFile.h" - -aaa::aaa() : my_s(tr("SCons rocks!")) -{ - ; -} - diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.h deleted file mode 100644 index 10311dd..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/MyFile.h +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa(); - -private: - QString my_s; -}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConscript b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConscript deleted file mode 100644 index 915e1cd..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConscript +++ /dev/null @@ -1,6 +0,0 @@ -Import("qtEnv") - -qtEnv['QT5_CLEAN_TS']=1 - -qtEnv.Ts5('my_en.ts', Glob('*.cpp')) -qtEnv.Qm5('my_en','my_en') diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConstruct b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConstruct deleted file mode 100644 index d9d897d..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/sconstest-clean.py b/tests/site_scons/site_tools/qt5/test/ts_qm/clean/sconstest-clean.py deleted file mode 100644 index 40cb442..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/clean/sconstest-clean.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Test the QT5_CLEAN_TS option, which removes .ts files -on a 'scons -c'. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run(stderr=None) - -test.must_exist(test.workpath('my_en.ts')) -test.must_contain(test.workpath('my_en.ts'),'SCons rocks!') -test.must_exist(test.workpath('my_en.qm')) - -test.run(options = '-c') - -test.must_not_exist(test.workpath('my_en.ts')) -test.must_not_exist(test.workpath('my_en.qm')) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.cpp deleted file mode 100644 index 09e27c6..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "MyFile.h" - -aaa::aaa() : my_s(tr("SCons rocks!")) -{ - ; -} - diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.h deleted file mode 100644 index 10311dd..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/MyFile.h +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa(); - -private: - QString my_s; -}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConscript b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConscript deleted file mode 100644 index 4b68448..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConscript +++ /dev/null @@ -1,3 +0,0 @@ -Import("qtEnv") - -qtEnv.Ts5('my_en', ['MyFile.cpp','subdir']) diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConstruct b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConstruct deleted file mode 100644 index d9d897d..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.cpp deleted file mode 100644 index 687c0cd..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "bbb.h" - -bbb::bbb() : my_s(tr("And Qt5 too!")) -{ - ; -} diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.h b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.h deleted file mode 100644 index 0b60846..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/image/subdir/bbb.h +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -class bbb : public QObject -{ - Q_OBJECT - -public: - bbb(); - -private: - QString my_s; -}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/sconstest-mixdir.py b/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/sconstest-mixdir.py deleted file mode 100644 index df16877..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/mixdir/sconstest-mixdir.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Runs the Ts() builder with a mix of files and dirs as -input (list of sources). -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run(stderr=None) - -test.must_exist(test.workpath('my_en.ts')) -test.must_contain(test.workpath('my_en.ts'),'SCons rocks!') -test.must_contain(test.workpath('my_en.ts'),'And Qt5 too!') - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.cpp deleted file mode 100644 index 09e27c6..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "MyFile.h" - -aaa::aaa() : my_s(tr("SCons rocks!")) -{ - ; -} - diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.h deleted file mode 100644 index 10311dd..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/MyFile.h +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa(); - -private: - QString my_s; -}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConscript b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConscript deleted file mode 100644 index 677bd35..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConscript +++ /dev/null @@ -1,6 +0,0 @@ -Import("qtEnv") - -qtEnv.Ts5('my_en', Glob('*.cpp')) -qtEnv.Ts5('a','MyFile.cpp') -qtEnv.Ts5('b','bbb.cpp') -qtEnv.Qm5('my_en',['a','b']) diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConstruct b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConstruct deleted file mode 100644 index d9d897d..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.cpp deleted file mode 100644 index 687c0cd..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "bbb.h" - -bbb::bbb() : my_s(tr("And Qt5 too!")) -{ - ; -} diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.h b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.h deleted file mode 100644 index 0b60846..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/image/bbb.h +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -class bbb : public QObject -{ - Q_OBJECT - -public: - bbb(); - -private: - QString my_s; -}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/sconstest-multisource.py b/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/sconstest-multisource.py deleted file mode 100644 index 5b66c9a..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multisource/sconstest-multisource.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Tests that the Ts() and Qm() builders accept and -process multiple sources correctly. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run(stderr=None) - -test.must_exist(test.workpath('my_en.ts')) -test.must_exist(test.workpath('a.ts')) -test.must_exist(test.workpath('b.ts')) -test.must_contain(test.workpath('my_en.ts'),'SCons rocks!') -test.must_contain(test.workpath('my_en.ts'),'And Qt5 too!') -test.must_contain(test.workpath('a.ts'),'SCons rocks!') -test.must_contain(test.workpath('b.ts'),'And Qt5 too!') -test.must_exist(test.workpath('my_en.qm')) - -test.run(options = '-c') - -test.must_exist(test.workpath('my_en.ts')) -test.must_exist(test.workpath('a.ts')) -test.must_exist(test.workpath('b.ts')) -test.must_not_exist(test.workpath('my_en.qm')) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.cpp deleted file mode 100644 index 09e27c6..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "MyFile.h" - -aaa::aaa() : my_s(tr("SCons rocks!")) -{ - ; -} - diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.h deleted file mode 100644 index 10311dd..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/MyFile.h +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa(); - -private: - QString my_s; -}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConscript b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConscript deleted file mode 100644 index 0d6a666..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConscript +++ /dev/null @@ -1,4 +0,0 @@ -Import("qtEnv") - -qtEnv.Ts5(['my_en','my_de'], Glob('*.cpp')) -qtEnv.Qm5(['my_en','my_de'],'my_en') diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConstruct b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConstruct deleted file mode 100644 index d9d897d..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/sconstest-multitarget.py b/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/sconstest-multitarget.py deleted file mode 100644 index 2a900fe..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/multitarget/sconstest-multitarget.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Tests that the Ts() and Qm() builders accept and -process multiple targets correctly. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run(stderr=None) - -test.must_exist(test.workpath('my_en.ts')) -test.must_exist(test.workpath('my_de.ts')) -test.must_contain(test.workpath('my_en.ts'),'SCons rocks!') -test.must_contain(test.workpath('my_de.ts'),'SCons rocks!') -test.must_exist(test.workpath('my_en.qm')) -test.must_exist(test.workpath('my_de.qm')) - -test.run(options = '-c') - -test.must_exist(test.workpath('my_en.ts')) -test.must_exist(test.workpath('my_de.ts')) -test.must_not_exist(test.workpath('my_en.qm')) -test.must_not_exist(test.workpath('my_de.qm')) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.cpp b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.cpp deleted file mode 100644 index 09e27c6..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "MyFile.h" - -aaa::aaa() : my_s(tr("SCons rocks!")) -{ - ; -} - diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.h b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.h deleted file mode 100644 index 10311dd..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/MyFile.h +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include - -class aaa : public QObject -{ - Q_OBJECT - -public: - aaa(); - -private: - QString my_s; -}; diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConscript b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConscript deleted file mode 100644 index 932ec0f..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConscript +++ /dev/null @@ -1,4 +0,0 @@ -Import("qtEnv") - -qtEnv.Ts5('my_en.ts', Glob('*.cpp')) -qtEnv.Qm5('my_en','my_en') diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConstruct b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConstruct deleted file mode 100644 index d9d897d..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/image/SConstruct +++ /dev/null @@ -1,6 +0,0 @@ -import qtenv - -qtEnv = qtenv.createQtEnvironment() -Export('qtEnv') -SConscript('SConscript') - diff --git a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/sconstest-noclean.py b/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/sconstest-noclean.py deleted file mode 100644 index 69320b2..0000000 --- a/tests/site_scons/site_tools/qt5/test/ts_qm/noclean/sconstest-noclean.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2001-2010,2011,2012 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - - -""" -Tests that .ts files are not removed by default, -on a 'scons -c'. -""" - -import TestSCons - -test = TestSCons.TestSCons() -test.dir_fixture("image") -test.file_fixture('../../qtenv.py') -test.file_fixture('../../../__init__.py','site_scons/site_tools/qt5/__init__.py') -test.run(stderr=None) - -test.must_exist(test.workpath('my_en.ts')) -test.must_contain(test.workpath('my_en.ts'),'SCons rocks!') -test.must_exist(test.workpath('my_en.qm')) - -test.run(options = '-c') - -test.must_exist(test.workpath('my_en.ts')) -test.must_not_exist(test.workpath('my_en.qm')) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/tests/test_pytest_cpp.py b/tests/test_pytest_cpp.py index 4595603..0e10a20 100644 --- a/tests/test_pytest_cpp.py +++ b/tests/test_pytest_cpp.py @@ -6,6 +6,9 @@ from pytest_cpp.google import GoogleTestFacade from pytest_cpp.qt import QTestLibFacade + +# To enable QT support plugin tests, set ENABLE_QT_TEST to True in this file +# and in the tests/SConstruct file. ENABLE_QT_TEST = False