aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2021-03-12 01:26:51 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2021-03-12 01:26:51 -0500
commit923257a67ae84fd48279ced3bb018e13bb19455e (patch)
treefe40c4766c6d154a06e685d12bf4340fbec2806a
parent555f483a1860c76e6bf375124c645cf653d96c2b (diff)
downloadreloc-923257a67ae84fd48279ced3bb018e13bb19455e.tar.gz
Add test for in place modification
-rw-r--r--test/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 9dab686..948e169 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -4,12 +4,16 @@ set(INPUT_SEARCH
/_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_)
set(INPUT_REPLACE
_ctest_replaced_this)
+set(INPLACE_FN
+ test_data2.bin)
set(INPUT_FN
test_data.bin)
set(OUTPUT_FN
test_data.out)
configure_file(${INPUT_FN} ${INPUT_FN} COPYONLY)
+configure_file(${INPUT_FN} ${INPLACE_FN} COPYONLY)
+file(REMOVE ${INPLACE_FN})
file(REMOVE ${OUTPUT_FN})
include_directories("${CMAKE_SOURCE_DIR}")
@@ -29,6 +33,8 @@ add_reloc_test(test_reloc_match test_reloc_match.c)
add_reloc_test(test_reloc_read test_reloc_read.c)
add_reloc_test(test_reloc_write test_reloc_write.c)
add_exec_test(test_exec_success reloc "${INPUT_SEARCH}" "${INPUT_REPLACE}" "${INPUT_FN}" "${OUTPUT_FN}")
+add_exec_test(test_exec_input_file_only_success reloc "${INPUT_SEARCH}" "${INPUT_REPLACE}" "${INPLACE_FN}")
# Windows users need grep too. "findstr" and "find" were not reliable here
add_exec_test(test_exec_result grep "${INPUT_REPLACE}" "${OUTPUT_FN}")
+add_exec_test(test_exec_input_file_only_result grep "${INPUT_REPLACE}" "${INPLACE_FN}")