Files
sdk/pkg/dartdev/test/smoke/implicit_smoke_test.dart
T
Jaime Wren 70a3627d57 Update dartdev smoke tests for Dart version 2.12
I also took the time to
- add the smoke tests to the dartdev test_all.dart file
- change the order of the asserts to fail fast and with better messages if there are failures


Bug: https://github.com/dart-lang/sdk/issues/43842
Change-Id: Ic35e52145bf3f9d6871dcec07395966a02ca3d11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168761
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-10-21 20:06:54 +00:00

56 lines
1.5 KiB
Dart

// Copyright (c) 2020, 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.
import 'dart:io';
import 'package:test/test.dart';
const numRuns = 10;
final script = Platform.script.resolve('smoke.dart').toString();
void main() {
group(
'implicit dartdev smoke -',
() {
test('dart smoke.dart', () async {
for (int i = 1; i <= numRuns; ++i) {
if (i % 5 == 0) {
print('Done [$i/$numRuns]');
}
final result = await Process.run(
Platform.executable,
[
script,
],
);
expect(result.stderr, isEmpty);
expect(result.stdout, contains('Smoke test!'));
expect(result.exitCode, 0);
}
});
// This test forces dartdev to run implicitly and for
// DDS to spawn in a separate process.
test('dart --enable-vm-service smoke.dart', () async {
for (int i = 1; i <= numRuns; ++i) {
if (i % 5 == 0) {
print('Done [$i/$numRuns]');
}
final result = await Process.run(
Platform.executable,
[
'--enable-vm-service=0',
script,
],
);
expect(result.stderr, isEmpty);
expect(result.stdout, contains('Smoke test!'));
expect(result.exitCode, 0);
}
});
},
timeout: Timeout.none,
);
}