mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 08:24:39 +00:00
[frontend-server] Add a test for dep-file generation.
This is a follow-up to 4c9b712052
.
Change-Id: I0a20f38b3370eda6dcda218a5a76b58646aeb2f3
Reviewed-on: https://dart-review.googlesource.com/53523
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
parent
f64ba0cadd
commit
c129fde29a
|
@ -654,6 +654,31 @@ Future<int> main() async {
|
|||
int exitcode = await starter(args);
|
||||
expect(exitcode, equals(0));
|
||||
});
|
||||
|
||||
test('compile and produce deps file', () async {
|
||||
var file = new File('${tempDir.path}/foo.dart')..createSync();
|
||||
file.writeAsStringSync("main() {}\n");
|
||||
var dillFile = new File('${tempDir.path}/app.dill');
|
||||
expect(dillFile.existsSync(), equals(false));
|
||||
var depFile = new File('${tempDir.path}/depfile');
|
||||
expect(depFile.existsSync(), equals(false));
|
||||
final List<String> args = <String>[
|
||||
'--sdk-root=${sdkRoot.toFilePath()}',
|
||||
'--strong',
|
||||
'--platform=${platformKernel.path}',
|
||||
'--output-dill=${dillFile.path}',
|
||||
'--depfile=${depFile.path}',
|
||||
file.path
|
||||
];
|
||||
int exitcode = await starter(args);
|
||||
expect(exitcode, equals(0));
|
||||
|
||||
expect(depFile.existsSync(), true);
|
||||
var depContents = depFile.readAsStringSync();
|
||||
var depContentsParsed = depContents.split(':');
|
||||
expect(depContentsParsed[0], dillFile.path);
|
||||
expect(depContentsParsed[1], isNotEmpty);
|
||||
});
|
||||
});
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue