Skip to content

Commit

Permalink
Run tests on module path.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Sep 21, 2023
1 parent 9b25a31 commit b5020e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
28 changes: 6 additions & 22 deletions mx.trufflesqueak/mx_trufflesqueak.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,32 +101,16 @@ def _add_unit_tests(tasks, supports_coverage):
mx_unittest.unittest(unittest_args)


# Extend `vmArgs` with `_get_runtime_jvm_args` when running `mx unittest`
def _unittest_config_participant(config):
vmArgs, mainClass, mainClassArgs = config
jdk = mx.get_jdk(tag='default')
runtime_args = _get_runtime_jvm_args(jdk)
# Remove the cp argument from the runtime args
cp = None
for i, cp in enumerate(runtime_args[:]):
if cp == '-cp':
cp = runtime_args[i + 1]
runtime_args.remove('-cp')
runtime_args.remove(cp)
break
# Attach remaining runtime args
vmArgs += runtime_args
# Merge the classpaths
if cp:
for i, arg in enumerate(vmArgs):
if arg == '-cp':
vmArgs[i + 1] += ':' + cp
config = (vmArgs, mainClass, mainClassArgs)
return config

(vmArgs, mainClass, mainClassArgs) = config
vmArgs += ['-Dpolyglotimpl.DisableClassPathIsolation=true']
mainClassArgs += ['-JUnitOpenPackages', 'de.hpi.swa.trufflesqueak/*=de.hpi.swa.trufflesqueak.test']
mainClassArgs += ['-JUnitOpenPackages', 'de.hpi.swa.trufflesqueak/*=ALL-UNNAMED']
return (vmArgs, mainClass, mainClassArgs)

mx_unittest.add_config_participant(_unittest_config_participant)

mx_truffle.should_add_tck_participant(False)

def _add_tck_tests(tasks, supports_coverage):
with mx_gate.Task('TruffleSqueak TCK tests', tasks, tags=['test']) as t:
Expand Down
2 changes: 1 addition & 1 deletion mx.trufflesqueak/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
"distDependencies": ["TRUFFLESQUEAK"],
"testDistribution": True,
"maven" : False,
"useModulePath": False,
"useModulePath": True,
},
},
}

0 comments on commit b5020e2

Please sign in to comment.