This reverts commit cb378edc9e.
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
include: ../analysis_options.yaml
|
||||
|
||||
linter:
|
||||
rules:
|
||||
avoid_print: false # We use prints as debugging tools here all the time.
|
||||
@@ -1,7 +0,0 @@
|
||||
[0-9]+:[0-9]+ [+]0: Local passes non-existent baseline for new test, null expectation *
|
||||
*No expectations provided by Skia Gold for test: library.flutter.new_golden_test.1. This may be a new test. If this is an unexpected result, check https://flutter-gold.skia.org.
|
||||
*Validate image output found at flutter/test/library/
|
||||
[0-9]+:[0-9]+ [+]0 ~1: Local passes non-existent baseline for new test, empty expectation *
|
||||
*No expectations provided by Skia Gold for test: library.flutter.new_golden_test.2. This may be a new test. If this is an unexpected result, check https://flutter-gold.skia.org.
|
||||
*Validate image output found at flutter/test/library/
|
||||
[0-9]+:[0-9]+ [+]0 ~2: All tests skipped. *
|
||||
@@ -1,77 +0,0 @@
|
||||
// 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.
|
||||
|
||||
// See also packages/flutter_goldens/test/flutter_goldens_test.dart
|
||||
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:file/file.dart';
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:flutter_goldens/flutter_goldens.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:platform/platform.dart';
|
||||
|
||||
// 1x1 colored pixel
|
||||
const List<int> _kFailPngBytes = <int>[137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0,
|
||||
13, 73, 72, 68, 82, 0, 0, 0, 1, 0, 0, 0, 1, 8, 6, 0, 0, 0, 31, 21, 196, 137,
|
||||
0, 0, 0, 13, 73, 68, 65, 84, 120, 1, 99, 249, 207, 240, 255, 63, 0, 7, 18, 3,
|
||||
2, 164, 147, 160, 197, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130];
|
||||
|
||||
void main() {
|
||||
final MemoryFileSystem fs = MemoryFileSystem();
|
||||
final Directory basedir = fs.directory('flutter/test/library/')
|
||||
..createSync(recursive: true);
|
||||
final FakeSkiaGoldClient fakeSkiaClient = FakeSkiaGoldClient()
|
||||
..expectationForTestValues['flutter.new_golden_test.1'] = '';
|
||||
final FlutterLocalFileComparator comparator = FlutterLocalFileComparator(
|
||||
basedir.uri,
|
||||
fakeSkiaClient,
|
||||
fs: fs,
|
||||
platform: FakePlatform(
|
||||
environment: <String, String>{'FLUTTER_ROOT': '/flutter'},
|
||||
operatingSystem: 'macos'
|
||||
),
|
||||
);
|
||||
|
||||
test('Local passes non-existent baseline for new test, null expectation', () async {
|
||||
expect(
|
||||
await comparator.compare(
|
||||
Uint8List.fromList(_kFailPngBytes),
|
||||
Uri.parse('flutter.new_golden_test.1'),
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
|
||||
test('Local passes non-existent baseline for new test, empty expectation', () async {
|
||||
expect(
|
||||
await comparator.compare(
|
||||
Uint8List.fromList(_kFailPngBytes),
|
||||
Uri.parse('flutter.new_golden_test.2'),
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// See also packages/flutter_goldens/test/flutter_goldens_test.dart
|
||||
class FakeSkiaGoldClient extends Fake implements SkiaGoldClient {
|
||||
Map<String, String> expectationForTestValues = <String, String>{};
|
||||
Object? getExpectationForTestThrowable;
|
||||
@override
|
||||
Future<String> getExpectationForTest(String testName) async {
|
||||
if (getExpectationForTestThrowable != null) {
|
||||
throw getExpectationForTestThrowable!;
|
||||
}
|
||||
return expectationForTestValues[testName] ?? '';
|
||||
}
|
||||
|
||||
Map<String, List<int>> imageBytesValues = <String, List<int>>{};
|
||||
@override
|
||||
Future<List<int>> getImageBytes(String imageHash) async => imageBytesValues[imageHash]!;
|
||||
|
||||
Map<String, String> cleanTestNameValues = <String, String>{};
|
||||
@override
|
||||
String cleanTestName(String fileName) => cleanTestNameValues[fileName] ?? '';
|
||||
}
|
||||
@@ -8,5 +8,5 @@ import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
||||
void main() {
|
||||
test('working directory is the root of this package', () {
|
||||
expect(Directory.current.path, endsWith('automated_tests'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_goldens:
|
||||
sdk: flutter
|
||||
integration_test:
|
||||
sdk: flutter
|
||||
test: 1.17.12
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
include: ../../analysis_options.yaml
|
||||
# Use the analysis options settings from the top level of the repo (not
|
||||
# the ones from above, which include the `public_member_api_docs` rule).
|
||||
|
||||
include: ../../../analysis_options.yaml
|
||||
|
||||
analyzer:
|
||||
exclude:
|
||||
# Ignore protoc generated files
|
||||
# Ignore protoc generated files
|
||||
- "lib/src/proto/*"
|
||||
|
||||
linter:
|
||||
rules:
|
||||
avoid_catches_without_on_clauses: true
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
include: ../../analysis_options.yaml
|
||||
# Use the analysis options settings from the top level of the repo (not
|
||||
# the ones from above, which include the `public_member_api_docs` rule).
|
||||
|
||||
include: ../../../analysis_options.yaml
|
||||
|
||||
linter:
|
||||
rules:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include: ../analysis_options.yaml
|
||||
include: ../../analysis_options.yaml
|
||||
|
||||
linter:
|
||||
rules:
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
include: ../../analysis_options.yaml
|
||||
# Take our settings from the repo's main analysis_options.yaml file, but add
|
||||
# an exclude for the build directory.
|
||||
|
||||
include: ../../../analysis_options.yaml
|
||||
|
||||
analyzer:
|
||||
exclude:
|
||||
|
||||
Reference in New Issue
Block a user