diff --git a/MODULEINFO b/MODULEINFO index 1b18318a..e358d407 100644 --- a/MODULEINFO +++ b/MODULEINFO @@ -91,6 +91,7 @@ Make: dmlc @dml-1.2-reference-manual @dml-1.4-reference-manual @dmlc-py + [src/tools/dmlc/]cmake/simics/dml-breaking-changes Group: dmlc-lib Require-tokens: public diff --git a/cmake/simics/dml-breaking-changes b/cmake/simics/dml-breaking-changes new file mode 100644 index 00000000..9a00dd43 --- /dev/null +++ b/cmake/simics/dml-breaking-changes @@ -0,0 +1,22 @@ +# consumed by cmake, prefixed with "dml:" +forbid-broken-unused-types +forbid-broken-conditional-is +remove-port-proxy-ifaces +remove-port-proxy-attrs +forbid-function-in-extern-struct +require-version-statement +transaction-by-default 7 +port-obj-param 6 7 +shared-logs-locally 7 +enable-WLOGMIXUP 7 +modern-attributes +strict-typechecking +range-check-method-indices +restrict-log-levels +dml12-disable-inline-constants 7 +dml12-not-typecheck 6 7 +dml12-remove-misc-quirks 7 +dml12-remove-goto 7 +dml12-modern-int 7 +vect-needs-provisional +forbid-warning-statement diff --git a/test/tests.py b/test/tests.py index 862b1039..db5c5062 100644 --- a/test/tests.py +++ b/test/tests.py @@ -32,6 +32,7 @@ def project_host_path(): sys.path.append(join(project_host_path(), 'bin', 'dml', 'python')) import dml.globals +import dml.breaking_changes import dead_dml_methods from dead_dml_methods import line_directive_re @@ -1894,6 +1895,8 @@ def test(self): 'lib-old-4.8/1.2/LICENSE', # file listing 'MODULEINFO', + # data file + 'cmake/simics/dml-breaking-changes', # essentially data files 'doc/1.2/toc.json', 'doc/1.4/toc.json', @@ -1940,6 +1943,30 @@ def test(self): all_tests.append(CopyrightTestCase('copyright')) +class CMakeTestCase(BaseTestCase): + __slots__ = () + def test(self): + file = (Path(__file__).parent.parent / 'cmake' / 'simics' + / 'dml-breaking-changes') + lines = [line.strip() for line in file.read_text().splitlines()] + lines = [line.split() + for line in lines if line and not line.startswith('#')] + changes_in_cmake = sorted( + (tag, tuple(apis)) for (tag, *apis) in lines) + changes_in_dmlc = sorted( + (tag, + tuple(api.str for api in dml.breaking_changes.apis.values() + if api > change.required_after)) + for (tag, change) in dml.breaking_changes.changes.items()) + if (changes_in_cmake != changes_in_dmlc): + self.pr(f"changes only in {file}: " + str( + set(changes_in_cmake) - set(changes_in_dmlc))) + self.pr(f"changes only in breaking_changes.py: " + str( + set(changes_in_dmlc) - set(changes_in_cmake))) + raise TestFail(f'mismatch') + +all_tests.append(CMakeTestCase('cmake')) + # Device info XML generation works for version in ['1.2', '1.4']: testname = '%s-devinfo-generate' % (version,)