[VM/dartdev] Remove all unsound null safety tests running on the VM

1. Remove all unsound null safety tests on the VM
2. Do not pass the --sound-null-safety flag on VM runs as it is the
   default and this option is going to be removed soon.

Change-Id: I33d646cea4b6da8d144f3abe9fbc1b60a20e635b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357741
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This commit is contained in:
asiva
2024-03-14 21:23:37 +00:00
committed by Commit Queue
parent c2a6645c01
commit 1a5db159f2
+2 -101
View File
@@ -680,31 +680,7 @@ void main() {
reason: 'File not found: $outFile');
}, skip: isRunningOnIA32);
test('Compile exe with unsound null safety', () async {
final p = project(mainSrc: '''
void main() {}
''');
final inFile = path.canonicalize(path.join(p.dirPath, p.relativeFilePath));
final outFile = path.canonicalize(path.join(p.dirPath, 'myexe'));
final result = await p.run(
[
'compile',
'exe',
'--no-sound-null-safety',
'-o',
outFile,
inFile,
],
);
expect(result.stdout, contains(unsoundNullSafetyError));
expect(result.stderr, isEmpty);
expect(result.exitCode, 64);
expect(File(outFile).existsSync(), false, reason: 'File found: $outFile');
}, skip: isRunningOnIA32);
test('Compile and run exe with --sound-null-safety', () async {
test('Compile and run exe (default sound null safety)', () async {
final p = project(mainSrc: '''void main() {
print((<int?>[] is List<int>) ? 'oh no' : 'sound');
}''');
@@ -715,7 +691,6 @@ void main() {}
[
'compile',
'exe',
'--sound-null-safety',
'-o',
outFile,
inFile,
@@ -1062,32 +1037,6 @@ void main() {
reason: 'File not found: $outFile');
}, skip: isRunningOnIA32);
test('Compile AOT snapshot with unsound null safety', () async {
final p = project(mainSrc: '''
void main() {}
''');
final inFile = path.canonicalize(path.join(p.dirPath, p.relativeFilePath));
final outFile = path.canonicalize(path.join(p.dirPath, 'myaot'));
final result = await p.run(
[
'compile',
'aot-snapshot',
'--no-sound-null-safety',
'-o',
outFile,
inFile,
],
);
expect(result.stdout, contains(unsoundNullSafetyMessage));
expect(result.stdout, contains(unsoundNullSafetyWarning));
expect(result.stderr, isEmpty);
expect(result.exitCode, 0);
expect(File(outFile).existsSync(), true,
reason: 'File not found: $outFile');
}, skip: isRunningOnIA32);
test('Compile AOT snapshot without info', () async {
final p = project(mainSrc: '''void main() {}''');
final inFile = path.canonicalize(path.join(p.dirPath, p.relativeFilePath));
@@ -1455,30 +1404,7 @@ void main() {
reason: 'File not found: $outFile');
});
test('Compile JIT snapshot with unsound null safety', () async {
final p = project(mainSrc: '''
void main() {}
''');
final inFile = path.canonicalize(path.join(p.dirPath, p.relativeFilePath));
final outFile = path.canonicalize(path.join(p.dirPath, 'myjit'));
final result = await p.run(
[
'compile',
'jit-snapshot',
'--no-sound-null-safety',
'-o',
outFile,
inFile,
],
);
expect(result.stdout, contains(unsoundNullSafetyError));
expect(result.exitCode, 64);
expect(File(outFile).existsSync(), false, reason: 'File found: $outFile');
});
test('Compile JIT snapshot with --sound-null-safety', () async {
test('Compile JIT snapshot with (default sound null safety)', () async {
final p = project(mainSrc: '''void main() {
print((<int?>[] is List<int>) ? 'oh no' : 'sound');
}''');
@@ -1489,7 +1415,6 @@ void main() {}
[
'compile',
'jit-snapshot',
'--sound-null-safety',
'-o',
outFile,
inFile,
@@ -1502,30 +1427,6 @@ void main() {}
reason: 'File not found: $outFile');
});
test('Compile JIT snapshot with --no-sound-null-safety', () async {
final p = project(mainSrc: '''void main() {
print((<int?>[] is List<int>) ? 'unsound' : 'oh no');
}''');
final inFile = path.canonicalize(path.join(p.dirPath, p.relativeFilePath));
final outFile = path.canonicalize(path.join(p.dirPath, 'mydill'));
final result = await p.run(
[
'compile',
'jit-snapshot',
'--no-sound-null-safety',
'-o',
outFile,
inFile,
],
);
expect(result.stderr, isNot(contains(soundNullSafetyMessage)));
expect(result.stdout, contains(unsoundNullSafetyError));
expect(result.exitCode, 64);
expect(File(outFile).existsSync(), false, reason: 'File found: $outFile');
});
test('Compile JIT snapshot with training args', () async {
final p =
project(mainSrc: '''void main(List<String> args) => print(args);''');