Commit Graph

22 Commits

Author SHA1 Message Date
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Butta
a3ea28ff19 [android] Remove ICU build flags since that requirement was dropped in #40340 2021-12-20 12:06:13 +05:30
swift-ci
c239d7a70e Merge pull request #12530 from amraboelela/update-android-md 2019-11-17 16:38:39 -08:00
Daniel Rodríguez Troitiño
f0eece342a [android] Allow skipping adb_clean.py
In normal cases, adb_clean.py cleaning the temporal directory is a good
idea because all the tests run in a clean state, and previous executions
do not influence the current one.

However, when iterating and running only one or two tests with
utils/run-test, removing all the artifacts and uploading them to the
device can turn each iteration into waiting a couple of minutes. Since
the changes in between tests should only touch a couple of libraries (or
none at all, if the test itself is the modification), avoiding a full
clean is beneficial.

The commit modifies `adb_clean.py` to allow providing the environment
variable `SKIP_ANDROID_CLEAN`, which will simply not execute the script.

Since the introduction of #24146, only the modified
artifacts will be uploaded, and the test iteration can be very fast
(including no time, if there are no changes).
2019-05-06 18:00:21 -07:00
Daniel Rodríguez Troitiño
e348f6c5ec [android] Make ADB push use sync if available.
In recent adb versions, the push command supports a new option --sync
which performs checksumming of the files to transmit against the files
already in the device. This increases the effective transmission speed
of the inital step in the test for Android.

It should not affect the speed of each tests, since they are pushed to
different folders, and also they are removed when they are successful.
However, the test executables are small compared to the size of the
libraries from the stadard library and dependencies.

This should exclusively affect Android and only to people testing the
executable tests (not CI).
2019-04-18 16:01:52 -07:00
Daniel Rodríguez Troitiño
d3e5af6f18 [android] Push test binaries w/o modifying executable name. (#19960)
At least test_rth.swift is checking the name of the executable
during the test, so renaming every executable to __executable in
Android will never work.

Also, during the rth tool execution, all the results from before
and after are pushed for every test. Since Android copies the
passed files without relative paths, the library files will
overwrite each other, making the test fail.

Depends on #19949 (more or less)
2018-11-02 11:03:08 -07:00
Daniel Rodríguez Troitiño
bf10e0bbeb [android] adb_test_runner.py pushes file arguments.
Some tests need more than just the executable to be pushed. For
example the resilience tests need the executable and the linked
library to be pushed. adb_test_runner.py only pushed the
executable.

The changes look into the arguments passed to the executable
and figure out which ones refer to files. Those files are pushed
to the device and transformed to refer to the path on the device
instead (the resilience test do not actually use the argument
values themselves, but maybe others do).
2018-10-24 13:00:43 -07:00
Daniel Rodríguez Troitiño
44108a8d7c [android] Pass test environment variables to Android device.
When running tests in an Android device, the environment variables
were not passed to the device, which make some test fail, like
stdlib/HashingRandomization that test with and without the
environment variable SWIFT_DETERMINISTIC_HASHING.

The changes implement a process similar to what the iOS simulator
already seem to do: a variable prefix which is pick up by the
adb_test_runner.py and send to the device for the test.
2018-10-18 14:06:48 -07:00
Daniel Rodríguez Troitiño
b84f4033e7 [android] adb_push_build_products.py support for aarch64.
A new parameter for the adb_push_build_product.py script to allow
pushing the right libc++_shared.so for the host architecture.
2018-10-04 16:15:02 -07:00
Amr Aboelela
62572e9402 Added Build Android Toolchain section to docs/Android.md 2017-10-22 22:13:56 -07:00
Amr Aboelela
1d75bc8c26 Added swiftpm and other libs to Android toolchain 2017-10-20 19:04:58 -07:00
Amr Aboelela
ecaf12b5a1 Copying also ICU libs to Android toolchain, as ICU libraries are needed to pushed to Android devices to allow swift based applications to run 2017-08-10 10:22:45 -07:00
Amr Aboelela
5184488e94 Fixed to use ${ANDROID_ICU_DIR} 2017-05-23 15:01:36 -07:00
Amr Aboelela
97e56b16d0 Added set -e 2017-05-23 09:56:45 -07:00
Amr Aboelela
98f883ddb4 SWIFT_TOOLCHAIN_DIR 2017-05-19 15:36:16 -07:00
Amr Aboelela
2465b36d28 cp -r ${SWIFT_LINUX_DIR}/{bin,lib,include} 2017-05-19 15:24:55 -07:00
Amr Aboelela
f183cbab72 modified build-toolchain 2017-05-19 15:00:56 -07:00
Amr Aboelela
cd3af3e1a5 Added android/build-toolchain 2017-05-19 12:24:10 -07:00
Hugh Bellamy
904ef577d2 Cleanup android import in build-script 2017-02-24 10:22:47 +07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Brian Gesiak
ee51b7a6f6 [Android] Add testing support
This adds support for running tests for the stdlib built
for Android, both on the host machine and on an Android device.

The Android variant of Swift may be built and tested using
the following `build-script` invocation:

```
$ utils/build-script \
  -R \                                           # Build in ReleaseAssert mode.
  -T \                                           # Run all tests.
  --android \                                    # Build for Android.
  --android-deploy-device-path /data/local/tmp \ # Temporary directory on the device where Android tests are run.
  --android-ndk ~/android-ndk-r10e \             # Path to an Android NDK.
  --android-ndk-version 21 \
  --android-icu-uc ~/libicu-android/armeabi-v7a/libicuuc.so \
  --android-icu-uc-include ~/libicu-android/armeabi-v7a/icu/source/common \
  --android-icu-i18n ~/libicu-android/armeabi-v7a/libicui18n.so \
  --android-icu-i18n-include ~/libicu-android/armeabi-v7a/icu/source/i18n/
```

See docs/Testing.rst for more details.
2016-06-09 13:03:28 -04:00