-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from spyhunter99/master
#36 basic android connectedCheck tests
- Loading branch information
Showing
9 changed files
with
182 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
language: android | ||
jdk: oraclejdk7 | ||
android: | ||
components: | ||
# The BuildTools version used by your project | ||
- tools | ||
- platform-tools | ||
- build-tools-23.0.2 # 23.0.2 was not available on build | ||
- build-tools-23.0.1 | ||
- build-tools-23.0.3 | ||
- build-tools-19.1.0 | ||
# The SDK version used to compile your project | ||
- android-23 | ||
- android-22 | ||
- android-21 | ||
- android-19 | ||
- android-18 | ||
- android-15 | ||
- android-10 | ||
- android-8 | ||
- addon-google_apis-google-10 | ||
- addon-google_apis-google-15 | ||
- addon-google_apis-google-18 | ||
- addon-google_apis-google-19 | ||
- addon-google_apis-google-21 | ||
- addon-google_apis-google-22 | ||
- addon-google_apis-google-23 | ||
- addon-google_apis-google-8 | ||
|
||
# Additional components | ||
- extra-google-google_play_services | ||
- extra-google-m2repository | ||
- extra-android-m2repository | ||
- addon-google_apis-google-19 | ||
- sys-img-armeabi-android-8 | ||
- sys-img-armeabi-android-10 | ||
- sys-img-armeabi-android-15 | ||
- sys-img-armeabi-android-19 | ||
- sys-img-armeabi-android-21 | ||
- sys-img-x86-android-22 | ||
- sys-img-x86-android-23 | ||
- addon-google_apis-google-23 | ||
|
||
sudo: required | ||
|
||
# fun fact, travis doesn't really support multiple AVDs running currently for a single build (tried it, build timed out constantly while starting up the AVDs) | ||
# thus we're using a build matrix (which makes more sense anyhow) | ||
env: | ||
global: | ||
#minutes (2 minutes by default), prevents CommandShellUnresponsiveExceptions | ||
- ADB_INSTALL_TIMEOUT=14 | ||
|
||
matrix: | ||
#note when changing these, updating the gradle build file for the GoogleWrapper project | ||
# first env var is just for display purposes | ||
#api15 with google | ||
- API=15g ANDROID_TARGET=14 ANDROID_ABI=armeabi-v7a | ||
|
||
before_install: | ||
# create and start emulators | ||
- android list targets | ||
- echo no | android create avd --force -n test$ANDROID_TARGET -t $ANDROID_TARGET --abi $ANDROID_ABI --sdcard 200M | ||
- emulator -memory 1536 -avd test$ANDROID_TARGET -no-skin -no-audio -no-window & | ||
- android-wait-for-emulator | ||
- adb shell input keyevent 82 & | ||
|
||
# mvn sdk deploy | ||
before_script: | ||
|
||
- android-wait-for-emulator | ||
- adb shell input keyevent 82 & | ||
|
||
#build | ||
script: | ||
- ./gradlew -version | ||
- ./gradlew connectedCheck | ||
# FIXME one day add in -Pprofile=ci to the above line | ||
# removed for now because travis will abort the build because the logout is too high | ||
|
||
after_failure: | ||
# run this on failure | ||
# dumps the log then exits | ||
- adb logcat -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
RendererTester/src/androidTest/java/armyc2/c2sd/renderer/test1/MainActivityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package armyc2.c2sd.renderer.test1; | ||
|
||
import android.test.ActivityInstrumentationTestCase2; | ||
|
||
|
||
public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActivity> { | ||
|
||
public MainActivityTest() { | ||
super(MainActivity.class); | ||
} | ||
|
||
public void testActivity() { | ||
MainActivity activity = getActivity(); | ||
assertNotNull(activity); | ||
} | ||
|
||
public void testDraw(){ | ||
final MainActivity activity = getActivity(); | ||
activity.runOnUiThread(new Runnable() { | ||
@Override | ||
public void run() { | ||
activity.findViewById(R.id.btnDraw).performClick(); | ||
} | ||
}); | ||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
TestAndroidRenderer3/src/androidTest/java/armyc2/c2sd/renderer/test3/MainActivityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package armyc2.c2sd.renderer.test3; | ||
|
||
import android.test.ActivityInstrumentationTestCase2; | ||
|
||
import armyc2.c2sd.renderer.test3.MainActivity; | ||
import armyc2.c2sd.renderer.test3.R; | ||
|
||
|
||
public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActivity> { | ||
|
||
public MainActivityTest() { | ||
super(MainActivity.class); | ||
} | ||
|
||
public void testActivity() { | ||
MainActivity activity = getActivity(); | ||
assertNotNull(activity); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
mapfragment-demo/src/androidTest/java/armyc2/c2sd/renderer/test2/MainActivityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package armyc2.c2sd.renderer.test2; | ||
|
||
import android.test.ActivityInstrumentationTestCase2; | ||
|
||
|
||
public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActivity> { | ||
|
||
public MainActivityTest() { | ||
super(MainActivity.class); | ||
} | ||
|
||
public void testActivity() { | ||
MainActivity activity = getActivity(); | ||
assertNotNull(activity); | ||
} | ||
|
||
} | ||
|
20 changes: 10 additions & 10 deletions
20
mapfragment-demo/src/main/java/armyc2/c2sd/renderer/test2/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters