Added subdir test

pull/4814/head
Daniel Mensinger 6 years ago
parent b7c6f3ec72
commit 027c3c9ac7
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 16
      run_unittests.py
  2. 13
      test cases/rewrite/2 subdirs/addSrc.json
  3. 7
      test cases/rewrite/2 subdirs/info.json
  4. 1
      test cases/rewrite/2 subdirs/meson.build
  5. 1
      test cases/rewrite/2 subdirs/sub2/meson.build

@ -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):

@ -0,0 +1,13 @@
[
{
"type": "target",
"target": "something",
"operation": "src_add",
"sources": ["third.c"]
},
{
"type": "target",
"target": "something",
"operation": "test"
}
]

@ -0,0 +1,7 @@
[
{
"type": "target",
"target": "something",
"operation": "test"
}
]

@ -2,4 +2,3 @@ project('subdir rewrite', 'c')
subdir('sub1')
subdir('sub2')

@ -1,2 +1 @@
executable('something', srcs)

Loading…
Cancel
Save