mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
[test_runner] Adjust VMTestSuite to appropriately use qemu.
No qemu-using CI bot runs vm/cc tests currently, but this allows developers to run vm/cc tests locally using qemu. This way, tests like those from assembler_arm_test.cc can be tested both with and without our own ARM7/ARM8 simulators. Change-Id: I7fd97e411936954b59d9f0fc65e16c518e9ee332 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204781 Commit-Queue: Tess Strickland <sstrickl@google.com> Reviewed-by: Daco Harkes <dacoharkes@google.com> Reviewed-by: Clement Skau <cskau@google.com>
This commit is contained in:
parent
a44b4f5b62
commit
f75d1819bc
1 changed files with 22 additions and 5 deletions
|
@ -22,6 +22,7 @@ import 'expectation_set.dart';
|
|||
import 'multitest.dart';
|
||||
import 'path.dart';
|
||||
import 'repository.dart';
|
||||
import 'runtime_configuration.dart' show QemuConfig;
|
||||
import 'summary_report.dart';
|
||||
import 'test_case.dart';
|
||||
import 'test_file.dart';
|
||||
|
@ -251,6 +252,8 @@ abstract class TestSuite {
|
|||
class VMTestSuite extends TestSuite {
|
||||
String targetRunnerPath;
|
||||
String hostRunnerPath;
|
||||
List<String> initialHostArguments;
|
||||
List<String> initialTargetArguments;
|
||||
final String dartDir;
|
||||
|
||||
VMTestSuite(TestConfiguration configuration)
|
||||
|
@ -269,6 +272,18 @@ class VMTestSuite extends TestSuite {
|
|||
} else {
|
||||
hostRunnerPath = targetRunnerPath;
|
||||
}
|
||||
|
||||
initialHostArguments = <String>[];
|
||||
initialTargetArguments = <String>[];
|
||||
if (configuration.useQemu) {
|
||||
final config = QemuConfig.all[configuration.architecture];
|
||||
initialHostArguments.insert(0, hostRunnerPath);
|
||||
initialHostArguments.insertAll(0, config.arguments);
|
||||
initialTargetArguments.insert(0, targetRunnerPath);
|
||||
initialTargetArguments.insertAll(0, config.arguments);
|
||||
hostRunnerPath = config.executable;
|
||||
targetRunnerPath = config.executable;
|
||||
}
|
||||
}
|
||||
|
||||
void findTestCases(TestCaseEvent onTest, Map testCache) {
|
||||
|
@ -277,7 +292,7 @@ class VMTestSuite extends TestSuite {
|
|||
var expectations = ExpectationSet.read(statusFiles, configuration);
|
||||
|
||||
try {
|
||||
for (var test in _listTests(hostRunnerPath)) {
|
||||
for (var test in _listTests()) {
|
||||
_addTest(expectations, test, onTest);
|
||||
}
|
||||
} catch (error, s) {
|
||||
|
@ -315,7 +330,8 @@ class VMTestSuite extends TestSuite {
|
|||
: '$buildDir/gen/kernel_service.dill';
|
||||
var dfePath = Path(filename).absolute.toNativePath();
|
||||
var args = [
|
||||
// '--dfe' has to be the first argument for run_vm_test to pick it up.
|
||||
...initialTargetArguments,
|
||||
// '--dfe' must be the first VM argument for run_vm_test to pick it up.
|
||||
'--dfe=$dfePath',
|
||||
if (expectations.contains(Expectation.crash)) '--suppress-core-dump',
|
||||
if (configuration.experiments.isNotEmpty)
|
||||
|
@ -330,10 +346,11 @@ class VMTestSuite extends TestSuite {
|
|||
_addTestCase(testFile, fullName, [command], expectations, onTest);
|
||||
}
|
||||
|
||||
Iterable<VMUnitTest> _listTests(String runnerPath) {
|
||||
var result = Process.runSync(runnerPath, ["--list"]);
|
||||
Iterable<VMUnitTest> _listTests() {
|
||||
var args = [...initialHostArguments, "--list"];
|
||||
var result = Process.runSync(hostRunnerPath, args);
|
||||
if (result.exitCode != 0) {
|
||||
throw "Failed to list tests: '$runnerPath --list'. "
|
||||
throw "Failed to list tests: '$hostRunnerPath ${args.join(' ')}'. "
|
||||
"Process exited with ${result.exitCode}";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue