| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /// Given the beginning and ending file names in a batch, does as much automated | 5 /// Given the beginning and ending file names in a batch, does as much automated |
| 6 /// migration and possible and prints out the remaining manual steps required. | 6 /// migration and possible and prints out the remaining manual steps required. |
| 7 /// | 7 /// |
| 8 /// This should be safe to run, and safe to re-run on an in-progress chunk. | 8 /// This should be safe to run, and safe to re-run on an in-progress chunk. |
| 9 /// However, it has not been thoroughly tested, so run at your own risk. | 9 /// However, it has not been thoroughly tested, so run at your own risk. |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 for (var test in tests) { | 60 for (var test in tests) { |
| 61 var todos = test.migrate(); | 61 var todos = test.migrate(); |
| 62 if (todos.isEmpty) { | 62 if (todos.isEmpty) { |
| 63 migratedTests++; | 63 migratedTests++; |
| 64 } else { | 64 } else { |
| 65 unmigratedTests++; | 65 unmigratedTests++; |
| 66 allTodos[test.twoPath] = todos; | 66 allTodos[test.twoPath] = todos; |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 migrateStatusEntries(tests); | 70 migrateStatusEntries(tests, allTodos); |
| 71 | 71 |
| 72 // Tell the user what's left to do. | 72 // Tell the user what's left to do. |
| 73 print(""); | 73 print(""); |
| 74 var summary = ""; | 74 var summary = ""; |
| 75 | 75 |
| 76 if (migratedTests > 0) { | 76 if (migratedTests > 0) { |
| 77 var s = migratedTests == 1 ? "" : "s"; | 77 var s = migratedTests == 1 ? "" : "s"; |
| 78 summary += "Successfully migrated ${green(migratedTests)} test$s. "; | 78 summary += "Successfully migrated ${green(migratedTests)} test$s. "; |
| 79 } | 79 } |
| 80 | 80 |
| 81 if (unmigratedTests > 0) { | 81 if (unmigratedTests > 0) { |
| 82 var s = unmigratedTests == 1 ? "" : "s"; | 82 var s = unmigratedTests == 1 ? "" : "s"; |
| 83 summary += "Need manual work on ${red(unmigratedTests)} test$s:"; | 83 summary += "Need manual work on ${red(unmigratedTests)} test$s:"; |
| 84 } | 84 } |
| 85 | 85 |
| 86 print(summary); | 86 print(summary); |
| 87 var todoTests = allTodos.keys.toList(); | 87 var todoTests = allTodos.keys.toList(); |
| 88 todoTests.sort(); | 88 todoTests.sort(); |
| 89 for (var todoTest in todoTests) { | 89 for (var todoTest in todoTests) { |
| 90 print("- ${bold(todoTest)}:"); | 90 print("- ${bold(todoTest)}:"); |
| 91 allTodos[todoTest].forEach(todo); | 91 allTodos[todoTest].forEach(todo); |
| 92 } | 92 } |
| 93 } | 93 } |
| OLD | NEW |