diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-11-28 21:58:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-28 21:58:11 +0200 |
commit | b0611bdd9a2c21fb55ec5604c445bca124011ab3 (patch) | |
tree | 50e2c8a677789dc2f46121685912e66fdc50ece5 /run_unittests.py | |
parent | d502e83493ea24e31c2b9e1034baf0a9408009ba (diff) | |
parent | e702d754b150dea00dcdf0956bc958d059e47ce9 (diff) | |
download | meson-b0611bdd9a2c21fb55ec5604c445bca124011ab3.zip meson-b0611bdd9a2c21fb55ec5604c445bca124011ab3.tar.gz meson-b0611bdd9a2c21fb55ec5604c445bca124011ab3.tar.bz2 |
Merge pull request #3061 from jon-turney/introspect-custom-target-files
Fix 'meson introspect --target-files' for a custom target
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index d23918c..ae2c8c7 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -2473,6 +2473,38 @@ int main(int argc, char **argv) { self.init(testdir, ['--cross-file=' + name], inprocess=True) self.wipe() + def test_introspect_target_files(self): + ''' + Tests that mesonintrospect --target-files returns expected output. + ''' + testdir = os.path.join(self.common_test_dir, '8 install') + self.init(testdir) + expected = { + 'stat@sta': ['stat.c'], + 'prog@exe': ['prog.c'], + } + t_intro = self.introspect('--targets') + self.assertCountEqual([t['id'] for t in t_intro], expected) + for t in t_intro: + id = t['id'] + tf_intro = self.introspect(['--target-files', id]) + self.assertEqual(tf_intro, expected[id]) + self.wipe() + + testdir = os.path.join(self.common_test_dir, '53 custom target') + self.init(testdir) + expected = { + 'bindat@cus': ['data_source.txt'], + 'depfile@cus': [], + } + t_intro = self.introspect('--targets') + self.assertCountEqual([t['id'] for t in t_intro], expected) + for t in t_intro: + id = t['id'] + tf_intro = self.introspect(['--target-files', id]) + self.assertEqual(tf_intro, expected[id]) + self.wipe() + def test_compiler_run_command(self): ''' The test checks that the compiler object can be passed to |