aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index f63fc18..a0b3ed5 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -5161,6 +5161,32 @@ class RewriterTests(BasePlatformTests):
out = self.extract_test_data(out)
self.assertDictEqual(list(out['target'].values())[0], expected)
+ def test_target_remove(self):
+ self.prime('1 basic')
+ self.rewrite(self.builddir, os.path.join(self.builddir, 'rmTgt.json'))
+ out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json'))
+ out = self.extract_test_data(out)
+
+ expected = {
+ 'target': {
+ 'trivialprog2@exe': {'name': 'trivialprog2', 'sources': ['fileB.cpp', 'fileC.cpp']},
+ 'trivialprog3@exe': {'name': 'trivialprog3', 'sources': ['main.cpp', 'fileA.cpp']},
+ 'trivialprog4@exe': {'name': 'trivialprog4', 'sources': ['main.cpp', 'fileA.cpp']},
+ 'trivialprog5@exe': {'name': 'trivialprog5', 'sources': ['main.cpp', 'fileB.cpp', 'fileC.cpp']},
+ 'trivialprog6@exe': {'name': 'trivialprog6', 'sources': ['main.cpp', 'fileA.cpp']},
+ 'trivialprog7@exe': {'name': 'trivialprog7', 'sources': ['fileB.cpp', 'fileC.cpp', 'main.cpp', 'fileA.cpp']},
+ 'trivialprog8@exe': {'name': 'trivialprog8', 'sources': ['main.cpp', 'fileA.cpp']},
+ }
+ }
+ self.assertDictEqual(out, expected)
+
+ def test_target_remove_subdir(self):
+ self.prime('2 subdirs')
+ self.rewrite(self.builddir, os.path.join(self.builddir, 'rmTgt.json'))
+ out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json'))
+ out = self.extract_test_data(out)
+ self.assertDictEqual(out, {})
+
def test_kwargs_info(self):
self.prime('3 kwargs')
out = self.rewrite(self.builddir, os.path.join(self.builddir, 'info.json'))