Skip to content

Commit b08e65f

Browse files
authored
Merge pull request #1294 from NativeScript/vmutafov/travis-build-setup-update
Run tests on multiple emulators
2 parents 5c1555f + 9f2bf00 commit b08e65f

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
env:
22
global:
3-
- NODE_VERSION=6.11.1
3+
- NODE_VERSION=10
44
- NDK_VERSION=r19
55
- DATE=$(date +%Y-%m-%d)
66
- PACKAGE_VERSION=next-$DATE-$TRAVIS_BUILD_NUMBER
77
- EMULATOR_API_LEVEL=21
88
- ANDROID_ABI=armeabi-v7a
99
- EMULATOR_NAME=runtime-emu
10+
- BUILD_TOOLS=28.0.3
11+
- ANDROID_API=28
1012

1113
matrix:
1214
include:
@@ -49,8 +51,8 @@ android:
4951
components:
5052
- platform-tools
5153
- tools
52-
- build-tools-26.0.1
53-
- android-26
54+
- build-tools-$BUILD_TOOLS
55+
- android-$ANDROID_API
5456
licenses:
5557
- 'android-sdk-preview-license-52d11cd2'
5658
- 'android-sdk-license-.+'

build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,22 @@ fi
4343
if [ "$2" != '' ]; then
4444
listOfEmulators=$2
4545
else
46-
listOfEmulators="Emulator-Api19-Default"
46+
listOfEmulators="Emulator-Api28-Google Emulator-Api23-Default Emulator-Api19-Default"
4747
fi
4848

4949
# Run static binding generator unit tests
5050
./gradlew runSbgTests
5151

5252
for emulator in $listOfEmulators; do
5353
echo "Start emulator $emulator"
54-
$ANDROID_HOME/emulator/emulator -avd ${emulator} -wipe-data -gpu on&
54+
$ANDROID_HOME/emulator/emulator -avd ${emulator} -verbose -wipe-data -gpu on&
55+
find ~/.android/avd/${emulator}.avd -type f -name 'config.ini' -exec cat {} +
5556

5657
echo "Run Android Runtime unit tests for $emulator"
5758
$ANDROID_HOME/platform-tools/adb devices
5859
$ANDROID_HOME/platform-tools/adb -e logcat -c
5960
$ANDROID_HOME/platform-tools/adb -e logcat > consoleLog.txt&
61+
$ANDROID_HOME/platform-tools/adb -e logcat > consoleLog$emulator.txt&
6062

6163
if [ "$1" != 'unit_tests_only' ]; then
6264
./gradlew runtests

test-app/app/src/main/assets/app/tests/testArrays.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ describe("Tests array operations", function () {
2626
var el = arr[0];
2727

2828
expect(el).toEqual(123);
29+
30+
global.__releaseNativeCounterpart(arr);
2931
}
3032
});
3133

test-app/app/src/main/assets/app/tests/tests.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,8 @@ describe("Tests ", function () {
640640
var el = arr[0];
641641

642642
expect(el).toEqual(123);
643+
644+
global.__releaseNativeCounterpart(arr);
643645
}
644646
});
645647

0 commit comments

Comments
 (0)