-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run C++ tests on CI with run_test.py #99956
Changes from all commits
e83019f
c67cba0
0c11b24
fc97201
f8c7d34
e34ea40
3c18cbb
d209f43
8ba3173
f4c208f
171ebf7
c9cc57f
c1034a4
6f8e96b
668f038
d3faa07
e1298ee
9bd4863
6d5e30f
f0fddd1
c461de0
6ece6a0
d9b2631
4c5c73c
68021d6
3a08e73
0481b34
a1e9d26
a894369
c948726
ed88a60
2d49eb9
91aecac
19b60af
689631b
a54855c
ded76cf
35819be
d878a43
4d545dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,75 +3,78 @@ set -x | |
set -e | ||
|
||
VALGRIND_SUP="${PWD}/`dirname $0`/valgrind.sup" | ||
pushd $1 | ||
export CPP_TESTS_DIR=$1 | ||
|
||
VALGRIND=${VALGRIND:=ON} | ||
./basic | ||
./atest | ||
./scalar_test | ||
./broadcast_test | ||
./wrapdim_test | ||
./apply_utils_test | ||
./dlconvertor_test | ||
./native_test | ||
./scalar_tensor_test | ||
python test/run_test.py --cpp --verbose -i \ | ||
cpp/basic \ | ||
cpp/atest \ | ||
cpp/scalar_test \ | ||
cpp/broadcast_test \ | ||
cpp/wrapdim_test \ | ||
cpp/apply_utils_test \ | ||
cpp/dlconvertor_test \ | ||
cpp/native_test \ | ||
cpp/scalar_tensor_test \ | ||
cpp/undefined_tensor_test \ | ||
cpp/extension_backend_test \ | ||
cpp/lazy_tensor_test \ | ||
cpp/tensor_iterator_test \ | ||
cpp/Dimname_test \ | ||
cpp/Dict_test \ | ||
cpp/NamedTensor_test \ | ||
cpp/cpu_generator_test \ | ||
cpp/legacy_vmap_test \ | ||
cpp/operators_test | ||
|
||
if [[ -x ./tensor_interop_test ]]; then | ||
./tensor_interop_test | ||
python test/run_test.py --cpp --verbose -i cpp/tensor_interop_test | ||
fi | ||
./undefined_tensor_test | ||
./extension_backend_test | ||
./lazy_tensor_test | ||
./tensor_iterator_test | ||
./Dimname_test | ||
./Dict_test | ||
./NamedTensor_test | ||
./cpu_generator_test | ||
./legacy_vmap_test | ||
./operators_test | ||
if [[ -x ./cudnn_test ]]; then | ||
./cudnn_test | ||
python test/run_test.py --cpp --verbose -i cpp/cudnn_test | ||
fi | ||
if [[ -x ./cuda_generator_test ]]; then | ||
./cuda_generator_test | ||
python test/run_test.py --cpp --verbose -i cpp/cuda_generator_test | ||
fi | ||
if [[ -x ./apply_test ]]; then | ||
./apply_test | ||
python test/run_test.py --cpp --verbose -i cpp/apply_test | ||
fi | ||
if [[ -x ./stream_test ]]; then | ||
./stream_test | ||
python test/run_test.py --cpp --verbose -i cpp/stream_test | ||
fi | ||
if [[ -x ./cuda_half_test ]]; then | ||
./cuda_half_test | ||
python test/run_test.py --cpp --verbose -i cpp/cuda_half_test | ||
fi | ||
if [[ -x ./cuda_vectorized_test ]]; then | ||
./cuda_vectorized_test | ||
python test/run_test.py --cpp --verbose -i cpp/cuda_vectorized_test | ||
fi | ||
if [[ -x ./cuda_distributions_test ]]; then | ||
./cuda_distributions_test | ||
python test/run_test.py --cpp --verbose -i cpp/cuda_distributions_test | ||
fi | ||
if [[ -x ./cuda_optional_test ]]; then | ||
./cuda_optional_test | ||
python test/run_test.py --cpp --verbose -i cpp/cuda_optional_test | ||
fi | ||
if [[ -x ./cuda_tensor_interop_test ]]; then | ||
./cuda_tensor_interop_test | ||
python test/run_test.py --cpp --verbose -i cpp/cuda_tensor_interop_test | ||
fi | ||
if [[ -x ./cuda_complex_test ]]; then | ||
./cuda_complex_test | ||
python test/run_test.py --cpp --verbose -i cpp/cuda_complex_test | ||
fi | ||
if [[ -x ./cuda_complex_math_test ]]; then | ||
./cuda_complex_math_test | ||
python test/run_test.py --cpp --verbose -i cpp/cuda_complex_math_test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why make these verbose? Does this turn them into "as verbose as normal python tests" mode, or do cpp tests need to be extra verbose for some reason? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a force of habit I guess as other Python tests all run with |
||
fi | ||
if [[ -x ./cuda_cub_test ]]; then | ||
./cuda_cub_test | ||
python test/run_test.py --cpp --verbose -i cpp/cuda_cub_test | ||
fi | ||
if [[ -x ./cuda_atomic_ops_test ]]; then | ||
./cuda_atomic_ops_test | ||
python test/run_test.py --cpp --verbose -i cpp/cuda_atomic_ops_test | ||
fi | ||
|
||
if [ "$VALGRIND" == "ON" ]; then | ||
valgrind --suppressions="$VALGRIND_SUP" --error-exitcode=1 ./basic --gtest_filter='-*CUDA' | ||
# NB: As these tests are invoked by valgrind, let's leave them for now as it's | ||
# unclear if valgrind -> python -> gtest would work | ||
valgrind --suppressions="$VALGRIND_SUP" --error-exitcode=1 "${CPP_TESTS_DIR}/basic" --gtest_filter='-*CUDA' | ||
if [[ -x ./tensor_interop_test ]]; then | ||
valgrind --suppressions="$VALGRIND_SUP" --error-exitcode=1 ./tensor_interop_test | ||
valgrind --suppressions="$VALGRIND_SUP" --error-exitcode=1 "${CPP_TESTS_DIR}/tensor_interop_test" | ||
fi | ||
fi | ||
|
||
popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why the
pushd/popd
was needed now when it wasn't needed beforeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script
test/cpp/jit/tests_setup.py
creates and cleans up a dummy JIT output for testing to the current directory. Previously, when the C++ tests was run directly as an executable, there was no need to change the directory. On the other hand,run_test.py
changes the working directory totest
, thus I need to do the same here to create that dummy output intest
folder instead.