diff --git a/run_unittests.py b/run_unittests.py index 5eba222ea..809dd5c63 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -566,7 +566,7 @@ class LinuxlikeTests(unittest.TestCase): self._test_stds_impl(testdir, cpp, 'cpp') def test_build_by_default(self): - testdir = os.path.join(self.unit_test_dir, '5 build by default') + testdir = os.path.join(self.common_test_dir, '137 build by default') self.init(testdir) self.build() genfile = os.path.join(self.builddir, 'generated.dat') diff --git a/test cases/unit/5 build by default/foo.c b/test cases/common/137 build by default/foo.c similarity index 100% rename from test cases/unit/5 build by default/foo.c rename to test cases/common/137 build by default/foo.c diff --git a/test cases/common/137 build by default/meson.build b/test cases/common/137 build by default/meson.build new file mode 100644 index 000000000..6569548e8 --- /dev/null +++ b/test cases/common/137 build by default/meson.build @@ -0,0 +1,24 @@ +project('build on all', 'c') + +py3_mod = import('python3') +py3 = py3_mod.find_python() + +executable('fooprog', 'foo.c', build_by_default : false) +comp = files('mygen.py') +mytarget = custom_target('gendat', + output : 'generated.dat', + input : 'source.txt', + command : [py3] + comp + ['@INPUT@', '@OUTPUT@'], + build_by_default : true, +) + +ct_output = join_paths(meson.build_root(), 'generated.dat') +exe_output = join_paths(meson.build_root(), 'fooprog') +if host_machine.system() == 'windows' + exe_output += '.exe' +endif + +ct_exists_exe_nexists = 'import os.path, sys; sys.exit(not os.path.exists(sys.argv[1]) and os.path.exists(sys.argv[2]))' + +test('check-build-by-default', py3, + args : ['-c', ct_exists_exe_nexists, ct_output, exe_output]) diff --git a/test cases/unit/5 build by default/mygen.py b/test cases/common/137 build by default/mygen.py similarity index 100% rename from test cases/unit/5 build by default/mygen.py rename to test cases/common/137 build by default/mygen.py diff --git a/test cases/unit/5 build by default/source.txt b/test cases/common/137 build by default/source.txt similarity index 100% rename from test cases/unit/5 build by default/source.txt rename to test cases/common/137 build by default/source.txt diff --git a/test cases/unit/5 build by default/meson.build b/test cases/unit/5 build by default/meson.build deleted file mode 100644 index 67c5cc290..000000000 --- a/test cases/unit/5 build by default/meson.build +++ /dev/null @@ -1,13 +0,0 @@ -project('build on all', 'c') - -py3_mod = import('python3') -py3 = py3_mod.find_python() - -executable('fooprog', 'foo.c', build_by_default : false) -comp = files('mygen.py') -mytarget = custom_target('gendat', - output : 'generated.dat', - input : 'source.txt', - command : [py3] + comp + ['@INPUT@', '@OUTPUT@'], - build_by_default : true, -)