Skip to content

Commit

Permalink
properly handle exit codes in test script
Browse files Browse the repository at this point in the history
  • Loading branch information
wasserth committed Oct 24, 2023
1 parent c695b4c commit 7a585b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
set -e

# To run these tests simply do
# ./tests.sh <license_key>

Expand Down Expand Up @@ -39,11 +41,12 @@ TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest
pytest -v tests/test_end_to_end.py::test_end_to_end::test_lung_vessels

# Test tissue types (without license)
TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_no_license.nii.gz -ta tissue_types -d cpu --ml
# (use "|| true" to not abort if this command returns exit code 1, which it should do)
TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_no_license.nii.gz -ta tissue_types -d cpu --ml || true
pytest -v tests/test_end_to_end.py::test_end_to_end::test_tissue_types_wo_license

# Test tissue types (wrong license)
TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_wrong_license.nii.gz -ta tissue_types -d cpu --ml -l aca_123456789
TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_wrong_license.nii.gz -ta tissue_types -d cpu --ml -l aca_123456789 || true
pytest -v tests/test_end_to_end.py::test_end_to_end::test_tissue_types_wrong_license

# Test tissue types (with license)
Expand Down

0 comments on commit 7a585b9

Please sign in to comment.