Added subdir test
This commit is contained in:
parent
b7c6f3ec72
commit
027c3c9ac7
|
@ -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…
Reference in New Issue