This commit is contained in:
LubuWest 2017-11-24 22:12:03 +01:00
commit 13394ac62e
12 changed files with 120 additions and 14 deletions

View file

@ -0,0 +1,45 @@
# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.dll
*.dylib
# Qt-es
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.moc
moc_*.cpp
qrc_*.cpp
ui_*.h
Makefile*
*-build-*
build-*
html
# QtCreator
*.autosave
.idea
tests/quickandroidactivitytests/tests/bin/*
tests/quickandroidactivitytests/tests/gen/*
#Android
local.properties
gradle.properties
.build
.gradle
*.iml
vendor
tests/instrument/build
build
*.swp

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,61 @@
language : android
addons:
apt:
packages:
- p7zip
- coreutils
- realpath
android:
components:
- build-tools-23.0.2
- android-19
- extra-google-google_play_services
env:
- DISPLAY=:99.0
compiler:
- gcc
before_install:
- wget -c https://services.gradle.org/distributions/gradle-2.9-bin.zip
- unzip -qq gradle-2.9-bin.zip
- export GRADLE_HOME=$PWD/gradle-2.9
- export PATH=$GRADLE_HOME/bin:$PATH
- gradle --version
- git clone https://github.com/benlau/qtci/
- source qtci/path.env
- ./ci/qt-android
script:
- export ROOT_DIR=`pwd`
- KEYSTORE=dev.keystore
- KEYPASS=123456
- BUILD_DIR=$ROOT_DIR/tests/instrument/build
- ANDROID_TARGET_SDK_VERSION=23
- mkdir -p $BUILD_DIR
- ls
- keytool -genkey -v -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 -dname "cn=localhost, ou=oss, o=Continuent, c=HK" -storepass $KEYPASS -keypass $KEYPASS -keystore $KEYSTORE
- source qt.env
- ls $ANDROID_SDK_ROOT/build-tools
- cd $BUILD_DIR
- build-android-gradle-project ${ROOT_DIR}/tests/instrument/activity/activity.pro
- sed -i "s/com.android.application/com.android.library/g" android-build/build.gradle
- cat android-build/gradle.properties
- cp ./android-build/build/outputs/apk/android-build-debug.apk output.apk
- echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a
- emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
- export ANDROID_HOME=$ANDROID_SDK_ROOT
- adb install -r output.apk
- cd $ROOT_DIR/tests/instrument/runner
- ls
- ./gradlew -q assembleDebug
- find . -name "*.apk"
- adb install -r ./build/outputs/apk/runner-debug.apk
- adb shell am instrument -w quickandroid.example.tests/android.test.InstrumentationTestRunner 2>&1 | tee instrument.log
- adb logcat -d > log.txt
- sed -i "/dalvikvm/d" log.txt
- tail -n 500 log.txt
- OK=`cat instrument.log | grep -G "^OK" | wc -l`
- echo $OK
- if [ $OK -eq 0 ]; then echo "Test failure found"; exit 1; fi