Support platform-specific test lines (#43458)
This commit is contained in:
parent
4ac2daf337
commit
7de800c44a
@ -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 {
|
|||||||
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),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user