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.yaml

Group: dmlc-lib
Require-tokens: public
Expand Down
43 changes: 43 additions & 0 deletions cmake/simics/dml-breaking-changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# consumed by cmake, prefixed with "dml:"
forbid-broken-unused-types:
opt-in: [4, 5, 6, 7]
forbid-broken-conditional-is:
opt-in: [4, 5, 6, 7]
remove-port-proxy-ifaces:
opt-in: [4, 5, 6, 7]
remove-port-proxy-attrs:
opt-in: [4, 5, 6, 7]
forbid-function-in-extern-struct:
opt-in: [4, 5, 6, 7]
require-version-statement:
opt-in: [4, 5, 6, 7]
transaction-by-default:
opt-in: [4, 5, 6]
port-obj-param:
opt-in: [4, 5]
shared-logs-locally:
opt-in: [4, 5, 6]
enable-WLOGMIXUP:
opt-in: [4, 5, 6]
modern-attributes:
opt-in: [4, 5, 6, 7]
strict-typechecking:
opt-in: [4, 5, 6, 7]
range-check-method-indices:
opt-in: [4, 5, 6, 7]
restrict-log-levels:
opt-in: [4, 5, 6, 7]
dml12-disable-inline-constants:
opt-in: [4, 5, 6]
dml12-not-typecheck:
opt-in: [4, 5]
dml12-remove-misc-quirks:
opt-in: [4, 5, 6]
dml12-remove-goto:
opt-in: [4, 5, 6]
dml12-modern-int:
opt-in: [4, 5, 6]
vect-needs-provisional:
opt-in: [4, 5, 6, 7]
forbid-warning-statement:
opt-in: [4, 5, 6, 7]
33 changes: 33 additions & 0 deletions test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from typing import Optional
import glob
import json
import yaml
from simicsutils.host import host_type, is_windows, batch_suffix
from simicsutils.internal import get_simics_major
import testparams
Expand All @@ -32,6 +33,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 +1896,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 +1944,35 @@ 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.yaml')
changes_in_cmake = sorted(
(tag, tuple(bc['opt-in']), tuple(bc.get('opt-out', [])))
for (tag, bc) in yaml.safe_load(file.read_text()).items())
for (tag, opt_in, opt_out) in changes_in_cmake:
apis = opt_in + opt_out
if apis != tuple(
api.ordinal for api in dml.breaking_changes.apis.values())[
:len(apis)]:
raise TestFail('versions not well-ordered: {opt_in}, {opt_out}')
changes_in_dmlc = sorted(
(tag,
tuple(api.ordinal 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