Skip to content

Commit 10abe4e

Browse files
a-sivacommit-bot@chromium.org
authored andcommitted
[VM / Tests] Add the --verbosity option to the test invocations
Add the verbosity option to the test invocations to suppress the info messages and make regular runs behave like the AOT/App JIT runs Fixes : #44744 TEST=Updating tests Change-Id: Ia0415f584a6d69785cde2e5d59849aaf8f9578a9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181302 Reviewed-by: Ben Konyi <[email protected]> Commit-Queue: Siva Annamalai <[email protected]>
1 parent 8ad5b51 commit 10abe4e

File tree

4 files changed

+12
-26
lines changed

4 files changed

+12
-26
lines changed

runtime/tests/vm/dart/sdk_hash_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ Future<void> main(List<String> args) async {
3131
final result = await Process.run(dart, [
3232
'--snapshot-kind=kernel',
3333
'--snapshot=$dillPath',
34+
'--verbosity=warning',
3435
sourcePath,
3536
]);
3637
Expect.equals('', result.stderr);
3738
Expect.equals(0, result.exitCode);
38-
Expect.equals('$unsoundNullSafetyMessage\n', result.stdout);
39+
Expect.equals('', result.stdout);
3940
}
4041

4142
{

runtime/tests/vm/dart/snapshot_test_helper.dart

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@ checkDeterministicSnapshot(String snapshotKind, String expectedStdout) async {
130130
final snapshot1Path = p.join(temp, 'snapshot1');
131131
final snapshot2Path = p.join(temp, 'snapshot2');
132132

133-
if (expectedStdout.isEmpty) {
134-
expectedStdout = nullSafetyMessage;
135-
} else {
136-
expectedStdout = '$nullSafetyMessage\n$expectedStdout';
137-
}
138-
139133
print("Version ${Platform.version}");
140134

141135
final generate1Result = await runDart('GENERATE SNAPSHOT 1', [
@@ -144,6 +138,7 @@ checkDeterministicSnapshot(String snapshotKind, String expectedStdout) async {
144138
'--trace_type_finalization',
145139
'--trace_compiler',
146140
'--verbose_gc',
141+
'--verbosity=warning',
147142
'--snapshot=$snapshot1Path',
148143
'--snapshot-kind=$snapshotKind',
149144
Platform.script.toFilePath(),
@@ -157,6 +152,7 @@ checkDeterministicSnapshot(String snapshotKind, String expectedStdout) async {
157152
'--trace_type_finalization',
158153
'--trace_compiler',
159154
'--verbose_gc',
155+
'--verbosity=warning',
160156
'--snapshot=$snapshot2Path',
161157
'--snapshot-kind=$snapshotKind',
162158
Platform.script.toFilePath(),
@@ -189,18 +185,12 @@ runAppJitTest(Uri testScriptUri,
189185
final trainingResult = await runDart('TRAINING RUN', [
190186
'--snapshot=$snapshotPath',
191187
'--snapshot-kind=app-jit',
188+
'--verbosity=warning',
192189
testPath,
193190
'--train'
194191
]);
195-
expectOutput("$nullSafetyMessage\nOK(Trained)", trainingResult);
192+
expectOutput("OK(Trained)", trainingResult);
196193
final runResult = await runSnapshot!(snapshotPath);
197194
expectOutput("OK(Run)", runResult);
198195
});
199196
}
200-
201-
final String nullSafetyMessage =
202-
hasSoundNullSafety ? soundNullSafetyMessage : unsoundNullSafetyMessage;
203-
204-
const String soundNullSafetyMessage = 'Info: Compiling with sound null safety';
205-
const String unsoundNullSafetyMessage =
206-
'Info: Compiling without sound null safety';

runtime/tests/vm/dart_2/sdk_hash_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ Future<void> main(List<String> args) async {
2929

3030
{
3131
final result = await Process.run(dart, [
32+
'--verbosity=warning',
3233
'--snapshot-kind=kernel',
3334
'--snapshot=$dillPath',
3435
sourcePath,
3536
]);
3637
Expect.equals('', result.stderr);
3738
Expect.equals(0, result.exitCode);
38-
Expect.equals('$unsoundNullSafetyMessage\n', result.stdout);
39+
Expect.equals('', result.stdout);
3940
}
4041

4142
{

runtime/tests/vm/dart_2/snapshot_test_helper.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@ checkDeterministicSnapshot(String snapshotKind, String expectedStdout) async {
130130
final snapshot1Path = p.join(temp, 'snapshot1');
131131
final snapshot2Path = p.join(temp, 'snapshot2');
132132

133-
if (expectedStdout.isEmpty) {
134-
expectedStdout = unsoundNullSafetyMessage;
135-
} else {
136-
expectedStdout = '$unsoundNullSafetyMessage\n$expectedStdout';
137-
}
138-
139133
print("Version ${Platform.version}");
140134

141135
final generate1Result = await runDart('GENERATE SNAPSHOT 1', [
@@ -144,6 +138,7 @@ checkDeterministicSnapshot(String snapshotKind, String expectedStdout) async {
144138
'--trace_type_finalization',
145139
'--trace_compiler',
146140
'--verbose_gc',
141+
'--verbosity=warning',
147142
'--snapshot=$snapshot1Path',
148143
'--snapshot-kind=$snapshotKind',
149144
Platform.script.toFilePath(),
@@ -157,6 +152,7 @@ checkDeterministicSnapshot(String snapshotKind, String expectedStdout) async {
157152
'--trace_type_finalization',
158153
'--trace_compiler',
159154
'--verbose_gc',
155+
'--verbosity=warning',
160156
'--snapshot=$snapshot2Path',
161157
'--snapshot-kind=$snapshotKind',
162158
Platform.script.toFilePath(),
@@ -189,14 +185,12 @@ runAppJitTest(Uri testScriptUri,
189185
final trainingResult = await runDart('TRAINING RUN', [
190186
'--snapshot=$snapshotPath',
191187
'--snapshot-kind=app-jit',
188+
'--verbosity=warning',
192189
testPath,
193190
'--train'
194191
]);
195-
expectOutput("$unsoundNullSafetyMessage\nOK(Trained)", trainingResult);
192+
expectOutput("OK(Trained)", trainingResult);
196193
final runResult = await runSnapshot(snapshotPath);
197194
expectOutput("OK(Run)", runResult);
198195
});
199196
}
200-
201-
const String unsoundNullSafetyMessage =
202-
'Info: Compiling without sound null safety';

0 commit comments

Comments
 (0)