diff --git a/.travis.yml b/.travis.yml index 411360044f..56a738fc00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ cache: - $HOME/kcov-i686-unknown-linux-gnu - $HOME/kcov-x86_64-unknown-linux-gnu - $HOME/android/android-sdk-linux - - $HOME/android/android-18-arm-linux-androideabi-4.8 + - $HOME/android/armv7a-linux-androideabi26 matrix: fast_finish: true allow_failures: diff --git a/README.md b/README.md index 21ed525b41..e9e814f90d 100644 --- a/README.md +++ b/README.md @@ -215,8 +215,8 @@ the table below. The C compilers listed are used for compiling the C portions. Android 32‑bit ARM - Built using the Android SDK 24.4.1 and Android NDK 14, tested using the - Android emulator. + Built using the Android SDK 24.4.1 and Android NDK 17 targeting API level 26, + tested using the Android emulator on API levle 24 system images.. Mac OS X x64 diff --git a/mk/travis-install-android.sh b/mk/travis-install-android.sh index 86f4322626..6d75565a34 100755 --- a/mk/travis-install-android.sh +++ b/mk/travis-install-android.sh @@ -28,8 +28,8 @@ ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-17} ANDROID_NDK_URL=https://dl.google.com/android/repository/android-ndk-r${ANDROID_NDK_VERSION}-linux-x86_64.zip ANDROID_INSTALL_PREFIX="${HOME}/android" -ANDROID_SDK_INSTALL_DIR="${HOME}/android/android-sdk-linux" -ANDROID_NDK_INSTALL_DIR="${ANDROID_INSTALL_PREFIX}/android-18-arm-linux-androideabi-4.8" +ANDROID_SDK_INSTALL_DIR="${ANDROID_INSTALL_PREFIX}/android-sdk-linux" +ANDROID_NDK_INSTALL_DIR="${ANDROID_INSTALL_PREFIX}/armv7a-linux-androideabi26" if [[ ! -f $ANDROID_SDK_INSTALL_DIR/tools/emulator ]];then mkdir -p "${ANDROID_INSTALL_PREFIX}" @@ -39,7 +39,7 @@ if [[ ! -f $ANDROID_SDK_INSTALL_DIR/tools/emulator ]];then expect -c ' set timeout 600; -spawn ./android-sdk-linux/tools/android update sdk -a --no-ui --filter tools,platform-tools,android-18,sys-img-armeabi-v7a-android-18; +spawn ./android-sdk-linux/tools/android update sdk -a --no-ui --filter tools,platform-tools,android-24,sys-img-armeabi-v7a-android-24; expect { "Do you accept the license" { exp_send "y\r" ; exp_continue } eof @@ -58,10 +58,11 @@ if [[ ! -d $ANDROID_NDK_INSTALL_DIR/sysroot/usr/include/arm-linux-androideabi ]] ./android-ndk-r${ANDROID_NDK_VERSION}/build/tools/make_standalone_toolchain.py \ --force \ --arch arm \ - --api 18 \ + --api 26 \ --install-dir ${ANDROID_NDK_INSTALL_DIR} popd + rm -rf "${ANDROID_INSTALL_PREFIX}/downloads" fi echo end of mk/travis-install-android diff --git a/mk/travis.sh b/mk/travis.sh index 173efbf0b5..55b59cee72 100755 --- a/mk/travis.sh +++ b/mk/travis.sh @@ -30,7 +30,7 @@ armv7-linux-androideabi) # install the android sdk/ndk mk/travis-install-android.sh - export PATH=$HOME/android/android-18-arm-linux-androideabi-4.8/bin:$PATH + export PATH=$HOME/android/armv7a-linux-androideabi26/bin:$PATH export PATH=$HOME/android/android-sdk-linux/platform-tools:$PATH export PATH=$HOME/android/android-sdk-linux/tools:$PATH ;; @@ -94,9 +94,46 @@ fi case $TARGET_X in armv7-linux-androideabi) cargo test -vv -j2 --no-run ${mode-} ${FEATURES_X-} --target=$TARGET_X - # TODO: There used to be some logic for running the tests here using the - # Android emulator. That was removed because something broke this. See - # https://github.com/briansmith/ring/issues/603. + + # Building the AVD is slow. Do it here, after we build the code so that any + # build breakage is reported sooner, instead of being delayed by this. + echo no | android create avd --name arm-24 --target android-24 --abi armeabi-v7a + android list avd + + emulator @arm-24 -memory 2048 -no-skin -no-boot-anim -no-window & + adb wait-for-device + adb root + adb wait-for-device + + # Run the unit tests first. The file named ring- in $target_dir is + # the test executable. + + find $target_dir -maxdepth 1 -name ring-* ! -name "*.*" \ + -exec adb push {} /data/ring-test \; + for testfile in `find src crypto -name "*_test*.txt" -o -name "*test*.pk8"`; do + adb shell "mkdir -p /data/`dirname $testfile`" + adb push $testfile /data/$testfile + done + adb shell "mkdir -p /data/third_party/NIST" + adb push third_party/NIST/SHAVS /data/third_party/NIST/SHAVS + adb shell "cd /data && ./ring-test" 2>&1 | tee /tmp/ring-test-log + grep "test result: ok" /tmp/ring-test-log + + # Run the integration/functional tests. + for testfile in `find tests -name "*_test*.txt" -o -name "*test*.pk8"`; do + adb shell "mkdir -p /data/`dirname $testfile`" + adb push $testfile /data/$testfile + done + + for test_exe in `find $target_dir -maxdepth 1 -name "*test*" -type f ! -name "*.*" `; do + adb push $test_exe /data/`basename $test_exe` + adb shell "cd /data && ./`basename $test_exe`" 2>&1 | \ + tee /tmp/`basename $test_exe`-log + grep "test result: ok" /tmp/`basename $test_exe`-log + done + + adb emu kill + ;; *) cargo test -vv -j2 ${mode-} ${FEATURES_X-} --target=$TARGET_X