diff --git a/testing/run_tests.py b/testing/run_tests.py index 44683edc38794..5003b37222763 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py @@ -1037,10 +1037,11 @@ def run_impeller_golden_tests(build_dir: str): ).joinpath('golden_tests_harvester') with tempfile.TemporaryDirectory(prefix='impeller_golden') as temp_dir: run_cmd([tests_path, f'--working_dir={temp_dir}'], cwd=build_dir) + dart_bin = os.path.join(build_dir, 'dart-sdk', 'bin', 'dart') golden_path = os.path.join('testing', 'impeller_golden_tests_output.txt') script_path = os.path.join('tools', 'dir_contents_diff', 'bin', 'dir_contents_diff.dart') diff_result = subprocess.run( - f'dart run {script_path} {golden_path} {temp_dir}', + f'{dart_bin} run {script_path} {golden_path} {temp_dir}', check=False, shell=True, stdout=subprocess.PIPE, @@ -1052,9 +1053,8 @@ def run_impeller_golden_tests(build_dir: str): raise RuntimeError('impeller_golden_tests diff failure') with DirectoryChange(harvester_path): - run_cmd(['dart', 'pub', 'get']) bin_path = Path('.').joinpath('bin').joinpath('golden_tests_harvester.dart') - run_cmd(['dart', 'run', str(bin_path), temp_dir]) + run_cmd([dart_bin, 'run', str(bin_path), temp_dir]) def main(): diff --git a/tools/dir_contents_diff/test/dir_contents_diff_test.dart b/tools/dir_contents_diff/test/dir_contents_diff_test.dart index 4bfa559c5114b..d2ed1c51aef51 100644 --- a/tools/dir_contents_diff/test/dir_contents_diff_test.dart +++ b/tools/dir_contents_diff/test/dir_contents_diff_test.dart @@ -1,3 +1,7 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + import 'dart:io' as io; import 'package:litetest/litetest.dart'; @@ -19,11 +23,10 @@ void main() { return; } - // Runs `../bin/dir_contents_diff.dart` with the given arguments. (int, String) runSync(String goldenPath, String dirPath) { final io.ProcessResult result = io.Process.runSync( - 'dart', + io.Platform.resolvedExecutable, [binPath, goldenPath, dirPath], ); return (result.exitCode, result.stdout ?? result.stderr);