| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #library("standalone_test_config"); | 5 #library("standalone_test_config"); |
| 6 | 6 |
| 7 #import("../../tools/testing/dart/test_runner.dart"); | 7 #import("../../tools/testing/dart/test_runner.dart"); |
| 8 #import("../../tools/testing/dart/status_file_parser.dart"); | 8 #import("../../tools/testing/dart/status_file_parser.dart"); |
| 9 | 9 |
| 10 class StandaloneTestSuite { | 10 class StandaloneTestSuite { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 List args = ["--ignore-unrecognized-flags"]; | 57 List args = ["--ignore-unrecognized-flags"]; |
| 58 if (configuration["checked"]) { | 58 if (configuration["checked"]) { |
| 59 args.add("--enable_type_checks"); | 59 args.add("--enable_type_checks"); |
| 60 } | 60 } |
| 61 if (configuration["component"] == "leg") { | 61 if (configuration["component"] == "leg") { |
| 62 args.add("--enable_leg"); | 62 args.add("--enable_leg"); |
| 63 } | 63 } |
| 64 args.add(filename); | 64 args.add(filename); |
| 65 | 65 |
| 66 doTest(new TestCase(testName, | 66 |
| 67 shellPath, | 67 List<List> optionsList = testOptions(filename); |
| 68 args, | 68 if (optionsList.isEmpty()) { |
| 69 configuration["timeout"], | 69 doTest(new TestCase(testName, |
| 70 completeHandler, | 70 shellPath, |
| 71 expectations)); | 71 args, |
| 72 configuration["timeout"], |
| 73 completeHandler, |
| 74 expectations)); |
| 75 } else { |
| 76 for (var options in optionsList) { |
| 77 options.addAll(args); |
| 78 doTest(new TestCase(testName, |
| 79 shellPath, |
| 80 options, |
| 81 configuration["timeout"], |
| 82 completeHandler, |
| 83 expectations)); |
| 84 } |
| 85 } |
| 86 } |
| 87 |
| 88 List<List> testOptions(String filename) { |
| 89 RegExp testOptionsRegExp = const RegExp(@"// VMOptions=(.*)"); |
| 90 File file = new File(filename); |
| 91 FileInputStream fileStream = file.openInputStream(); |
| 92 StringInputStream lines = new StringInputStream(fileStream); |
| 93 |
| 94 List<List> result = new List<List>(); |
| 95 String line; |
| 96 while ((line = lines.readLine()) != null) { |
| 97 Match match = testOptionsRegExp.firstMatch(line); |
| 98 if (match != null) { |
| 99 result.add(match[1].split(' ').filter((e) => e != '')); |
| 100 } |
| 101 } |
| 102 return result; |
| 72 } | 103 } |
| 73 | 104 |
| 74 void completeHandler(TestCase testCase) { | 105 void completeHandler(TestCase testCase) { |
| 75 } | 106 } |
| 76 } | 107 } |
| OLD | NEW |