Commit graph

14 commits

Author SHA1 Message Date
Alexandre Ardhuin d927c93310
Unnecessary new (#20138)
* enable lint unnecessary_new

* fix tests

* fix tests

* fix tests
2018-09-12 08:29:29 +02:00
Ian Hickson 3dec6a6930
Clean up usage of temporary directories (#20682)
All temporary directory start with `flutter_` and have their random component separated from the name by a period, as in `flutter_test_bundle.YFYQMY`.

I've tried to find some of the places where we didn't cleanly delete temporary directories, too. This greatly reduces, though it does not entirely eliminate, the directories we leave behind when running tests, especially `flutter_tools` tests.

While I was at it I standardized on `tempDir` as the variable name for temporary directories, since it was the most common, removing occurrences of `temp` and `tmp`, among others.

Also I factored out some common code that used to catch exceptions that happen on Windows, and made more places use that pattern.
2018-08-17 13:17:23 -07:00
Ian Hickson 686d8f8a22 Shim package:test to avoid matcher issues (#20602)
* Upgrade everything except matcher.
* Roll matcher (and test)
* Adjust tests that depend on flutter:test directly to depend on a shim
* Require use of package:test shim and remove other references to package:test
2018-08-14 20:33:58 -07:00
Sam Rawlins 9f8a70be4c Bump mockito to 3.0.0-beta (#18462)
* Bump mockito to 3.0.0-beta

* Few fixes

* fix test

* Bump image

* Fix

* New packages update

* With matcher pinned

* No more typed
2018-06-21 16:23:47 -07:00
Keerti Parthasarathy da7670c2ee
Fixes for test failures in Dart 2 mode (#18122) 2018-06-05 12:38:30 -07:00
Ian Hickson e3427550e9
Be less verbose in the logs. (#17401)
Now that we have thousands of tests, it doesn't make sense to display a separate line for each test. The result is just megabytes of logs that you have to scrub through to find error messages.
2018-06-04 15:22:19 -07:00
Vyacheslav Egorov 4931b46772
Make --build-shared-library more robust. (#17420)
* Search for a suitable ARM sysroot instead of hardcoding it;
* Add facility to explain why NDK was not found;
2018-05-14 16:36:54 +02:00
jcollins-g 050ee9d180
Improve robustness of --version parsing for sdkmanager (#15029) 2018-03-01 14:25:03 -08:00
jcollins-g 614df6949c
Android license detector in doctor, take two (#14783)
* Revert "Revert "Add android license verification to doctor and some refactoring" (#14727)"

This reverts commit d260294752.

* Add tests, fix sdkManagerEnv and use it consistently, and rearrange Status object model

* AnsiSpinner needs to leave the cursor where it found it.

* fix tests

* Const constructor warning only shows up on windows...?

* Avoid crash if we can't find the home directory

* Make pathVarSeparator return a string in the mock

* Implement review comments

* Fix out-of-order problem on stop
2018-02-28 12:09:52 -08:00
Chris Bracken 74478d186c
Extract MockAndroidSdk and static utility method (#14258)
AndroidSdk and AndroidStudio depends relatively heavily on filesystem
access to locate installed tools. Testing code that relies on either of
these classes benefits from a utility method to generate a
legitimate-looking Android SDK directory layout for testing.
2018-01-24 20:40:25 -08:00
Chris Bracken 9654659c72
Add AndroidSdk.sdkManagerPath, sdkManagerVersion (#14247)
Convenience getters for the the path to the Android SDK manager and the
currently installed version of the tool.

Pre-factoring to support better checks around the --android-licenses
command, which uses a feature of the SDK manager that is unsupported in
older versions of the tool.
2018-01-24 12:38:08 -08:00
Martin Kustermann 545ec9efb7
Add support for NDK discovery and add --prefer-shared-library option (#12788)
* Add support for NDK discovery and add --prefer-shared-library option

We would like to be able to use native tools (e.g. simpleperf, gdb) with
precompiled flutter apps.  The native tools work much better with *.so
files instead of the custom formats the Dart VM uses by default.

The reason for using blobs / instruction snapshots is that we do not
want to force flutter users to install the Android NDK.

This CL adds a `--prefer-shared-library` flag to e.g. `flutter build
apk` which will use the NDK compiler (if available) to turn the
precompiled app assembly file to an `*.so` file.  If the NDK compiler is
not available it will default to the default behavior.

* Rebase, add test for NDK detection, augment flutter.gradle with @Input for flag

* Use InMemoryFileSystem for test

* Remove unused import

* Address some analyzer warnings
2017-11-21 15:44:03 +01:00
Todd Volkert f0e8819886
Extract Android SDK version from named platform dirs. (#13056)
Previously, we were mapping certain named platforms
(e.g. `android-stable`) to their corresponding version.
this had two problems:

1. The version could become out of date. For instance, we had
   mapped `android-stable` to version 24, but the stable version
   is now 27.
2. The list of possible named versions wasn't comprehensive.
   Some Android SDKs just list the platform as `stable`, or
   `experimental`, etc.

This change updates the platform version detection to use
the `build.prop` file that exists in the platform directory
(only for cases where the version number is not encoded into
the directory name).
2017-11-16 17:38:53 -08:00
Ian Hickson 7c9c5a296c Rearrange tests to more closely match code structure (#10043) 2017-05-12 10:44:52 -07:00
Renamed from packages/flutter_tools/test/android_sdk_test.dart (Browse further)