summaryrefslogtreecommitdiff
path: root/test-art-target-test.sh
diff options
context:
space:
mode:
authorKevin Brodsky <kevin.brodsky@linaro.org>2015-12-14 15:06:32 +0000
committerVishal Bhoj <vishal.bhoj@linaro.org>2016-01-04 09:17:02 +0530
commit7d90c77e19510bb9de2c95215ad966480fcc9096 (patch)
tree0e539aee75eef1348318773cab97606f41050d58 /test-art-target-test.sh
parent2e2f0d4fd981099d34cf021dbee54defa639f8c1 (diff)
downloadart-build-tests.sh-7d90c77e19510bb9de2c95215ad966480fcc9096.tar.gz
Conditions refactoring and various cleanup
- Since we use bash, refactor condition testing using [[ ]] to avoid missing quotes and more readable logical operators (&& / ||). - Remove unnecessary braces in variable expansion ($var instead of ${var}). - Standardize default value assignments using the ${:=} expansion. - Quote variable expansions when needed and other refactorings to properly handle paths with spaces. - Only export variables when necessary. - Use `exit 1` instead of `exit -1`. The return code is always positive, `exit -1` actually returns 255 which should not be used as return codes over 125 have a special meaning for bash. - Do not create $WORKSPACE/build/out, no script uses this directory. - Various minor cleanups (unneeded spaces, etc.). Change-Id: I30e9db71092744fedf7b3d39074bcbc7dc1429c8
Diffstat (limited to 'test-art-target-test.sh')
-rwxr-xr-xtest-art-target-test.sh58
1 files changed, 29 insertions, 29 deletions
diff --git a/test-art-target-test.sh b/test-art-target-test.sh
index 79e2992..9b3d69c 100755
--- a/test-art-target-test.sh
+++ b/test-art-target-test.sh
@@ -10,7 +10,7 @@ export GTEST_OUTPUT=xml:$TEST_ART_OUTPUT_DIR
MAKE_TARGETS=$TEST_ART_COMMAND
mkdir -p $WORKSPACE/$TEST_ART_COMMAND/
-if [ ! -e ./art/tools/buildbot-build.sh ]; then
+if [[ ! -e ./art/tools/buildbot-build.sh ]]; then
wget https://android-git.linaro.org/gitweb/platform/art.git/blob_plain/refs/heads/master:/tools/buildbot-build.sh -O ./art/tools/buildbot-build.sh
sed -i "s/build-art-target-tests/build-art-target/g" ./art/tools/buildbot-build.sh
chmod a+x ./art/tools/buildbot-build.sh
@@ -46,7 +46,7 @@ export ART_TEST_NO_SYNC=true
make -j2 test-art-target-gtest64 > $WORKSPACE/build-logs-64.txt 2>&1
-if [ $? -ne 0 ]; then
+if [[ $? -ne 0 ]]; then
echo "Error: *** Error test-art-target-gtest64 failed"
cat $WORKSPACE/build-logs-64.txt
failed=1
@@ -54,7 +54,7 @@ fi
make -j2 test-art-target-run-test-default >> $WORKSPACE/build-logs-64.txt 2>&1
-if [ $? -ne 0 ]; then
+if [[ $? -ne 0 ]]; then
echo "Error: *** Error test-art-target-run-test-default failed"
cat $WORKSPACE/build-logs-64.txt
failed=1
@@ -62,7 +62,7 @@ fi
make -j2 test-art-target-run-test-interpreter >> $WORKSPACE/build-logs-64.txt 2>&1
-if [ $? -ne 0 ]; then
+if [[ $? -ne 0 ]]; then
echo "Error: *** Error test-art-target-run-test-interpreter failed"
cat $WORKSPACE/build-logs-64.txt
failed=1
@@ -72,20 +72,20 @@ export ART_TEST_RUN_TEST_DEBUGGABLE=true
make -j2 test-art-target-run-test-optimizing >> $WORKSPACE/build-logs-64.txt 2>&1
-if [ $? -ne 0 ]; then
+if [[ $? -ne 0 ]]; then
echo "Error: *** Error test-art-target-run-test-optimizing failed"
cat $WORKSPACE/build-logs-64.txt
failed=1
fi
-echo "YVALUE=`grep "2mPASSED" $WORKSPACE/build-logs-64.txt | grep "gtest" | wc -l`" > ${WORKSPACE}/gtest-pass_count-64.txt
-echo "YVALUE=`grep "1mFAILED" $WORKSPACE/build-logs-64.txt | grep "gtest" | wc -l`" > ${WORKSPACE}/gtest-fail_count-64.txt
-echo "YVALUE=`grep "3mSKIPPING" $WORKSPACE/build-logs-64.txt | grep "gtest" | wc -l`" > ${WORKSPACE}/gtest-skip_count-64.txt
-echo "YVALUE=`grep "2mPASSED" $WORKSPACE/build-logs-64.txt | grep "run-test" | wc -l`" > ${WORKSPACE}/run-test-pass_count-64.txt
-echo "YVALUE=`grep "1mFAILED" $WORKSPACE/build-logs-64.txt | grep "run-test" | wc -l`" > ${WORKSPACE}/run-test-fail_count-64.txt
-echo "YVALUE=`grep "3mSKIPPING" $WORKSPACE/build-logs-64.txt | grep "run-test" | wc -l`" > ${WORKSPACE}/run-test-skip_count-64.txt
-#grep -rni "1mFAILED" $WORKSPACE/build-logs-64.txt | sed "s/.*://g" | sed "s/ .*//g" > ${WORKSPACE}/failing-tests-64.txt
-#grep -rni "3mSKIPPING" $WORKSPACE/build-logs-64.txt | sed "s/.*://g" | sed "s/ .*//g" > ${WORKSPACE}/skipped-tests-64.txt
+echo "YVALUE=`grep "2mPASSED" $WORKSPACE/build-logs-64.txt | grep "gtest" | wc -l`" > $WORKSPACE/gtest-pass_count-64.txt
+echo "YVALUE=`grep "1mFAILED" $WORKSPACE/build-logs-64.txt | grep "gtest" | wc -l`" > $WORKSPACE/gtest-fail_count-64.txt
+echo "YVALUE=`grep "3mSKIPPING" $WORKSPACE/build-logs-64.txt | grep "gtest" | wc -l`" > $WORKSPACE/gtest-skip_count-64.txt
+echo "YVALUE=`grep "2mPASSED" $WORKSPACE/build-logs-64.txt | grep "run-test" | wc -l`" > $WORKSPACE/run-test-pass_count-64.txt
+echo "YVALUE=`grep "1mFAILED" $WORKSPACE/build-logs-64.txt | grep "run-test" | wc -l`" > $WORKSPACE/run-test-fail_count-64.txt
+echo "YVALUE=`grep "3mSKIPPING" $WORKSPACE/build-logs-64.txt | grep "run-test" | wc -l`" > $WORKSPACE/run-test-skip_count-64.txt
+#grep -rni "1mFAILED" $WORKSPACE/build-logs-64.txt | sed "s/.*://g" | sed "s/ .*//g" > $WORKSPACE/failing-tests-64.txt
+#grep -rni "3mSKIPPING" $WORKSPACE/build-logs-64.txt | sed "s/.*://g" | sed "s/ .*//g" > $WORKSPACE/skipped-tests-64.txt
rm -rf out/target/product/armv8*
@@ -120,7 +120,7 @@ export ART_TEST_NO_SYNC=true
make -j2 test-art-target-gtest32 > $WORKSPACE/build-logs-32.txt 2>&1
-if [ $? -ne 0 ]; then
+if [[ $? -ne 0 ]]; then
echo "Error: *** Error test-art-target-gtest64 failed"
cat $WORKSPACE/build-logs-32.txt
failed=1
@@ -128,7 +128,7 @@ fi
make -j2 test-art-target-run-test-default >> $WORKSPACE/build-logs-32.txt 2>&1
-if [ $? -ne 0 ]; then
+if [[ $? -ne 0 ]]; then
echo "Error: *** Error test-art-target-run-test-default failed"
cat $WORKSPACE/build-logs-32.txt
failed=1
@@ -136,7 +136,7 @@ fi
make -j2 test-art-target-run-test-interpreter >> $WORKSPACE/build-logs-32.txt 2>&1
-if [ $? -ne 0 ]; then
+if [[ $? -ne 0 ]]; then
echo "Error: *** Error test-art-target-run-test-interpreter failed"
cat $WORKSPACE/build-logs-32.txt
failed=1
@@ -146,29 +146,29 @@ export ART_TEST_RUN_TEST_DEBUGGABLE=true
make -j2 test-art-target-run-test-optimizing >> $WORKSPACE/build-logs-32.txt 2>&1
-if [ $? -ne 0 ]; then
+if [[ $? -ne 0 ]]; then
echo "Error: *** Error test-art-target-run-test-optimizing failed"
cat $WORKSPACE/build-logs-32.txt
failed=1
fi
-echo "YVALUE=`grep "2mPASSED" $WORKSPACE/build-logs-32.txt | grep "gtest" | wc -l`" > ${WORKSPACE}/gtest-pass_count-32.txt
-echo "YVALUE=`grep "1mFAILED" $WORKSPACE/build-logs-32.txt | grep "gtest" | wc -l`" > ${WORKSPACE}/gtest-fail_count-32.txt
-echo "YVALUE=`grep "3mSKIPPING" $WORKSPACE/build-logs-32.txt | grep "gtest" | wc -l`" > ${WORKSPACE}/gtest-skip_count-32.txt
-echo "YVALUE=`grep "2mPASSED" $WORKSPACE/build-logs-32.txt | grep "run-test" | wc -l`" > ${WORKSPACE}/run-test-pass_count-32.txt
-echo "YVALUE=`grep "1mFAILED" $WORKSPACE/build-logs-32.txt | grep "run-test" | wc -l`" > ${WORKSPACE}/run-test-fail_count-32.txt
-echo "YVALUE=`grep "3mSKIPPING" $WORKSPACE/build-logs-32.txt | grep "run-test" | wc -l`" > ${WORKSPACE}/run-test-skip_count-32.txt
-#grep -rni "1mFAILED" $WORKSPACE/build-logs-32.txt | sed "s/.*://g" | sed "s/ .*//g" > ${WORKSPACE}/failing-tests-32.txt
-#grep -rni "3mSKIPPING" $WORKSPACE/build-logs-32.txt | sed "s/.*://g" | sed "s/ .*//g" > ${WORKSPACE}/skipped-tests-32.txt
+echo "YVALUE=`grep "2mPASSED" $WORKSPACE/build-logs-32.txt | grep "gtest" | wc -l`" > $WORKSPACE/gtest-pass_count-32.txt
+echo "YVALUE=`grep "1mFAILED" $WORKSPACE/build-logs-32.txt | grep "gtest" | wc -l`" > $WORKSPACE/gtest-fail_count-32.txt
+echo "YVALUE=`grep "3mSKIPPING" $WORKSPACE/build-logs-32.txt | grep "gtest" | wc -l`" > $WORKSPACE/gtest-skip_count-32.txt
+echo "YVALUE=`grep "2mPASSED" $WORKSPACE/build-logs-32.txt | grep "run-test" | wc -l`" > $WORKSPACE/run-test-pass_count-32.txt
+echo "YVALUE=`grep "1mFAILED" $WORKSPACE/build-logs-32.txt | grep "run-test" | wc -l`" > $WORKSPACE/run-test-fail_count-32.txt
+echo "YVALUE=`grep "3mSKIPPING" $WORKSPACE/build-logs-32.txt | grep "run-test" | wc -l`" > $WORKSPACE/run-test-skip_count-32.txt
+#grep -rni "1mFAILED" $WORKSPACE/build-logs-32.txt | sed "s/.*://g" | sed "s/ .*//g" > $WORKSPACE/failing-tests-32.txt
+#grep -rni "3mSKIPPING" $WORKSPACE/build-logs-32.txt | sed "s/.*://g" | sed "s/ .*//g" > $WORKSPACE/skipped-tests-32.txt
MAKE_END=$(date +%s.%N)
MAKE_TIME=$(echo "$MAKE_END - $MAKE_START" | bc)
-echo "YVALUE=${MAKE_TIME}" > ${WORKSPACE}/make_time.txt
-echo "YVALUE=${REPO_TIME}" > ${WORKSPACE}/repo_time.txt
+echo "YVALUE=$MAKE_TIME" > $WORKSPACE/make_time.txt
+echo "YVALUE=$REPO_TIME" > $WORKSPACE/repo_time.txt
ccache -s
-if [ $failed -ne 0 ];then
- exit -1
+if [[ $failed -ne 0 ]]; then
+ exit 1
fi