Unverified Commit 7de800c4 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Support platform-specific test lines (#43458)

parent 4ac2daf3
...@@ -210,6 +210,18 @@ class TestFile { ...@@ -210,6 +210,18 @@ class TestFile {
update.add(Directory(line.substring(7))); update.add(Directory(line.substring(7)));
} else if (line.startsWith('test=')) { } else if (line.startsWith('test=')) {
test.add(line.substring(5)); test.add(line.substring(5));
} else if (line.startsWith('test.windows=')) {
if (Platform.isWindows)
test.add(line.substring(5));
} else if (line.startsWith('test.macos=')) {
if (Platform.isMacOS)
test.add(line.substring(5));
} else if (line.startsWith('test.linux=')) {
if (Platform.isLinux)
test.add(line.substring(5));
} else if (line.startsWith('test.posix=')) {
if (Platform.isLinux || Platform.isMacOS)
test.add(line.substring(5));
} else { } else {
throw FormatException('${errorPrefix}Unexpected directive:\n$line'); throw FormatException('${errorPrefix}Unexpected directive:\n$line');
} }
...@@ -231,7 +243,7 @@ class TestFile { ...@@ -231,7 +243,7 @@ class TestFile {
if (update.isEmpty) if (update.isEmpty)
throw FormatException('${errorPrefix}No "update" directives specified. At least one directory must be specified. (It can be "." to just upgrade the root of the repository.)'); throw FormatException('${errorPrefix}No "update" directives specified. At least one directory must be specified. (It can be "." to just upgrade the root of the repository.)');
if (test.isEmpty) if (test.isEmpty)
throw FormatException('${errorPrefix}No "test" directives specified. At least one command must be specified to run tests.'); throw FormatException('${errorPrefix}No "test" directives specified for this platform. At least one command must be specified to run tests on each of Windows, MacOS, and Linux.');
return TestFile._( return TestFile._(
List<String>.unmodifiable(contacts), List<String>.unmodifiable(contacts),
List<String>.unmodifiable(fetch), List<String>.unmodifiable(fetch),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment