diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-22 17:04:43 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-22 17:04:43 +0100 |
commit | 027c3c9ac7d7003f816465cc76278dda17f4dd86 (patch) | |
tree | d4bc41ba9dbec74b9466ee71fb3ffa9d8b117ca6 | |
parent | b7c6f3ec72c831c2af20eb5320d5f51b52d79227 (diff) | |
download | meson-027c3c9ac7d7003f816465cc76278dda17f4dd86.zip meson-027c3c9ac7d7003f816465cc76278dda17f4dd86.tar.gz meson-027c3c9ac7d7003f816465cc76278dda17f4dd86.tar.bz2 |
Added subdir test
-rwxr-xr-x | run_unittests.py | 16 | ||||
-rw-r--r-- | test cases/rewrite/2 subdirs/addSrc.json | 13 | ||||
-rw-r--r-- | test cases/rewrite/2 subdirs/info.json | 7 | ||||
-rw-r--r-- | test cases/rewrite/2 subdirs/meson.build | 1 | ||||
-rw-r--r-- | test cases/rewrite/2 subdirs/sub2/meson.build | 1 |
5 files changed, 36 insertions, 2 deletions
diff --git a/run_unittests.py b/run_unittests.py index c8d7f7a..711621b 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -5013,6 +5013,22 @@ class RewriterTests(BasePlatformTests): out = self.extract_test_data(out) self.assertDictEqual(out, expected) + def test_target_subdir(self): + self.prime('2 subdirs') + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'addSrc.json')) + out = self.extract_test_data(out) + expected = { + 'target': { + 'd3a7449@@something@exe': {'name': 'something', 'sources': ['first.c', 'second.c', 'third.c']} + } + } + self.assertDictEqual(out, expected) + + # Check the written file + out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json')) + out = self.extract_test_data(out) + self.assertDictEqual(out, expected) + class NativeFileTests(BasePlatformTests): def setUp(self): diff --git a/test cases/rewrite/2 subdirs/addSrc.json b/test cases/rewrite/2 subdirs/addSrc.json new file mode 100644 index 0000000..017476c --- /dev/null +++ b/test cases/rewrite/2 subdirs/addSrc.json @@ -0,0 +1,13 @@ +[ + { + "type": "target", + "target": "something", + "operation": "src_add", + "sources": ["third.c"] + }, + { + "type": "target", + "target": "something", + "operation": "test" + } +] diff --git a/test cases/rewrite/2 subdirs/info.json b/test cases/rewrite/2 subdirs/info.json new file mode 100644 index 0000000..0173333 --- /dev/null +++ b/test cases/rewrite/2 subdirs/info.json @@ -0,0 +1,7 @@ +[ + { + "type": "target", + "target": "something", + "operation": "test" + } +] diff --git a/test cases/rewrite/2 subdirs/meson.build b/test cases/rewrite/2 subdirs/meson.build index 79b7ad7..c7f3fec 100644 --- a/test cases/rewrite/2 subdirs/meson.build +++ b/test cases/rewrite/2 subdirs/meson.build @@ -2,4 +2,3 @@ project('subdir rewrite', 'c') subdir('sub1') subdir('sub2') - diff --git a/test cases/rewrite/2 subdirs/sub2/meson.build b/test cases/rewrite/2 subdirs/sub2/meson.build index 0d92e7f..44b4075 100644 --- a/test cases/rewrite/2 subdirs/sub2/meson.build +++ b/test cases/rewrite/2 subdirs/sub2/meson.build @@ -1,2 +1 @@ executable('something', srcs) - |