Added subdir test

This commit is contained in:
Daniel Mensinger 2019-01-22 17:04:43 +01:00
parent b7c6f3ec72
commit 027c3c9ac7
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
5 changed files with 36 additions and 2 deletions

View File

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

View File

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

View File

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

View File

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

View File

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