Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Unified Diff: pkg/analysis_server/tool/spec/check_all_test.dart

Issue 469543002: Add a test to verify that analysis server code generation is up to date. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unused imports Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/tool/spec/codegen_analysis_server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/tool/spec/check_all_test.dart
diff --git a/pkg/analysis_server/tool/spec/check_all_test.dart b/pkg/analysis_server/tool/spec/check_all_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..850357a8407f4bae3c6ce48c279193a64c1a7674
--- /dev/null
+++ b/pkg/analysis_server/tool/spec/check_all_test.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library check.all;
+
+import 'dart:io';
+
+import 'package:path/path.dart';
+
+import 'codegen_tools.dart';
+import 'generate_all.dart';
+
+/**
+ * Check that all targets have been code generated. If they haven't tell the
+ * user to run generate_all.dart.
+ */
+main() {
+ String script = Platform.script.toFilePath(windows: Platform.isWindows);
+ Directory.current = new Directory(dirname(script));
+ bool generateAllNeeded = false;
+ for (GeneratedFile generatedFile in allTargets) {
+ if (!generatedFile.check()) {
+ print(
+ '${generatedFile.outputFile.absolute} does not have expected contents.');
+ generateAllNeeded = true;
+ }
+ }
+ if (generateAllNeeded) {
+ print('Please regenerate using:');
+ String executable = Platform.executable;
+ String packageRoot = '';
+ if (Platform.packageRoot.isNotEmpty) {
+ packageRoot = ' --package-root=${Platform.packageRoot}';
+ }
+ String generateScript = join(dirname(script), 'generate_all.dart');
+ print(' $executable$packageRoot $generateScript');
+ exit(1);
+ } else {
+ print('All generated files up to date.');
+ }
+}
« no previous file with comments | « no previous file | pkg/analysis_server/tool/spec/codegen_analysis_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698