Chromium Code Reviews| Index: tools/testing/dart/multitest.dart |
| diff --git a/tools/testing/dart/multitest.dart b/tools/testing/dart/multitest.dart |
| index ab4452137b523d86db5608a39861059c1cf7de63..824e77ca2ca8d0dbfd495e85badb4e9563735bab 100644 |
| --- a/tools/testing/dart/multitest.dart |
| +++ b/tools/testing/dart/multitest.dart |
| @@ -44,10 +44,16 @@ |
| // aaa |
| // ddd /// 07: static type error |
| // eee |
| +// |
| +// Note that it is possible to indicate more than one acceptable outcome |
| +// in the case of dynamic and static type errors |
| +// aaa |
| +// ddd /// 07: static type error, dynamic type error |
| +// eee |
| void ExtractTestsFromMultitest(String filename, |
| Map<String, String> tests, |
| - Map<String, String> outcomes) { |
| + Map<String, Set<String>> outcomes) { |
| // Read the entire file into a byte buffer and transform it to a |
| // String. This will treat the file as ascii but the only parts |
| // we are interested in will be ascii in any case. |
| @@ -90,9 +96,14 @@ void ExtractTestsFromMultitest(String filename, |
| testsAsLines[key].add(line); |
| } else { |
| (testsAsLines[key] = new List<String>.from(testTemplate)).add(line); |
| - outcomes[key] = rest; |
| - if (!validMultitestOutcomes.contains(rest)) { |
| - Expect.fail("Invalid test directive on line ${lineCount}: $rest "); |
| + List<String> outcomesList = rest.split(','); |
| + for (String nextOutcome in outcomesList) { |
| + nextOutcome = nextOutcome.trim(); |
|
Bill Hesse
2012/03/08 13:52:57
Expect(nextOutcome != '')?
Is it illegal to have a
zundel
2012/03/09 00:34:22
The value in the comment has to match a constraine
|
| + outcomes.putIfAbsent(key, () => new Set<String>()).add(nextOutcome); |
| + if (!validMultitestOutcomes.contains(nextOutcome)) { |
| + Expect.fail( |
| + "Invalid test directive '$nextOutcome' on line ${lineCount}: $rest "); |
|
Bill Hesse
2012/03/08 13:52:57
Is this line too long?
Bill Hesse
2012/03/08 13:52:57
$lineCount
|
| + } |
| } |
| } |
| } else { |
| @@ -102,7 +113,7 @@ void ExtractTestsFromMultitest(String filename, |
| } |
| // Add the template, with no multitest lines, as a test with key 'none'. |
| testsAsLines['none'] = testTemplate; |
| - outcomes['none'] = ''; |
| + outcomes['none'] = new Set<String>(); |
| // Copy all the tests into the output map tests, as multiline strings. |
| for (String key in testsAsLines.getKeys()) { |
| @@ -165,7 +176,7 @@ void DoMultitest(String filename, |
| Function multitestDone) { |
| // Each new test is a single String value in the Map tests. |
| Map<String, String> tests = new Map<String, String>(); |
| - Map<String, String> outcomes = new Map<String, String>(); |
| + Map<String, Set<String>> outcomes = new Map<String, Set<String>>(); |
| ExtractTestsFromMultitest(filename, tests, outcomes); |
| String directory = CreateMultitestDirectory(outputDir, testDir); |
| @@ -197,7 +208,7 @@ void DoMultitest(String filename, |
| var bytes = tests[key].charCodes(); |
| openedFile.writeListSync(bytes, 0, bytes.length); |
| openedFile.closeSync(); |
| - var outcome = outcomes[key]; |
| + Set<String> outcome = outcomes[key]; |
| bool enableFatalTypeErrors = outcome.contains('static type error'); |
| bool hasRuntimeErrors = outcome.contains('runtime error'); |
| bool isNegative = hasRuntimeErrors |