From 1a5db159f2d6fd9077a1a8e5dce01231247db54f Mon Sep 17 00:00:00 2001 From: asiva Date: Thu, 14 Mar 2024 21:23:37 +0000 Subject: [PATCH] [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 Reviewed-by: Ben Konyi --- pkg/dartdev/test/commands/compile_test.dart | 103 +------------------- 1 file changed, 2 insertions(+), 101 deletions(-) diff --git a/pkg/dartdev/test/commands/compile_test.dart b/pkg/dartdev/test/commands/compile_test.dart index d29bfe23760..1f6a4e28c5d 100644 --- a/pkg/dartdev/test/commands/compile_test.dart +++ b/pkg/dartdev/test/commands/compile_test.dart @@ -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(([] is List) ? '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(([] is List) ? '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(([] is List) ? '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 args) => print(args);''');