Skip to content
Permalink
Browse files

Remove the Dart 1 tests.

This deletes:

tests/co19
tests/corelib
tests/html
tests/isolate
tests/language
tests/lib

It does not delete tests/standalone because apparently there are tests
in there that are not in standalone_2. (I assume they were added after
the test migration. I don't know why they were added there.)

I have tried to remove references to the old tests from various scripts
and tools but may have missed some. (As you can imagine, grepping for
"lib" does not have the best signal-to-noise ratio.)

"It was a pleasure to burn. It was a special pleasure to see things
eaten, to see things blackened and changed. With the brass nozzle in his
fists, with this great python spitting its venomous kerosene upon the
world, the blood pounded in his head, and his hands were the hands of
some amazing conductor playing all the symphonies of blazing and burning
to bring down the tatters and charcoal ruins of history."

- Ray Bradbury, Fahrenheit 451

Change-Id: If3db4a50e7a5ee25aff8058b1483e2ce8e68424e
Reviewed-on: https://dart-review.googlesource.com/c/75420
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
  • Loading branch information...
munificent authored and commit-bot@chromium.org committed Oct 11, 2018
1 parent 9f98f5f commit f6ca2c1d8fc14abade05f8cb56058114c04f79d0
Showing 3,360 changed files with 27 additions and 353,329 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -18,36 +18,18 @@ tests/compiler/dart2js_extra/eof_line_ending_test.dart -text
tests/compiler/dart2js_extra/string_interpolation_test.dart -text
tests/compiler/dart2js_extra/string_interpolation_dynamic_test.dart -text
tests/compiler/dart2js_extra/literal_string_juxtaposition_test.dart -text
tests/language/raw_string_test.dart -text
tests/language/multiline_strings_test.dart -text
tests/language/multiline_newline_cr.dart -text
tests/language/multiline_newline_crlf.dart -text
tests/language/multiline_newline_lf.dart -text
tests/language_2/raw_string_test.dart -text
tests/language_2/multiline_strings_test.dart -text
tests/language_2/multiline_newline_cr.dart -text
tests/language_2/multiline_newline_crlf.dart -text
tests/language_2/multiline_newline_lf.dart -text
tests/lib/convert/json_pretty_test.dart -text
tests/lib_2/convert/json_pretty_test.dart -text
tests/lib/mirrors/method_mirror_source_line_ending_test.dart -text
tests/lib/mirrors/method_mirror_source_line_ending_cr.dart -text
tests/lib/mirrors/method_mirror_source_line_ending_crlf.dart -text
tests/lib/mirrors/method_mirror_source_line_ending_lf.dart -text
tests/lib/mirrors/method_mirror_source_test.dart -text
tests/lib/mirrors/method_mirror_source_other.dart -text
tests/lib_2/mirrors/method_mirror_source_line_ending_test.dart -text
tests/lib_2/mirrors/method_mirror_source_line_ending_cr.dart -text
tests/lib_2/mirrors/method_mirror_source_line_ending_crlf.dart -text
tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart -text
tests/lib_2/mirrors/method_mirror_source_test.dart -text
tests/lib_2/mirrors/method_mirror_source_other.dart -text
tests/lib_2/mirrors/method_mirror_source_line_ending_test.dart -text
tests/lib_2/mirrors/method_mirror_source_line_ending_cr.dart -text
tests/lib_2/mirrors/method_mirror_source_line_ending_crlf.dart -text
tests/lib_2/mirrors/method_mirror_source_line_ending_lf.dart -text
tests/lib_2/mirrors/method_mirror_source_test.dart -text
tests/lib_2/mirrors/method_mirror_source_other.dart -text
tests/lib_2/mirrors/method_mirror_source_test.dart -text

# Files to leave alone and not diff.
*.png binary
4 DEPS
@@ -36,7 +36,6 @@ vars = {
"chromium_git": "https://chromium.googlesource.com",
"fuchsia_git": "https://fuchsia.googlesource.com",

"co19_rev": "9858ee7d79cf09b50d6b5bc13fb950ae5f357954",
"co19_2_rev": "9484b81650d8c5bedf72abc541960dd1c90b2329",

# As Flutter does, we pull buildtools, including the clang toolchain, from
@@ -175,9 +174,6 @@ deps = {
"dep_type": "cipd",
},

Var("dart_root") + "/tests/co19/src":
Var("dart_git") + "co19.git" + "@" + Var("co19_rev"),

Var("dart_root") + "/tests/co19_2/src":
Var("chromium_git") + "/external/github.com/dart-lang/co19.git" +
"@" + Var("co19_2_rev"),
@@ -107,78 +107,6 @@ def HasFormatErrors(filename=None, contents=None):
return []


def _CheckNewTests(input_api, output_api):
testsDirectories = [
# Dart 1 tests Dart 2.0 tests
# ================= ==========================
("tests/language/", "tests/language_2/"),
("tests/corelib/", "tests/corelib_2/"),
("tests/lib/", "tests/lib_2/"),
("tests/html/", "tests/lib_2/html/"),
("tests/isolate/", "tests/lib_2/isolate/")
]

result = []
# Tuples of (new Dart 1 test path, expected Dart 2.0 test path)
dart1TestsAdded = []
# Tuples of (original Dart test path, expected Dart 2.0 test path)
dart2TestsExists = []
for f in input_api.AffectedTextFiles():
localpath = f.LocalPath()
if not(localpath.endswith('.status')):
for oldPath, newPath in testsDirectories:
if localpath.startswith(oldPath):
if f.Action() == 'A':
# Compute where the new test should live.
dart2TestPath = localpath.replace(oldPath, newPath)
dart1TestsAdded.append((localpath, dart2TestPath))
elif f.Action() == 'M':
# Find all modified tests in Dart 1.0
for oldPath, newPath in testsDirectories:
if localpath.find(oldPath) == 0:
dart2TestFilePathAbs = "%s" % \
f.AbsoluteLocalPath().replace(oldPath, newPath)
if os.path.isfile(dart2TestFilePathAbs):
#originalDart1Test.append(localpath)
dart2TestsExists.append((localpath,
localpath.replace(oldPath, newPath)))

# Does a Dart 2.0 test exist if so it must be changed too.
missingDart2TestsChange = []
for (dartTest, dart2Test) in dart2TestsExists:
foundDart2TestModified = False
for f in input_api.AffectedFiles():
if f.LocalPath() == dart2Test:
# Found corresponding Dart 2 test - great.
foundDart2TestModified = True
break
if not foundDart2TestModified:
# Add the tuple (dart 1 test path, Dart 2.0 test path)
missingDart2TestsChange.append((dartTest, dart2Test))

if missingDart2TestsChange:
errorList = []
for idx, (orginalTest, dart2Test) in enumerate(missingDart2TestsChange):
errorList.append(
'%s. Dart 1.0 test changed: %s\n%s. Only the Dart 2.0 test can '\
'change: %s\n' % (idx + 1, orginalTest, idx + 1, dart2Test))
result.append(output_api.PresubmitError(
'Error: Changed Dart 1.0 test detected - only 1.0 status files can '\
'change. Migrate test to Dart 2.0 tests:\n%s' % ''.join(errorList)))

if dart1TestsAdded:
errorList = []
for idx, (oldTestPath, newTestPath) in enumerate(dart1TestsAdded):
errorList.append('%s. New Dart 1.0 test: %s\n'
'%s. Should be Dart 2.0 test: %s\n' % \
(idx + 1, oldTestPath, idx + 1, newTestPath))
result.append(output_api.PresubmitError(
'Error: New Dart 1.0 test can not be added the test must be added '\
'as a Dart 2.0 test:\nFix tests:\n%s' % ''.join(errorList)))

return result


def _CheckStatusFiles(input_api, output_api):
local_root = input_api.change.RepositoryRoot()
upstream = input_api.change._upstream
@@ -244,13 +172,11 @@ def _CheckValidHostsInDEPS(input_api, output_api):
def CheckChangeOnCommit(input_api, output_api):
return (_CheckValidHostsInDEPS(input_api, output_api) +
_CheckBuildStatus(input_api, output_api) +
_CheckNewTests(input_api, output_api) +
_CheckDartFormat(input_api, output_api) +
_CheckStatusFiles(input_api, output_api))


def CheckChangeOnUpload(input_api, output_api):
return (_CheckValidHostsInDEPS(input_api, output_api) +
_CheckNewTests(input_api, output_api) +
_CheckDartFormat(input_api, output_api) +
_CheckStatusFiles(input_api, output_api))
@@ -17,9 +17,6 @@ const List<String> strongSuites = const <String>[
const List<String> nonStrongSuites = const <String>[
'dart2js_native',
'dart2js_extra',
'language',
'corelib',
'html',
];

main(List<String> args) {
@@ -45,15 +45,12 @@ final dart2jsConfigurations = {
};

final dart2jsStatusFiles = {
'language': 'tests/language/language_dart2js.status',
'corelib': 'tests/corelib/corelib.status',
'language_2': 'tests/language_2/language_2_dart2js.status',
// TODO(sigmund,rnystrom): update when corelib_2 gets split into multiple
// status files.
'corelib_2': 'tests/corelib_2/corelib_2.status',
'dart2js_extra': 'tests/compiler/dart2js_extra/dart2js_extra.status',
'dart2js_native': 'tests/compiler/dart2js_native/dart2js_native.status',
'html': 'tests/html/html.status',
};

main(args) {

This file was deleted.

This file was deleted.

0 comments on commit f6ca2c1

Please sign in to comment.
You can’t perform that action at this time.