Chromium Code Reviews| 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("test_suite"); | 5 #library("test_suite"); |
| 6 | 6 |
| 7 #import("status_file_parser.dart"); | 7 #import("status_file_parser.dart"); |
| 8 #import("test_runner.dart"); | 8 #import("test_runner.dart"); |
| 9 #import("multitest.dart"); | 9 #import("multitest.dart"); |
| 10 | 10 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 for (var dummy in optionsFromFile["vmOptions"]) { | 261 for (var dummy in optionsFromFile["vmOptions"]) { |
| 262 SummaryReport.add(expectations); | 262 SummaryReport.add(expectations); |
| 263 } | 263 } |
| 264 } | 264 } |
| 265 if (expectations.contains(SKIP)) return; | 265 if (expectations.contains(SKIP)) return; |
| 266 | 266 |
| 267 switch (configuration['component']) { | 267 switch (configuration['component']) { |
| 268 case 'dartium': | 268 case 'dartium': |
| 269 case 'chromium': | 269 case 'chromium': |
| 270 case 'frogium': | 270 case 'frogium': |
| 271 enqueueBrowserTest(filename, testName, optionsFromFile, | 271 case 'webdriver': |
| 272 expectations, isNegative); | 272 enqueueBrowserTest(filename, testName, optionsFromFile, |
| 273 expectations, isNegative); | |
| 273 break; | 274 break; |
| 274 default: | 275 default: |
| 275 // Only dartc supports fatal type errors. Enable fatal type | 276 // Only dartc supports fatal type errors. Enable fatal type |
| 276 // errors with a flag and treat tests that have fatal type | 277 // errors with a flag and treat tests that have fatal type |
| 277 // errors as negative. | 278 // errors as negative. |
| 278 var enableFatalTypeErrors = | 279 var enableFatalTypeErrors = |
| 279 (info.hasFatalTypeErrors && configuration['component'] == 'dartc'); | 280 (info.hasFatalTypeErrors && configuration['component'] == 'dartc'); |
| 280 var argumentLists = argumentListsFromFile(filename, | 281 var argumentLists = argumentListsFromFile(filename, |
| 281 optionsFromFile, | 282 optionsFromFile, |
| 282 enableFatalTypeErrors); | 283 enableFatalTypeErrors); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 418 compilerArgs.add('--optimize'); | 419 compilerArgs.add('--optimize'); |
| 419 } | 420 } |
| 420 compilerArgs.addAll(vmOptions); | 421 compilerArgs.addAll(vmOptions); |
| 421 compilerArgs.add('--ignore-unrecognized-flags'); | 422 compilerArgs.add('--ignore-unrecognized-flags'); |
| 422 compilerArgs.add('--out'); | 423 compilerArgs.add('--out'); |
| 423 compilerArgs.add(compiledDartWrapperFilename); | 424 compilerArgs.add(compiledDartWrapperFilename); |
| 424 compilerArgs.add(dartWrapperFilename); | 425 compilerArgs.add(dartWrapperFilename); |
| 425 // TODO(whesse): Add --fatal-type-errors if needed. | 426 // TODO(whesse): Add --fatal-type-errors if needed. |
| 426 break; | 427 break; |
| 427 case 'frogium': | 428 case 'frogium': |
| 429 case 'webdriver': | |
| 428 compilerArgs.addAll(['--libdir=$dartDir/frog/lib', | 430 compilerArgs.addAll(['--libdir=$dartDir/frog/lib', |
| 429 '--compile-only', | 431 '--compile-only', |
| 430 '--out=$compiledDartWrapperFilename']); | 432 '--out=$compiledDartWrapperFilename']); |
| 431 compilerArgs.addAll(vmOptions); | 433 compilerArgs.addAll(vmOptions); |
| 432 compilerArgs.add(dartWrapperFilename); | 434 compilerArgs.add(dartWrapperFilename); |
| 433 break; | 435 break; |
| 434 case 'dartium': | 436 case 'dartium': |
| 435 // No compilation phase. | 437 // No compilation phase. |
| 436 compilerExecutable = null; | 438 compilerExecutable = null; |
| 437 compilerArgs = null; | 439 compilerArgs = null; |
| 438 break; | 440 break; |
| 439 default: | 441 default: |
| 440 Expect.fail('unimplemented component $component'); | 442 Expect.fail('unimplemented component $component'); |
| 441 } | 443 } |
| 442 | 444 |
| 443 var args = ['--no-timeout']; | 445 String executable = getFilename(dumpRenderTreeFilename); |
| 444 if (component == 'dartium') { | 446 List<String> args; |
| 445 var dartFlags = ['--enable_asserts', '--enable_type_checks']; | 447 if (component == 'webdriver') { |
| 446 dartFlags.addAll(vmOptions); | 448 executable = '$dartDir/tools/testing/run_selenium.py'; |
| 447 args.add('--dart-flags=${Strings.join(dartFlags, " ")}'); | 449 String browserFlag = 'chrome'; |
| 450 if (configuration['flag'] != null) { | |
| 451 for (var flag in configuration['flag'].split(',')) { | |
|
Bill Hesse
2012/01/06 13:39:09
Note: we could split configurations with commas in
Emily Fortuna
2012/01/08 18:47:06
You mean potentially list multiple browsers when c
| |
| 452 switch (flag) { | |
| 453 case 'ff': | |
| 454 case 'firefox': | |
| 455 browserFlag = 'ff'; | |
| 456 break; | |
| 457 case 'ie': | |
| 458 case 'explorer': | |
| 459 case 'internet-explorer': | |
| 460 browserFlag = 'ie'; | |
| 461 break; | |
| 462 case 'safari': | |
| 463 browserFlag = 'safari'; | |
| 464 break; | |
| 465 } | |
| 466 } | |
| 467 } | |
| 468 args = ['--out', htmlPath, '--browser', browserFlag]; | |
| 469 | |
| 470 } else { | |
|
Bill Hesse
2012/01/06 13:39:09
Move dumpRenderTree value for executable here?
| |
| 471 args = ['--no-timeout']; | |
| 472 if (component == 'dartium') { | |
| 473 var dartFlags = ['--enable_asserts', '--enable_type_checks']; | |
| 474 dartFlags.addAll(vmOptions); | |
| 475 args.add('--dart-flags=${Strings.join(dartFlags, " ")}'); | |
| 476 } | |
| 477 args.add(htmlPath); | |
| 448 } | 478 } |
| 449 args.add(htmlPath); | |
| 450 | |
| 451 // Create BrowserTestCase and queue it. | 479 // Create BrowserTestCase and queue it. |
| 452 var testCase = new BrowserTestCase( | 480 var testCase = new BrowserTestCase( |
| 453 testName, | 481 testName, |
| 454 compilerExecutable, | 482 compilerExecutable, |
| 455 compilerArgs, | 483 compilerArgs, |
| 456 getFilename(dumpRenderTreeFilename), | 484 executable, |
| 457 args, | 485 args, |
| 458 configuration, | 486 configuration, |
| 459 completeHandler, | 487 completeHandler, |
| 460 expectations, | 488 expectations, |
| 461 optionsFromFile['isNegative']); | 489 optionsFromFile['isNegative']); |
| 462 doTest(testCase); | 490 doTest(testCase); |
| 463 } | 491 } |
| 464 } | 492 } |
| 465 | 493 |
| 466 /*** | 494 /*** |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 496 } | 524 } |
| 497 return tempDir; | 525 return tempDir; |
| 498 } | 526 } |
| 499 | 527 |
| 500 String get scriptType() { | 528 String get scriptType() { |
| 501 switch (configuration['component']) { | 529 switch (configuration['component']) { |
| 502 case 'dartium': | 530 case 'dartium': |
| 503 return 'application/dart'; | 531 return 'application/dart'; |
| 504 case 'chromium': | 532 case 'chromium': |
| 505 case 'frogium': | 533 case 'frogium': |
| 534 case 'webdriver': | |
| 506 return 'text/javascript'; | 535 return 'text/javascript'; |
| 507 default: | 536 default: |
| 508 Expect.fail('Unimplemented component scriptType'); | 537 Expect.fail('Unimplemented component scriptType'); |
| 509 return null; | 538 return null; |
| 510 } | 539 } |
| 511 } | 540 } |
| 512 | 541 |
| 513 String getHtmlName(String filename) { | 542 String getHtmlName(String filename) { |
| 514 return filename.replaceAll('/', '_') + configuration['component'] + '.html'; | 543 return filename.replaceAll('/', '_') + configuration['component'] + '.html'; |
| 515 } | 544 } |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 851 } | 880 } |
| 852 | 881 |
| 853 static String compilerName(Map configuration) { | 882 static String compilerName(Map configuration) { |
| 854 String postfix = | 883 String postfix = |
| 855 (new Platform().operatingSystem() == 'windows') ? '.exe' : ''; | 884 (new Platform().operatingSystem() == 'windows') ? '.exe' : ''; |
| 856 switch (configuration['component']) { | 885 switch (configuration['component']) { |
| 857 case 'chromium': | 886 case 'chromium': |
| 858 case 'dartc': | 887 case 'dartc': |
| 859 return 'compiler/bin/dartc$postfix'; | 888 return 'compiler/bin/dartc$postfix'; |
| 860 case 'frogium': | 889 case 'frogium': |
| 890 case 'webdriver': | |
| 861 return 'frog/bin/frogsh$postfix'; | 891 return 'frog/bin/frogsh$postfix'; |
| 862 default: | 892 default: |
| 863 throw "Unknown compiler for: ${configuration['component']}"; | 893 throw "Unknown compiler for: ${configuration['component']}"; |
| 864 } | 894 } |
| 865 } | 895 } |
| 866 | 896 |
| 867 static String dartShellFileName(Map configuration) { | 897 static String dartShellFileName(Map configuration) { |
| 868 var name = '${buildDir(configuration)}/${executableName(configuration)}'; | 898 var name = '${buildDir(configuration)}/${executableName(configuration)}'; |
| 869 if (!(new File(name)).existsSync()) { | 899 if (!(new File(name)).existsSync()) { |
| 870 throw "Executable '$name' does not exist"; | 900 throw "Executable '$name' does not exist"; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 965 * $noCrash tests are expected to be flaky but not crash | 995 * $noCrash tests are expected to be flaky but not crash |
| 966 * $pass tests are expected to pass | 996 * $pass tests are expected to pass |
| 967 * $failOk tests are expected to fail that we won't fix | 997 * $failOk tests are expected to fail that we won't fix |
| 968 * $fail tests are expected to fail that we should fix | 998 * $fail tests are expected to fail that we should fix |
| 969 * $crash tests are expected to crash that we should fix | 999 * $crash tests are expected to crash that we should fix |
| 970 * $timeout tests are allowed to timeout\ | 1000 * $timeout tests are allowed to timeout\ |
| 971 """; | 1001 """; |
| 972 print(report); | 1002 print(report); |
| 973 } | 1003 } |
| 974 } | 1004 } |
| OLD | NEW |