@@ -747,23 +747,11 @@ function build_this_sketch()
747
747
done
748
748
749
749
if [[ " $arduinoExitStatus " != " $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS " ]]; then
750
- # Sketch build failed
751
- if [[ " $allowFail " == " true" || " $allowFail " == " require" ]]; then
752
- # Failure is allowed for this test
753
- local -r buildThisSketchExitStatus=" $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS "
754
- else
755
- # Failure is not allowed for this test, fail the Travis build after completing all sketch builds
756
- local -r buildThisSketchExitStatus=" $ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS "
757
- fi
750
+ # Sketch verification failed
751
+ local buildThisSketchExitStatus=" $ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS "
758
752
else
759
- # Sketch build succeeded
760
- if [[ " $allowFail " == " require" ]]; then
761
- # Failure is required for this test, fail the Travis build after completing all sketch builds
762
- local -r buildThisSketchExitStatus=" $ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS "
763
- else
764
- # Success is allowed
765
- local -r buildThisSketchExitStatus=" $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS "
766
- fi
753
+ # Sketch verification succeeded
754
+ local buildThisSketchExitStatus=" $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS "
767
755
768
756
# Parse through the output from the sketch verification to count warnings and determine the compile size
769
757
local warningCount=0
@@ -814,15 +802,22 @@ function build_this_sketch()
814
802
local -r programStorage=${programStorageWithComma// ,}
815
803
local -r dynamicMemory=${dynamicMemoryWithComma// ,}
816
804
817
- if [[ " $boardIssue " != " " && " $ARDUINO_CI_SCRIPT_TEST_BOARD " == " true" && " $allowFail " != " true " ]]; then
805
+ if [[ " $boardIssue " != " " && " $ARDUINO_CI_SCRIPT_TEST_BOARD " == " true" ]]; then
818
806
# There was a board issue and board testing is enabled so fail the build
819
- local -r buildThisSketchExitStatus=" $ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS "
807
+ local buildThisSketchExitStatus=" $ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS "
820
808
fi
821
809
fi
822
810
823
811
# Add the build data to the report file
824
812
echo " $( date -u " +%Y-%m-%d %H:%M:%S" ) " $' \t ' " $TRAVIS_BUILD_NUMBER " $' \t ' " $TRAVIS_JOB_NUMBER " $' \t ' " https://travis-ci.org/${TRAVIS_REPO_SLUG} /jobs/${TRAVIS_JOB_ID} " $' \t ' " $TRAVIS_EVENT_TYPE " $' \t ' " $TRAVIS_ALLOW_FAILURE " $' \t ' " $TRAVIS_PULL_REQUEST " $' \t ' " $TRAVIS_BRANCH " $' \t ' " $TRAVIS_COMMIT " $' \t ' " $TRAVIS_COMMIT_RANGE " $' \t ' " ${TRAVIS_COMMIT_MESSAGE%% $' \n ' * } " $' \t ' " $sketchName " $' \t ' " $boardID " $' \t ' " $IDEversion " $' \t ' " $programStorage " $' \t ' " $dynamicMemory " $' \t ' " $warningCount " $' \t ' " $allowFail " $' \t ' " $arduinoExitStatus " $' \t ' " $boardIssueCount " $' \t ' " $boardIssue " $' \r ' >> " $ARDUINO_CI_SCRIPT_REPORT_FILE_PATH "
825
813
814
+ # Adjust the exit status according to the allowFail setting
815
+ if [[ " $buildThisSketchExitStatus " == " $ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS " && (" $allowFail " == " true" || " $allowFail " == " require" ) ]]; then
816
+ buildThisSketchExitStatus=" $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS "
817
+ elif [[ " $buildThisSketchExitStatus " == " $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS " && " $allowFail " == " require" ]]; then
818
+ buildThisSketchExitStatus=" $ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS "
819
+ fi
820
+
826
821
if [[ " $buildThisSketchExitStatus " != " $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS " ]]; then
827
822
ARDUINO_CI_SCRIPT_TOTAL_SKETCH_BUILD_FAILURE_COUNT=$(( ARDUINO_CI_SCRIPT_TOTAL_SKETCH_BUILD_FAILURE_COUNT + 1 ))
828
823
fi
0 commit comments