Add the tests of the spec generator to the unit tests

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2966623003 .
This commit is contained in:
Brian Wilkerson 2017-06-30 10:08:50 -07:00
parent 4749014b06
commit 6248df44a6
4 changed files with 32 additions and 4 deletions

View file

@ -4,6 +4,7 @@
import 'package:test_reflective_loader/test_reflective_loader.dart';
import '../tool/spec/check_all_test.dart' as check_spec;
import 'analysis/test_all.dart' as analysis_all;
import 'analysis_server_test.dart' as analysis_server_test;
import 'channel/test_all.dart' as channel_test;
@ -46,5 +47,15 @@ main() {
services_all.main();
socket_server_test.main();
src_all.main();
defineReflectiveSuite(() {
defineReflectiveTests(SpecTest);
}, name: 'spec');
}, name: 'analysis_server');
}
@reflectiveTest
class SpecTest {
test_specHasBeenGenerated() {
check_spec.main();
}
}

View file

@ -15,6 +15,9 @@ import 'generate_all.dart';
*/
main() {
String script = Platform.script.toFilePath(windows: Platform.isWindows);
String pkgPath = normalize(join(dirname(script), '..', '..'));
GeneratedContent.checkAll(pkgPath, 'tool/spec/generate_all.dart', allTargets);
List<String> components = split(script);
int index = components.indexOf('analysis_server');
String pkgPath = joinAll(components.sublist(0, index + 1));
GeneratedContent.checkAll(
pkgPath, join('tool', 'spec', 'generate_all.dart'), allTargets);
}

View file

@ -4,6 +4,7 @@
import 'package:test_reflective_loader/test_reflective_loader.dart';
import '../tool/spec/check_all_test.dart' as check_spec;
import 'plugin/test_all.dart' as plugin;
import 'src/test_all.dart' as src;
import 'utilities/test_all.dart' as utilities;
@ -13,5 +14,15 @@ main() {
plugin.main();
src.main();
utilities.main();
defineReflectiveSuite(() {
defineReflectiveTests(SpecTest);
}, name: 'spec');
}, name: 'analyzer_plugin');
}
@reflectiveTest
class SpecTest {
test_specHasBeenGenerated() {
check_spec.main();
}
}

View file

@ -15,6 +15,9 @@ import 'generate_all.dart';
*/
main() {
String script = Platform.script.toFilePath(windows: Platform.isWindows);
String pkgPath = normalize(join(dirname(script), '..', '..'));
GeneratedContent.checkAll(pkgPath, 'tool/spec/generate_all.dart', allTargets);
List<String> components = split(script);
int index = components.indexOf('analyzer_plugin');
String pkgPath = joinAll(components.sublist(0, index + 1));
GeneratedContent.checkAll(
pkgPath, join('tool', 'spec', 'generate_all.dart'), allTargets);
}