Skip to content

Commit

Permalink
Fix the fail check in shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
HuiSF committed Mar 22, 2022
1 parent 88e5022 commit a1fc92d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
31 changes: 16 additions & 15 deletions build-support/integ_test_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ fi


SEPARATE_INTEGRATION_TESTS_PATH="integration_test/separate_integration_tests"

if [ -d "${SEPARATE_INTEGRATION_TESTS_PATH}" ]
then
TEST_ENTRIES=`ls ${SEPARATE_INTEGRATION_TESTS_PATH}/*.dart`
Expand All @@ -80,23 +81,23 @@ then
resultsList+=(1)
fi
done
fi

testFailure=0
for i in "${!testsList[@]}"; do
resultPrint=""
if [ "${resultsList[i]}" == 0 ]
then
echo "${testsList[i]}"
else
testFailure=1
echo "${testsList[i]}"
fi
done

if [ $testFailure -eq 1 ]
testFailure=0
for i in "${!testsList[@]}"; do
resultPrint=""
if [ "${resultsList[i]}" == 0 ]
then
exit 1
echo "${testsList[i]}"
else
exit 0
testFailure=1
echo "${testsList[i]}"
fi
done

if [ $testFailure -eq 1 ]
then
exit 1
else
exit 0
fi
30 changes: 15 additions & 15 deletions build-support/integ_test_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,23 @@ then
resultsList+=(1)
fi
done
fi

testFailure=0
for i in "${!testsList[@]}"; do
resultPrint=""
if [ "${resultsList[i]}" == 0 ]
then
echo "${testsList[i]}"
else
testFailure=1
echo "${testsList[i]}"
fi
done

if [ $testFailure -eq 1 ]
testFailure=0
for i in "${!testsList[@]}"; do
resultPrint=""
if [ "${resultsList[i]}" == 0 ]
then
exit 1
echo "${testsList[i]}"
else
exit 0
testFailure=1
echo "${testsList[i]}"
fi
done

if [ $testFailure -eq 1 ]
then
exit 1
else
exit 0
fi

0 comments on commit a1fc92d

Please sign in to comment.