Skip to content

Commit

Permalink
Add version checks to smoke tests (pytorch#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjc123 authored and soumith committed Oct 14, 2019
1 parent baf6817 commit afc3799
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ if [[ "$OSTYPE" == "msys" ]]; then
fi
fi

# Test that the version number is consistent during building and testing
if [[ "$PYTORCH_BUILD_NUMBER" -gt 1 ]]; then
expected_version="${PYTORCH_BUILD_VERSION}.post${PYTORCH_BUILD_NUMBER}"
else
expected_version="${PYTORCH_BUILD_VERSION}"
fi
echo "Checking that we are testing the package that is just built"
python -c "import torch; exit(0 if torch.__version__ == '$expected_version' else 1)"

# Test that CUDA builds are setup correctly
if [[ "$cuda_ver" != 'cpu' ]]; then
# Test CUDA archs
Expand Down

0 comments on commit afc3799

Please sign in to comment.