[flutter_tools] revert change to SETLOCAL ENABLEDELAYEDEXPANSION (#86000)

This commit is contained in:
Jonah Williams 2021-07-07 11:10:37 -07:00 committed by GitHub
parent 8a022dc2f8
commit b1b0d20a95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 70 additions and 4 deletions

View file

@ -11,6 +11,8 @@ REM work across all platforms!
REM
REM --------------------------------------------------------------------------
SETLOCAL ENABLEDELAYEDEXPANSION
FOR %%i IN ("%~dp0..") DO SET FLUTTER_ROOT=%%~fi
REM Include shared scripts in shared.bat

View file

@ -11,6 +11,8 @@ REM work across all platforms!
REM
REM --------------------------------------------------------------------------
SETLOCAL ENABLEDELAYEDEXPANSION
FOR %%i IN ("%~dp0..") DO SET FLUTTER_ROOT=%%~fi
REM If available, add location of bundled mingit to PATH

View file

@ -0,0 +1,62 @@
// Copyright 2014 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.
// @dart = 2.8
import 'package:file/file.dart';
import 'package:flutter_tools/src/base/io.dart';
import '../src/common.dart';
import 'test_utils.dart';
void main() {
final String dartBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'dart');
Directory tempDir;
setUp(() {
tempDir = createResolvedTempDirectorySync('exit_code_test.');
});
tearDown(() {
tryToDelete(tempDir);
});
testWithoutContext('dart.sh/bat can return a zero exit code', () async {
tempDir.childFile('main.dart')
.writeAsStringSync('''
import 'dart:io';
void main() {
exit(0);
}
''');
final ProcessResult result = await processManager.run(<String>[
dartBin,
fileSystem.path.join(tempDir.path, 'main.dart'),
]);
print(result.stdout);
print(result.stderr);
expect(result.exitCode, 0);
});
testWithoutContext('dart.sh/bat can return a non-zero exit code', () async {
tempDir.childFile('main.dart')
.writeAsStringSync('''
import 'dart:io';
void main() {
exit(1);
}
''');
final ProcessResult result = await processManager.run(<String>[
dartBin,
fileSystem.path.join(tempDir.path, 'main.dart'),
]);
print(result.stdout);
print(result.stderr);
expect(result.exitCode, 1);
});
}

View file

@ -33,7 +33,7 @@ import 'package:pedantic/pedantic.dart';
import 'package:process/process.dart';
import '../src/common.dart';
import 'test_utils.dart' show fileSystem;
import 'test_utils.dart' show fileSystem, platform;
const ProcessManager processManager = LocalProcessManager();
final String flutterRoot = getFlutterRoot();
@ -315,7 +315,7 @@ void main() {
} finally {
tryToDelete(fileSystem.directory(tempDirectory));
}
});
}, skip: platform.isWindows);
testWithoutContext('flutter run handle SIGUSR1/2', () async {
final String tempDirectory = fileSystem.systemTempDirectory.createTempSync('flutter_overall_experience_test.').resolveSymbolicLinksSync();
@ -591,5 +591,5 @@ void main() {
'',
'Application finished.',
]);
});
}, skip: Platform.isWindows); // TODO(jonahwilliams): Re-enable when this test is reliable on device lab, https://github.com/flutter/flutter/issues/81556
}

View file

@ -17,5 +17,5 @@ void main() {
'"^(?!Golden).+"',
]);
expect(result.stdout, contains('args: ["(?!Golden).+"]'));
}, skip: !platform.isWindows);
}, skip: 'Reverted in https://github.com/flutter/flutter/pull/86000');
}