FIND_PACKAGE(PythonInterp 3 REQUIRED)
FILE(GLOB test_cases "test_*.t")
+IF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ FILE(GLOB test_cases_san "test-san_*.t")
+ENDIF()
+
SET(PYTHON_VENV_DIR "${CMAKE_CURRENT_BINARY_DIR}/.venv")
SET(PYTHON_VENV_PIP "${PYTHON_VENV_DIR}/bin/pip")
SET(PYTHON_VENV_CRAM "${PYTHON_VENV_DIR}/bin/cram")
ADD_TEST(
NAME cram
- COMMAND ${PYTHON_VENV_CRAM} ${test_cases}
+ COMMAND ${PYTHON_VENV_CRAM} ${test_cases} ${test_cases_san}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
SET_PROPERTY(TEST cram APPEND PROPERTY ENVIRONMENT "UCI_LUA=$<TARGET_FILE:uci_lua>")
+SET_PROPERTY(TEST cram APPEND PROPERTY ENVIRONMENT "BUILD_BIN_DIR=$<TARGET_FILE_DIR:uci>")
--- /dev/null
+check that uci import is producing expected results:
+
+ $ [ -n "$BUILD_BIN_DIR" ] && export PATH="$BUILD_BIN_DIR:$PATH"
+ $ export TEST_INPUTS="$TESTDIR/inputs"
+ $ export FUZZ_CORPUS="$TESTDIR/../fuzz/corpus"
+
+ $ for file in $(LC_ALL=C find $FUZZ_CORPUS -type f | sort ); do
+ > uci-san import -f $file; \
+ > done
+ uci-san: I/O error
+ uci-san: Parse error (invalid command) at line 0, byte 0
+ uci-san: Parse error (invalid command) at line 1, byte 18
+ uci-san: I/O error
+ uci-san: I/O error
+ [1]
--- /dev/null
+check that uci import is producing expected results:
+
+ $ [ -n "$BUILD_BIN_DIR" ] && export PATH="$BUILD_BIN_DIR:$PATH"
+ $ export TEST_INPUTS="$TESTDIR/inputs"
+ $ export FUZZ_CORPUS="$TESTDIR/../fuzz/corpus"
+
+ $ for file in $(LC_ALL=C find $FUZZ_CORPUS -type f | sort ); do
+ > valgrind --quiet --leak-check=full uci import -f $file; \
+ > done
+ uci: I/O error
+ uci: Parse error (invalid command) at line 0, byte 0
+ uci: Parse error (invalid command) at line 1, byte 18
+ uci: I/O error
+ uci: I/O error
+ [1]