diff options
author | Yinghai Lu <yinghai@fb.com> | 2018-04-30 17:30:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-30 17:30:03 -0700 |
commit | 6e72ba9798c6da38283d0891d33f5510e6a4114d (patch) | |
tree | 0d86fd0d033950285203acd6fe54947be5750995 /.jenkins | |
parent | 7efd6f050629f436aac41fa6ad865327fe2aa1c5 (diff) | |
download | pytorch-6e72ba9798c6da38283d0891d33f5510e6a4114d.tar.gz pytorch-6e72ba9798c6da38283d0891d33f5510e6a4114d.tar.bz2 pytorch-6e72ba9798c6da38283d0891d33f5510e6a4114d.zip |
[Caffe2] Fail fast for C++ unit tests too (#7106)
* Fail fast for C++ unittests too
* Fix based on comments
Diffstat (limited to '.jenkins')
-rwxr-xr-x | .jenkins/caffe2/test.sh | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/.jenkins/caffe2/test.sh b/.jenkins/caffe2/test.sh index 3a28f6c680..5c063062bd 100755 --- a/.jenkins/caffe2/test.sh +++ b/.jenkins/caffe2/test.sh @@ -44,8 +44,6 @@ if [[ "$BUILD_ENVIRONMENT" != conda* ]]; then export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${INSTALL_PREFIX}/lib" fi -exit_code=0 - cd "$ROOT_DIR" if [ -d $TEST_DIR ]; then @@ -75,9 +73,9 @@ for test in $INSTALL_PREFIX/test/*; do esac "$test" --gtest_output=xml:"$TEST_DIR"/cpp/$(basename "$test").xml - tmp_exit_code="$?" - if [ "$exit_code" -eq 0 ]; then - exit_code="$tmp_exit_code" + exit_code="$?" + if [ "$exit_code" -ne 0 ]; then + exit "$exit_code" fi done @@ -112,10 +110,7 @@ echo "Running Python tests.." "$CAFFE2_PYPATH/python" \ "${EXTRA_TESTS[@]}" -tmp_exit_code="$?" -if [ "$exit_code" -eq 0 ]; then - exit_code="$tmp_exit_code" -fi +exit_code="$?" # Exit with the first non-zero status we got exit "$exit_code" |