Skip to content

Commit cbf08f7

Browse files
committed
remove legacy build output tests
1 parent 0137e7f commit cbf08f7

1 file changed

Lines changed: 5 additions & 94 deletions

File tree

script/tool/test/native_test_command_test.dart

Lines changed: 5 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const String _archDirArm64 = 'arm64';
6868
void _createFakeCMakeCache(
6969
RepositoryPackage plugin,
7070
Platform platform,
71-
String? archDir,
71+
String archDir,
7272
) {
7373
final project = CMakeProject(
7474
getExampleDir(plugin),
@@ -2231,13 +2231,11 @@ public class FlutterActivityTest {
22312231

22322232
// Returns the ProcessCall to expect for build the Windows unit tests for
22332233
// the given plugin.
2234-
ProcessCall getWindowsBuildCall(RepositoryPackage plugin, String? arch) {
2235-
Directory projectDir = getExampleDir(
2234+
ProcessCall getWindowsBuildCall(RepositoryPackage plugin, String arch) {
2235+
final Directory projectDir = getExampleDir(
22362236
plugin,
2237-
).childDirectory('build').childDirectory('windows');
2238-
if (arch != null) {
2239-
projectDir = projectDir.childDirectory(arch);
2240-
}
2237+
).childDirectory('build').childDirectory('windows').childDirectory(arch);
2238+
22412239
return ProcessCall(_fakeCmakeCommand, <String>[
22422240
'--build',
22432241
projectDir.path,
@@ -2311,47 +2309,6 @@ public class FlutterActivityTest {
23112309
);
23122310
});
23132311

2314-
test('runs unit tests with legacy build output', () async {
2315-
const testBinaryRelativePath =
2316-
'build/windows/Debug/bar/plugin_test.exe';
2317-
final RepositoryPackage plugin = createFakePlugin(
2318-
'plugin',
2319-
packagesDir,
2320-
extraFiles: <String>['example/$testBinaryRelativePath'],
2321-
platformSupport: <String, PlatformDetails>{
2322-
platformWindows: const PlatformDetails(PlatformSupport.inline),
2323-
},
2324-
);
2325-
_createFakeCMakeCache(plugin, mockPlatform, null);
2326-
2327-
final File testBinary = childFileWithSubcomponents(
2328-
plugin.directory,
2329-
<String>['example', ...testBinaryRelativePath.split('/')],
2330-
);
2331-
2332-
final List<String> output = await runCapturingPrint(runner, <String>[
2333-
'native-test',
2334-
'--windows',
2335-
'--no-integration',
2336-
]);
2337-
2338-
expect(
2339-
output,
2340-
containsAllInOrder(<Matcher>[
2341-
contains('Running plugin_test.exe...'),
2342-
contains('No issues found!'),
2343-
]),
2344-
);
2345-
2346-
expect(
2347-
processRunner.recordedCalls,
2348-
orderedEquals(<ProcessCall>[
2349-
getWindowsBuildCall(plugin, null),
2350-
ProcessCall(testBinary.path, const <String>[], null),
2351-
]),
2352-
);
2353-
});
2354-
23552312
test('only runs debug unit tests', () async {
23562313
const debugTestBinaryRelativePath =
23572314
'build/windows/x64/Debug/bar/plugin_test.exe';
@@ -2398,52 +2355,6 @@ public class FlutterActivityTest {
23982355
);
23992356
});
24002357

2401-
test('only runs debug unit tests with legacy build output', () async {
2402-
const debugTestBinaryRelativePath =
2403-
'build/windows/Debug/bar/plugin_test.exe';
2404-
const releaseTestBinaryRelativePath =
2405-
'build/windows/Release/bar/plugin_test.exe';
2406-
final RepositoryPackage plugin = createFakePlugin(
2407-
'plugin',
2408-
packagesDir,
2409-
extraFiles: <String>[
2410-
'example/$debugTestBinaryRelativePath',
2411-
'example/$releaseTestBinaryRelativePath',
2412-
],
2413-
platformSupport: <String, PlatformDetails>{
2414-
platformWindows: const PlatformDetails(PlatformSupport.inline),
2415-
},
2416-
);
2417-
_createFakeCMakeCache(plugin, mockPlatform, null);
2418-
2419-
final File debugTestBinary = childFileWithSubcomponents(
2420-
plugin.directory,
2421-
<String>['example', ...debugTestBinaryRelativePath.split('/')],
2422-
);
2423-
2424-
final List<String> output = await runCapturingPrint(runner, <String>[
2425-
'native-test',
2426-
'--windows',
2427-
'--no-integration',
2428-
]);
2429-
2430-
expect(
2431-
output,
2432-
containsAllInOrder(<Matcher>[
2433-
contains('Running plugin_test.exe...'),
2434-
contains('No issues found!'),
2435-
]),
2436-
);
2437-
2438-
expect(
2439-
processRunner.recordedCalls,
2440-
orderedEquals(<ProcessCall>[
2441-
getWindowsBuildCall(plugin, null),
2442-
ProcessCall(debugTestBinary.path, const <String>[], null),
2443-
]),
2444-
);
2445-
});
2446-
24472358
test('fails if CMake has not been configured', () async {
24482359
createFakePlugin(
24492360
'plugin',

0 commit comments

Comments
 (0)