Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MODULEINFO
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions cmake/simics/dml-breaking-changes
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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,)
Expand Down