mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
Enable unit test(using ctest) on Github Actions CI(Linux and macOS only at the moment).
Fix USDA parser and USDC parser unit runner.
This commit is contained in:
4
.github/workflows/linux_ci.yml
vendored
4
.github/workflows/linux_ci.yml
vendored
@@ -93,6 +93,8 @@ jobs:
|
||||
run: ./scripts/bootstrap-cmake-linux-32bit.sh
|
||||
- name: make
|
||||
run: cd build_m32 && make
|
||||
- name: test
|
||||
run: ctest --output-on-failure
|
||||
|
||||
build:
|
||||
|
||||
@@ -104,3 +106,5 @@ jobs:
|
||||
run: ./scripts/bootstrap-cmake-linux.sh
|
||||
- name: make
|
||||
run: cd build && make
|
||||
- name: tests
|
||||
run: ctest --output-on-failure
|
||||
|
||||
4
.github/workflows/macos_ci.yml
vendored
4
.github/workflows/macos_ci.yml
vendored
@@ -23,5 +23,7 @@ jobs:
|
||||
./scripts/bootstrap-cmake-macos.sh
|
||||
cd build
|
||||
make VERBOSE=1
|
||||
|
||||
- name: Ctest
|
||||
run: |
|
||||
ctest --output-on-failure
|
||||
|
||||
|
||||
@@ -937,7 +937,19 @@ if(TINYUSDZ_BUILD_TESTS)
|
||||
add_test(
|
||||
NAME usda-parser-unit-test
|
||||
COMMAND python ${PROJECT_SOURCE_DIR}/tests/usda/unit-runner.py --app
|
||||
"$<TARGET_FILE:usda_parser>" --basedir "${PROJECT_SOURCE_DIR}")
|
||||
"$<TARGET_FILE:usda_parser>" --basedir "${PROJECT_SOURCE_DIR}/tests/usda"
|
||||
)
|
||||
endif()
|
||||
|
||||
#
|
||||
# USDA parser tester
|
||||
#
|
||||
if(TINYUSDZ_WITH_TOOL_USDC_PARSER AND TINYUSDZ_WITH_MODULE_USDC_READER)
|
||||
add_test(
|
||||
NAME usdc-parser-unit-test
|
||||
COMMAND python ${PROJECT_SOURCE_DIR}/tests/usdc/unit-runner.py --app
|
||||
"$<TARGET_FILE:usdc_parser>" --basedir "${PROJECT_SOURCE_DIR}/tests/usdc"
|
||||
)
|
||||
endif()
|
||||
|
||||
endif(TINYUSDZ_BUILD_TESTS)
|
||||
|
||||
@@ -13,13 +13,14 @@ add_executable(${TEST_TARGET_NAME}
|
||||
|
||||
add_sanitizers(${TEST_TARGET_NAME})
|
||||
|
||||
if (WIN32)
|
||||
add_test(NAME ${TEST_TARGET_NAME} COMMAND "${TEST_TARGET_NAME}.exe"
|
||||
WORKING_DIRECTORY $<TARGET_FILE_DIR:${TEST_TARGET_NAME}> )
|
||||
else (WIN32)
|
||||
add_test(NAME ${TEST_TARGET_NAME} COMMAND "${TEST_TARGET_NAME}"
|
||||
WORKING_DIRECTORY $<TARGET_FILE_DIR:${TEST_TARGET_NAME}> )
|
||||
endif (WIN32)
|
||||
# TODO: Add test-decompress-int to unit test suite?
|
||||
#if (WIN32)
|
||||
# add_test(NAME ${TEST_TARGET_NAME} COMMAND "${TEST_TARGET_NAME}.exe"
|
||||
# WORKING_DIRECTORY $<TARGET_FILE_DIR:${TEST_TARGET_NAME}> )
|
||||
#else (WIN32)
|
||||
# add_test(NAME ${TEST_TARGET_NAME} COMMAND "${TEST_TARGET_NAME}"
|
||||
# WORKING_DIRECTORY $<TARGET_FILE_DIR:${TEST_TARGET_NAME}> )
|
||||
#endif (WIN32)
|
||||
|
||||
target_include_directories(${TEST_TARGET_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/src)
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import glob
|
||||
import subprocess
|
||||
|
||||
@@ -46,3 +47,9 @@ if __name__ == '__main__':
|
||||
for fname in false_negatives:
|
||||
print("parse should fail but reported success : ", fname)
|
||||
|
||||
if len(failed) > 0:
|
||||
sys.exit(1)
|
||||
else:
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import glob
|
||||
import subprocess
|
||||
|
||||
@@ -46,3 +47,8 @@ if __name__ == '__main__':
|
||||
for fname in false_negatives:
|
||||
print("parse should fail but reported success : ", fname)
|
||||
|
||||
|
||||
if len(failed) > 0:
|
||||
sys.exit(1)
|
||||
else:
|
||||
sys.exit(0)
|
||||
|
||||
Reference in New Issue
Block a user