From 64b8c2a26770c693233737c64ccc3302e175ff68 Mon Sep 17 00:00:00 2001 From: yekuang Date: Thu, 26 May 2022 11:11:22 +0800 Subject: [PATCH] [ci] Run cpp tests via run_tests.py (#5035) * [ci] Run cpp tests via run_tests.py * default to False * enable cpp on win --- .github/workflows/scripts/unix_test.sh | 3 +-- ci/windows/win_build_test.ps1 | 1 + tests/run_tests.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/unix_test.sh b/.github/workflows/scripts/unix_test.sh index 7954f053d9903..d1f2ea59591af 100755 --- a/.github/workflows/scripts/unix_test.sh +++ b/.github/workflows/scripts/unix_test.sh @@ -48,8 +48,7 @@ ti diagnose ti changelog echo "wanted archs: $TI_WANTED_ARCHS" -TI_PATH=$(python3 -c "import taichi;print(taichi.__path__[0])" | tail -1) -TI_LIB_DIR="$TI_PATH/_lib/runtime" ./build/taichi_cpp_tests +python3 tests/run_tests.py --cpp if [ -z "$GPU_TEST" ]; then if [[ $PLATFORM == *"m1"* ]]; then diff --git a/ci/windows/win_build_test.ps1 b/ci/windows/win_build_test.ps1 index f50a3bfe256c1..35b6c6db3f6ee 100644 --- a/ci/windows/win_build_test.ps1 +++ b/ci/windows/win_build_test.ps1 @@ -61,5 +61,6 @@ python setup.py develop WriteInfo("Build finished") WriteInfo("Testing Taichi") +python tests/run_tests.py --cpp python tests/run_tests.py -vr2 -t2 -k "not torch and not paddle" -a cpu WriteInfo("Test finished") diff --git a/tests/run_tests.py b/tests/run_tests.py index ca7f557fe6a08..7621f985394ae 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -110,9 +110,9 @@ def test(): parser.add_argument('-c', '--cpp', dest='cpp', - default=True, + default=False, action='store_true', - help='Run the C++ tests') + help='Only run the C++ tests') parser.add_argument('-s', '--show', dest='show_output', @@ -209,6 +209,7 @@ def test(): if args.cpp: _test_cpp() + return if _test_python(args) != 0: exit(1)