Skip to content

Commit 810f1b3

Browse files
committed
Add dml-breaking-changes file to be used by cmake
1 parent c15dd85 commit 810f1b3

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

MODULEINFO

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Make: dmlc
9191
@dml-1.2-reference-manual
9292
@dml-1.4-reference-manual
9393
@dmlc-py
94+
[src/tools/dmlc/]cmake/simics/dml-breaking-changes
9495

9596
Group: dmlc-lib
9697
Require-tokens: public

cmake/simics/dml-breaking-changes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# consumed by cmake, prefixed with "dml:"
2+
forbid-broken-unused-types
3+
forbid-broken-conditional-is
4+
remove-port-proxy-ifaces
5+
remove-port-proxy-attrs
6+
forbid-function-in-extern-struct
7+
require-version-statement
8+
transaction-by-default 7
9+
port-obj-param 6 7
10+
shared-logs-locally 7
11+
enable-WLOGMIXUP 7
12+
modern-attributes
13+
strict-typechecking
14+
range-check-method-indices
15+
restrict-log-levels
16+
dml12-disable-inline-constants 7
17+
dml12-not-typecheck 6 7
18+
dml12-remove-misc-quirks 7
19+
dml12-remove-goto 7
20+
dml12-modern-int 7
21+
vect-needs-provisional
22+
forbid-warning-statement

test/tests.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def project_host_path():
3232

3333
sys.path.append(join(project_host_path(), 'bin', 'dml', 'python'))
3434
import dml.globals
35+
import dml.breaking_changes
3536
import dead_dml_methods
3637
from 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

19411944
all_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
19441971
for version in ['1.2', '1.4']:
19451972
testname = '%s-devinfo-generate' % (version,)

0 commit comments

Comments
 (0)