Skip to content

Commit 59b7ed1

Browse files
committed
Throw for unknown platforms in the config file
1 parent ccd94e1 commit 59b7ed1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/src/runner/configuration/load.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,13 @@ class _ConfigurationLoader {
206206

207207
var concurrency = _getInt("concurrency");
208208

209-
var platforms = _getList("platforms",
210-
(platformNode) => _parseIdentifierLike(platformNode, "Platform name"));
209+
var platforms = _getList("platforms", (platformNode) {
210+
var name = _parseIdentifierLike(platformNode, "Platform name");
211+
if (!TestPlatform.all.any((platform) => platform.identifier == name)) {
212+
throw new SourceSpanFormatException(
213+
'Unknown platform "$name"', platformNode.span, _source);
214+
}
215+
});
211216

212217
var chosenPresets = _getList("add_presets",
213218
(presetNode) => _parseIdentifierLike(presetNode, "Preset name"));

0 commit comments

Comments
 (0)