Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 172c41d

Browse files
Nicolas Cornupramodk
andauthored
Stop creating test files in source dir, use build directory instead (#268)
Co-authored-by: Pramod Kumbhar <[email protected]>
1 parent d9c7892 commit 172c41d

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

tests/integration/CMakeLists.txt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set(RING_GAP_COMMON_ARGS "--datpath ${CMAKE_CURRENT_SOURCE_DIR}/ring_gap ${COMMO
1111
set(PERMUTE1_ARGS "--cell-permute 1")
1212
set(PERMUTE2_ARGS "--cell-permute 2")
1313
if(CORENRN_ENABLE_GPU)
14-
set(GPU_ARGS "--nwarp 8 --gpu")
14+
set(GPU_ARGS "--gpu")
1515
endif()
1616

1717
# List of tests with arguments
@@ -32,7 +32,8 @@ set(TEST_CASES_WITH_ARGS
3232

3333
set(NEGATIVE_TEST_CASES_WITH_ARGS "ring_different_seed!${RING_COMMON_ARGS} ${GPU_ARGS} --outpath ${CMAKE_CURRENT_BINARY_DIR}/ring_different_seed --seed 123456")
3434

35-
# There are no directories for permute and multisend related tests, create them and copy ref spikes
35+
# There are no directories for permute and multisend related tests,
36+
# create them and copy ref spikes
3637
foreach(data_dir "ring" "ring_gap")
3738
foreach(test_suffix
3839
"multisend"
@@ -45,19 +46,26 @@ foreach(data_dir "ring" "ring_gap")
4546
file(COPY
4647
"${CMAKE_CURRENT_SOURCE_DIR}/${data_dir}/out.dat.ref"
4748
DESTINATION
48-
"${CMAKE_CURRENT_SOURCE_DIR}/${data_dir}_${test_suffix}/")
49+
"${CMAKE_CURRENT_BINARY_DIR}/${data_dir}_${test_suffix}/")
4950
endforeach()
5051
endforeach()
5152

53+
# base tests : ring, ring with gap and ring duplication
54+
foreach(data_dir "ring" "ring_gap" "ring_duplicate")
55+
file(COPY
56+
"${CMAKE_CURRENT_SOURCE_DIR}/${data_dir}/out.dat.ref"
57+
DESTINATION
58+
"${CMAKE_CURRENT_BINARY_DIR}/${data_dir}/")
59+
endforeach()
60+
61+
# test for small spike buffer
5262
file(COPY
5363
"${CMAKE_CURRENT_SOURCE_DIR}/ring/out.dat.ref"
5464
DESTINATION
55-
"${CMAKE_CURRENT_SOURCE_DIR}/ring_spike_buffer/")
56-
57-
file(GLOB INPUT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/ring/*.dat")
65+
"${CMAKE_CURRENT_BINARY_DIR}/ring_spike_buffer/")
5866

5967
# Configure test scripts
60-
foreach(args_line ${TEST_CASES_WITH_ARGS})
68+
foreach(args_line ${TEST_CASES})
6169
string(REPLACE "!"
6270
";"
6371
string_line
@@ -77,7 +85,7 @@ foreach(args_line ${TEST_CASES_WITH_ARGS})
7785
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}")
7886
endforeach()
7987

80-
foreach(args_line ${NEGATIVE_TEST_CASES_WITH_ARGS})
88+
foreach(args_line ${NEGATIVE_TEST_CASES})
8189
string(REPLACE "!"
8290
";"
8391
string_line

tests/integration/integration_test.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ then
2828
exit 1
2929
fi
3030

31-
diff -w out.dat @CMAKE_CURRENT_SOURCE_DIR@/@SIM_NAME@/out.dat.ref > diff.dat 2>&1
31+
diff -w out.dat @CMAKE_BINARY_DIR@/tests/integration/@SIM_NAME@/out.dat.ref > diff.dat 2>&1
3232

3333
if [ -s diff.dat ]
3434
then

tests/integration/negative_integration_test.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ then
3131
fi
3232

3333
sort -k 1n,1n -k 2n,2n out.dat > sort_out.dat
34-
diff -w sort_out.dat @CMAKE_CURRENT_SOURCE_DIR@/@SIM_NAME@/out.dat.ref > diff.dat 2>&1
34+
diff -w sort_out.dat @CMAKE_BINARY_DIR@/tests/integration/@SIM_NAME@/out.dat.ref > diff.dat 2>&1
3535

3636
if [ -s diff.dat ]
3737
then

0 commit comments

Comments
 (0)