runTests method
Implementation
Future<TestRunnerResult> runTests(List<String> testFiles) async {
if (testFiles.isEmpty) {
return TestRunnerResult(
exitCode: 0,
stdout: 'No affected tests detected.',
stderr: '',
ranTestFiles: const [],
);
}
final executable = isFlutterProject ? 'flutter' : 'dart';
final args = ['test', ...testFiles];
final processResult = await Process.run(
executable,
args,
workingDirectory: projectRoot,
runInShell: Platform.isWindows,
);
return TestRunnerResult(
exitCode: processResult.exitCode,
stdout: processResult.stdout as String,
stderr: processResult.stderr as String,
ranTestFiles: testFiles,
);
}