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

Unified Diff: test/codegen_test.dart

Issue 1007313003: Move sunflower to a new directory, make final tweaks to make it all work. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 | « test/codegen/sunflower/sunflower.html ('k') | test/sunflower/README.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen_test.dart
diff --git a/test/codegen_test.dart b/test/codegen_test.dart
index 4dc89d76799622ff8631def5d9aeae4f5913e6eb..f73d9ce56e9731c8ecfbe88ae0cb74141fd79eb0 100644
--- a/test/codegen_test.dart
+++ b/test/codegen_test.dart
@@ -57,11 +57,11 @@ main(arguments) {
.where((p) => p.endsWith('.dart') && filePattern.hasMatch(p));
compile(String entryPoint, String sdkPath,
- {bool checkSdk: false, bool serverMode: false}) {
+ {bool checkSdk: false, bool serverMode: false, String subDir}) {
var runtimeDir = path.join(
path.dirname(path.dirname(Platform.script.path)), 'lib', 'runtime');
var options = new CompilerOptions(
- outputDir: serverMode ? path.join(actualDir, 'server_mode') : actualDir,
+ outputDir: subDir == null ? actualDir : path.join(actualDir, subDir),
useColors: false,
outputDart: dartGen,
formatOutput: dartGen,
@@ -143,6 +143,33 @@ main(arguments) {
});
if (!dartGen) {
+ test('devc jscodegen sunflower.html', () {
+ var filePath = path.join(inputDir, 'sunflower', 'sunflower.html');
+ compilerMessages.writeln('// Messages from compiling sunflower.html');
+
+ var result = compile(filePath, realSdk, subDir: 'sunflower');
+ var success = !result.failure;
+
+ // Write compiler messages to disk.
+ new File(path.join(actualDir, 'sunflower', 'sunflower.txt'))
+ .writeAsStringSync(compilerMessages.toString());
+
+ var expectedFiles = [
+ 'sunflower.html',
+ 'sunflower.js',
+ 'sunflower.css',
+ 'math.png',
+ 'dev_compiler/runtime/dart_core.js',
+ 'dev_compiler/runtime/dart_runtime.js',
+ 'dev_compiler/runtime/harmony_feature_check.js',
+ ];
+ for (var filepath in expectedFiles) {
+ var outFile = new File(path.join(actualDir, 'sunflower', filepath));
+ expect(outFile.existsSync(), success,
+ reason: '${outFile.path} was created iff compilation succeeds');
+ }
+ });
+
test('devc jscodegen html_input.html', () {
var filePath = path.join(inputDir, 'html_input.html');
compilerMessages.writeln('// Messages from compiling html_input.html');
@@ -186,7 +213,8 @@ main(arguments) {
var filePath = path.join(inputDir, 'html_input.html');
compilerMessages.writeln('// Messages from compiling html_input.html');
- var result = compile(filePath, realSdk, serverMode: true);
+ var result =
+ compile(filePath, realSdk, serverMode: true, subDir: 'server_mode');
var success = !result.failure;
// Write compiler messages to disk.
« no previous file with comments | « test/codegen/sunflower/sunflower.html ('k') | test/sunflower/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698