summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--tests/custom/CMakeLists.txt10
-rwxr-xr-xtests/custom/run_tests.sh3
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/custom/CMakeLists.txt b/tests/custom/CMakeLists.txt
index d56cb99..c8007a0 100644
--- a/tests/custom/CMakeLists.txt
+++ b/tests/custom/CMakeLists.txt
@@ -3,7 +3,10 @@ ADD_TEST(
COMMAND run_tests.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
-SET_PROPERTY(TEST custom APPEND PROPERTY ENVIRONMENT "UCODE_BIN=valgrind --quiet --leak-check=full $<TARGET_FILE:ucode>")
+SET_PROPERTY(TEST custom APPEND PROPERTY ENVIRONMENT
+ "UCODE_BIN=valgrind --quiet --leak-check=full $<TARGET_FILE:ucode>"
+ "UCODE_LIB=${CMAKE_BINARY_DIR}"
+)
IF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
ADD_TEST(
@@ -12,5 +15,8 @@ IF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
- SET_PROPERTY(TEST custom-san APPEND PROPERTY ENVIRONMENT "UCODE_BIN=$<TARGET_FILE:ucode-san>")
+ SET_PROPERTY(TEST custom-san APPEND PROPERTY ENVIRONMENT
+ "UCODE_BIN=$<TARGET_FILE:ucode-san>"
+ "UCODE_LIB=${CMAKE_BINARY_DIR}"
+ )
ENDIF()
diff --git a/tests/custom/run_tests.sh b/tests/custom/run_tests.sh
index b20404a..61b116f 100755
--- a/tests/custom/run_tests.sh
+++ b/tests/custom/run_tests.sh
@@ -5,6 +5,7 @@ topdir=$(readlink -f "$testdir/../..")
line='........................................'
ucode_bin=${UCODE_BIN:-"$topdir/ucode"}
+ucode_lib=${UCODE_LIB:-"$topdir"}
extract_sections() {
local file=$1
@@ -53,7 +54,7 @@ run_testcase() {
(
cd "$topdir"
- $ucode_bin -e '{ "REQUIRE_SEARCH_PATH": [ "'"$topdir"'/*.so" ] }' -i - <"$in" >"$dir/res.out" 2>"$dir/res.err"
+ $ucode_bin -e '{ "REQUIRE_SEARCH_PATH": [ "'"$ucode_lib"'/*.so" ] }' -i - <"$in" >"$dir/res.out" 2>"$dir/res.err"
)
touch "$dir/empty"