File tree Expand file tree Collapse file tree 5 files changed +114
-0
lines changed Expand file tree Collapse file tree 5 files changed +114
-0
lines changed Original file line number Diff line number Diff line change 4
4
src /nativescript-angular /** /* .js
5
5
.baseDir.ts
6
6
.tscache
7
+ .nvm
7
8
8
9
tests /app /** /* .js
10
+ tests /test-output.txt
9
11
tests /app /nativescript-angular
10
12
tests /app /global.d.ts
11
13
tests /platforms
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -e
3
+
4
+ SCRIPT=$( readlink -f " $0 " )
5
+ BUILD_DIR=$( dirname $SCRIPT )
6
+ PROJECT_DIR=$( dirname $BUILD_DIR )
7
+
8
+ $PROJECT_DIR /build/start-android-emulator.sh &
9
+ EMULATOR_STARTER_PID=$!
10
+
11
+ . $PROJECT_DIR /build/tns.sh
12
+
13
+ activate_node_env
14
+
15
+ cd " $PROJECT_DIR /tests"
16
+
17
+ npm install
18
+ rm -rf platforms/android
19
+ tns platform add android
20
+
21
+ wait $EMULATOR_STARTER_PID
22
+ tns test android | tee test-output.txt
23
+
24
+ if grep -q -E ' Executed[[:space:]][[:digit:]]+.*FAILED' test-output.txt ; then
25
+ echo " TESTS FAILED!"
26
+ exit 1
27
+ else
28
+ echo " TESTS SUCCEEDED."
29
+ exit 0
30
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -e
3
+
4
+ wait_for_emulator () {
5
+ adb wait-for-device
6
+
7
+ A=$( adb shell getprop sys.boot_completed | tr -d ' \r' )
8
+
9
+ while [ " $A " != " 1" ]; do
10
+ sleep 2
11
+ A=$( adb shell getprop sys.boot_completed | tr -d ' \r' )
12
+ done
13
+
14
+ adb shell input keyevent 82
15
+ }
16
+
17
+ create_emulator () {
18
+ echo no | android create avd --force -n Arm19 -t android-19 -b armeabi-v7a
19
+ }
20
+
21
+ start_emulator () {
22
+ emulator -avd Arm19 -no-skin -no-audio -no-boot-anim -no-window &
23
+ }
24
+
25
+ create_emulator
26
+ start_emulator
27
+ wait_for_emulator
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -e
3
+
4
+ export NVM_REPO=" https://github.com/creationix/nvm.git"
5
+ export NVM_DIR=" $( pwd) /.nvm"
6
+ export NODE_VER=" v5.5.0"
7
+
8
+ install_nvm () {
9
+ if [ ! -d " $NVM_DIR " ] ; then
10
+ git clone --depth=1 $NVM_REPO $NVM_DIR
11
+ else
12
+ echo " NVM detected at $NVM_DIR "
13
+ fi
14
+ }
15
+
16
+ activate_nvm () {
17
+ . " $NVM_DIR /nvm.sh"
18
+ }
19
+
20
+ installed_under_nvm () {
21
+ which $1 | grep -q " $NVM_DIR "
22
+ }
23
+
24
+ install_node () {
25
+ nvm install $NODE_VER
26
+ nvm use $NODE_VER
27
+ }
28
+
29
+
30
+ install_latest_tns () {
31
+ if installed_under_nvm tns ; then
32
+ echo " tns already installed."
33
+ else
34
+ echo " n" | npm install -g nativescript
35
+ fi
36
+ }
37
+
38
+ activate_node_env () {
39
+ install_nvm
40
+ activate_nvm
41
+ install_node
42
+ install_latest_tns
43
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ adb wait-for-device
4
+
5
+ A=$( adb shell getprop sys.boot_completed | tr -d ' \r' )
6
+
7
+ while [ " $A " != " 1" ]; do
8
+ sleep 2
9
+ A=$( adb shell getprop sys.boot_completed | tr -d ' \r' )
10
+ done
11
+
12
+ adb shell input keyevent 82
You can’t perform that action at this time.
0 commit comments