From 7de800c44ae76a3f8f1d2a271210ccc1ef058194 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Mon, 28 Oct 2019 15:51:22 -0700 Subject: [PATCH] Support platform-specific test lines (#43458) --- dev/customer_testing/run_tests.dart | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dev/customer_testing/run_tests.dart b/dev/customer_testing/run_tests.dart index 0a8ab196dd..c519d62f4e 100644 --- a/dev/customer_testing/run_tests.dart +++ b/dev/customer_testing/run_tests.dart @@ -210,6 +210,18 @@ class TestFile { update.add(Directory(line.substring(7))); } else if (line.startsWith('test=')) { 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 { throw FormatException('${errorPrefix}Unexpected directive:\n$line'); } @@ -231,7 +243,7 @@ class TestFile { 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.)'); 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._( List.unmodifiable(contacts), List.unmodifiable(fetch),