@@ -32,6 +32,7 @@ def project_host_path():
3232
3333sys .path .append (join (project_host_path (), 'bin' , 'dml' , 'python' ))
3434import dml .globals
35+ import dml .breaking_changes
3536import dead_dml_methods
3637from dead_dml_methods import line_directive_re
3738
@@ -1894,6 +1895,8 @@ def test(self):
18941895 'lib-old-4.8/1.2/LICENSE' ,
18951896 # file listing
18961897 'MODULEINFO' ,
1898+ # data file
1899+ 'cmake/simics/dml-breaking-changes' ,
18971900 # essentially data files
18981901 'doc/1.2/toc.json' ,
18991902 'doc/1.4/toc.json' ,
@@ -1940,6 +1943,30 @@ def test(self):
19401943
19411944all_tests .append (CopyrightTestCase ('copyright' ))
19421945
1946+ class CMakeTestCase (BaseTestCase ):
1947+ __slots__ = ()
1948+ def test (self ):
1949+ file = (Path (__file__ ).parent .parent / 'cmake' / 'simics'
1950+ / 'dml-breaking-changes' )
1951+ lines = [line .strip () for line in file .read_text ().splitlines ()]
1952+ lines = [line .split ()
1953+ for line in lines if line and not line .startswith ('#' )]
1954+ changes_in_cmake = sorted (
1955+ (tag , tuple (apis )) for (tag , * apis ) in lines )
1956+ changes_in_dmlc = sorted (
1957+ (tag ,
1958+ tuple (api .str for api in dml .breaking_changes .apis .values ()
1959+ if api > change .required_after ))
1960+ for (tag , change ) in dml .breaking_changes .changes .items ())
1961+ if (changes_in_cmake != changes_in_dmlc ):
1962+ self .pr (f"changes only in { file } : " + str (
1963+ set (changes_in_cmake ) - set (changes_in_dmlc )))
1964+ self .pr (f"changes only in breaking_changes.py: " + str (
1965+ set (changes_in_dmlc ) - set (changes_in_cmake )))
1966+ raise TestFail (f'mismatch' )
1967+
1968+ all_tests .append (CMakeTestCase ('cmake' ))
1969+
19431970# Device info XML generation works
19441971for version in ['1.2' , '1.4' ]:
19451972 testname = '%s-devinfo-generate' % (version ,)
0 commit comments