Skip to content

Commit

Permalink
[infra] Disallow spaces in test configuration names
Browse files Browse the repository at this point in the history
Change-Id: Ibd96e414d9a8c76a36b4fc8360ceca3560f1dd91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181404
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
  • Loading branch information
whesse authored and pull[bot] committed Jan 29, 2021
1 parent 90faef9 commit fd7010b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion pkg/smith/lib/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,12 @@ class Configuration {
useHotReload = useHotReload ?? false,
useHotReloadRollback = useHotReloadRollback ?? false,
useSdk = useSdk ?? false,
useQemu = useQemu ?? false;
useQemu = useQemu ?? false {
if (name.contains(" ")) {
throw ArgumentError(
"Name of test configuration cannot contain spaces: $name");
}
}

/// Returns `true` if this configuration's options all have the same values
/// as [other].
Expand Down
2 changes: 1 addition & 1 deletion pkg/smith/test/configuration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void main() {
);

var debugWithAsserts2 = Configuration(
"different name",
"different-name",
Architecture.x64,
Compiler.dart2js,
Mode.debug,
Expand Down
2 changes: 1 addition & 1 deletion pkg/test_runner/lib/src/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ compiler.''',
for (var sanitizerName in sanitizers.split(",")) {
var sanitizer = Sanitizer.find(sanitizerName);
var configuration = Configuration(
"custom configuration_${configurationNumber++}",
"custom-configuration-${configurationNumber++}",
architecture,
compiler,
mode,
Expand Down

0 comments on commit fd7010b

Please sign in to comment.