diff options
author | Aleksey Filippov <alekseyf@google.com> | 2018-03-14 20:51:03 +0000 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-03-15 21:14:58 +0200 |
commit | 7f042b5fe2c3bf3bdd254aefe5936c20cb4bd293 (patch) | |
tree | be53fa41c9075355641e375bfa5439f3e6b0bb79 /run_unittests.py | |
parent | 2e128f71bb3215567a5bb2267abae00ed4ee09be (diff) | |
download | meson-7f042b5fe2c3bf3bdd254aefe5936c20cb4bd293.zip meson-7f042b5fe2c3bf3bdd254aefe5936c20cb4bd293.tar.gz meson-7f042b5fe2c3bf3bdd254aefe5936c20cb4bd293.tar.bz2 |
Use target.get_id() instead of basename and type_suffix concatenation at call site
Fixes the bug with flat layout and identical target names in subprojects.
Without this change directories are not created with subproject prefix
and they can collide.
Remove dead makedirs code in Backend.__init__(), during initialization
of backend build.targets is empty. Create output directories in
Vs2010Backend.generate_projects() instead.
Also use double blank line in run_unittests.py according to
https://www.python.org/dev/peps/pep-0008/#blank-lines.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/run_unittests.py b/run_unittests.py index fc4f560..6e9970e 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -68,9 +68,11 @@ def get_dynamic_section_entry(fname, entry): def get_soname(fname): return get_dynamic_section_entry(fname, 'soname') + def get_rpath(fname): return get_dynamic_section_entry(fname, r'(?:rpath|runpath)') + class InternalTests(unittest.TestCase): def test_version_number(self): @@ -444,6 +446,7 @@ class InternalTests(unittest.TestCase): if f.name != 'add_release_note_snippets_here': self.assertTrue(False, 'A file without .md suffix in snippets dir: ' + f.name) + class BasePlatformTests(unittest.TestCase): def setUp(self): super().setUp() @@ -1868,6 +1871,15 @@ int main(int argc, char **argv) { testdir = os.path.join(self.unit_test_dir, '23 compiler run_command') self.init(testdir) + def test_identical_target_name_in_subproject_flat_layout(self): + ''' + Test that identical targets in different subprojects do not collide + if layout is flat. + ''' + testdir = os.path.join(self.common_test_dir, '182 identical target name in subproject flat layout') + self.init(testdir, extra_args=['--layout=flat']) + self.build() + class FailureTests(BasePlatformTests): ''' @@ -2466,8 +2478,8 @@ class LinuxlikeTests(BasePlatformTests): def test_unity_subproj(self): testdir = os.path.join(self.common_test_dir, '49 subproject') self.init(testdir, extra_args='--unity=subprojects') - self.assertPathExists(os.path.join(self.builddir, 'subprojects/sublib/simpletest@exe/simpletest-unity.c')) - self.assertPathExists(os.path.join(self.builddir, 'subprojects/sublib/sublib@sha/sublib-unity.c')) + self.assertPathExists(os.path.join(self.builddir, 'subprojects/sublib/sublib@@simpletest@exe/simpletest-unity.c')) + self.assertPathExists(os.path.join(self.builddir, 'subprojects/sublib/sublib@@sublib@sha/sublib-unity.c')) self.assertPathDoesNotExist(os.path.join(self.builddir, 'user@exe/user-unity.c')) self.build() @@ -2745,6 +2757,7 @@ class LinuxArmCrossCompileTests(BasePlatformTests): compdb = self.get_compdb() self.assertNotIn('-DBUILD_ENVIRONMENT_ONLY', compdb[0]['command']) + class RewriterTests(unittest.TestCase): def setUp(self): |