Skip to content

Commit a214529

Browse files
More Tests for NestedSDFG Inlining (spcl#2074)
This adds some more tests, that assert on the structure of the SDFG and not simply tests if they can be compiled or not. --------- Co-authored-by: Philipp Schaad <schaad.phil@gmail.com>
1 parent 9367864 commit a214529

3 files changed

Lines changed: 686 additions & 21 deletions

File tree

tests/inline_symbol_test.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ def inline_symbol(D: dace.float32[E, F]):
1616

1717
def test_inline_symbol():
1818
sdfg = inline_symbol.to_sdfg(simplify=False)
19-
oldval = dace.Config.get_bool('experimental', 'validate_undefs')
20-
dace.Config.set('experimental', 'validate_undefs', value=True)
21-
sdfg.validate()
22-
dace.Config.set('experimental', 'validate_undefs', value=oldval)
19+
20+
# NOTE: The original test only checked if the SDFG was valid when `validate_undefs` was set
21+
# to `True`. However, since the SDFG is also valid when `validate_undefs` is set to `False`,
22+
# as it can be seen below, this test actually does not serves any meaning. It would be more
23+
# meaningful if one of the cases, probably the `validate_undefs=True` case, would fail.
24+
with dace.config.set_temporary('experimental', 'validate_undefs', value=False):
25+
sdfg.validate()
26+
with dace.config.set_temporary('experimental', 'validate_undefs', value=True):
27+
sdfg.validate()
2328

2429

2530
if __name__ == '__main__':

0 commit comments

Comments
 (0)