diff options
author | Thomas White <taw@physics.org> | 2018-03-22 15:04:33 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-03-22 15:32:02 +0100 |
commit | bd5254b087bf38da5bd1aead7e32af508c0b12b4 (patch) | |
tree | 959a0d69bf020c1b8bdcde24e79540894c555fda /tests | |
parent | 4a244ff26c30c5500615b81acacab9d2080fcd11 (diff) |
Compile and run tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 78 | ||||
-rwxr-xr-x | tests/first_merge_check | 5 | ||||
-rwxr-xr-x | tests/fourth_merge_check | 5 | ||||
-rwxr-xr-x | tests/partialator_merge_check_1 | 5 | ||||
-rwxr-xr-x | tests/partialator_merge_check_2 | 5 | ||||
-rwxr-xr-x | tests/partialator_merge_check_3 | 5 | ||||
-rwxr-xr-x | tests/second_merge_check | 5 | ||||
-rwxr-xr-x | tests/third_merge_check | 5 |
8 files changed, 106 insertions, 7 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..1ec0bcbb --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,78 @@ +add_test(first_merge_check ${CMAKE_CURRENT_SOURCE_DIR}/first_merge_check) +add_test(second_merge_check ${CMAKE_CURRENT_SOURCE_DIR}/second_merge_check) +add_test(third_merge_check ${CMAKE_CURRENT_SOURCE_DIR}/third_merge_check) +add_test(fourth_merge_check ${CMAKE_CURRENT_SOURCE_DIR}/fourth_merge_check) +add_test(partialator_merge_check_1 ${CMAKE_CURRENT_SOURCE_DIR}/partialator_merge_check_1) +add_test(partialator_merge_check_2 ${CMAKE_CURRENT_SOURCE_DIR}/partialator_merge_check_2) +add_test(partialator_merge_check_3 ${CMAKE_CURRENT_SOURCE_DIR}/partialator_merge_check_3) + +add_executable(ambi_check ambi_check.c) +target_include_directories(ambi_check PRIVATE ${COMMON_INCLUDES}) +target_link_libraries(ambi_check ${COMMON_LIBRARIES}) +add_test(ambi_check ambi_check) + +add_executable(cell_check cell_check.c) +target_include_directories(cell_check PRIVATE ${COMMON_INCLUDES}) +target_link_libraries(cell_check ${COMMON_LIBRARIES}) +add_test(cell_check cell_check) + +add_executable(centering_check centering_check.c) +target_include_directories(centering_check PRIVATE ${COMMON_INCLUDES}) +target_link_libraries(centering_check ${COMMON_LIBRARIES}) +add_test(centering_check centering_check) + +add_executable(integration_check integration_check.c) +target_include_directories(integration_check PRIVATE ${COMMON_INCLUDES}) +target_link_libraries(integration_check PRIVATE ${COMMON_LIBRARIES}) +if (CURSES_FOUND) + target_include_directories(integration_check PRIVATE ${CURSES_INCLUDE_DIRS}) + target_link_libraries(integration_check PRIVATE ${CURSES_LIBRARIES}) +endif (CURSES_FOUND) +add_test(integration_check integration_check) + +add_executable(list_check list_check.c) +target_include_directories(list_check PRIVATE ${COMMON_INCLUDES}) +target_link_libraries(list_check ${COMMON_LIBRARIES}) +add_test(list_check list_check) + +add_executable(prediction_gradient_check prediction_gradient_check.c) +target_include_directories(prediction_gradient_check PRIVATE ${COMMON_INCLUDES}) +target_link_libraries(prediction_gradient_check ${COMMON_LIBRARIES}) +add_test(prediction_gradient_check prediction_gradient_check) + +add_executable(prof2d_check prof2d_check.c) +target_include_directories(prof2d_check PRIVATE ${COMMON_INCLUDES}) +target_link_libraries(prof2d_check PRIVATE ${COMMON_LIBRARIES}) +if (CURSES_FOUND) + target_include_directories(prof2d_check PRIVATE ${CURSES_INCLUDE_DIRS}) + target_link_libraries(prof2d_check PRIVATE ${CURSES_LIBRARIES}) +endif (CURSES_FOUND) +add_test(prof2d_check prof2d_check) + +add_executable(pr_p_gradient_check pr_p_gradient_check.c ../src/post-refinement.c) +target_include_directories(pr_p_gradient_check PRIVATE ${COMMON_INCLUDES}) +target_link_libraries(pr_p_gradient_check ${COMMON_LIBRARIES}) +add_test(pr_p_gradient_check pr_p_gradient_check) + +add_executable(ring_check ring_check.c) +target_include_directories(ring_check PRIVATE ${COMMON_INCLUDES}) +target_link_libraries(ring_check ${COMMON_LIBRARIES}) +add_test(ring_check ring_check) + +add_executable(symmetry_check symmetry_check.c) +target_include_directories(symmetry_check PRIVATE ${COMMON_INCLUDES}) +target_link_libraries(symmetry_check ${COMMON_LIBRARIES}) +add_test(symmetry_check symmetry_check) + +add_executable(transformation_check transformation_check.c) +target_include_directories(transformation_check PRIVATE ${COMMON_INCLUDES}) +target_link_libraries(transformation_check ${COMMON_LIBRARIES}) +add_test(transformation_check transformation_check) + +if (HAVE_OPENCL) + add_executable(gpu_sim_check gpu_sim_check.c ../src/diffraction.c ../src/diffraction-gpu.c) + target_include_directories(gpu_sim_check PRIVATE ${COMMON_INCLUDES}) + target_link_libraries(gpu_sim_check ${COMMON_LIBRARIES}) + add_test(gpu_sim_check gpu_sim_check) +endif (HAVE_OPENCL) + diff --git a/tests/first_merge_check b/tests/first_merge_check index 17b9f87b..2aeed567 100755 --- a/tests/first_merge_check +++ b/tests/first_merge_check @@ -41,7 +41,10 @@ Symmetry: 1 1 0 0 150.00 - 35.36 2 EOF -src/process_hkl -i first_merge_check.stream -o first_merge_check.hkl --no-polarisation +process_hkl -i first_merge_check.stream -o first_merge_check.hkl --no-polarisation +if [ $? -ne 0]; then + exit 1; +fi ex -c '/End of reflections/ .,$d x' first_merge_check.hkl diff --git a/tests/fourth_merge_check b/tests/fourth_merge_check index b0935bc9..418ce367 100755 --- a/tests/fourth_merge_check +++ b/tests/fourth_merge_check @@ -25,7 +25,10 @@ Symmetry: 1 h k l I phase sigma(I) nmeas EOF -src/process_hkl -i fourth_merge_check.stream -o fourth_merge_check.hkl --no-polarisation +process_hkl -i fourth_merge_check.stream -o fourth_merge_check.hkl --no-polarisation +if [ $? -ne 0 ]; then + exit 1; +fi ex -c '/End of reflections/ .,$d x' fourth_merge_check.hkl diff --git a/tests/partialator_merge_check_1 b/tests/partialator_merge_check_1 index d39c2009..2d888fd7 100755 --- a/tests/partialator_merge_check_1 +++ b/tests/partialator_merge_check_1 @@ -42,9 +42,12 @@ Symmetry: 1 1 0 0 150.00 - 35.36 2 EOF -src/partialator -i partialator_merge_check_1.stream \ +partialator -i partialator_merge_check_1.stream \ -o partialator_merge_check_1.hkl \ --model=unity --iterations=0 --no-scale --no-polarisation +if [ $? -ne 0 ]; then + exit 1 +fi ex -c '/End of reflections/ .,$d diff --git a/tests/partialator_merge_check_2 b/tests/partialator_merge_check_2 index 104f9fc4..249421e1 100755 --- a/tests/partialator_merge_check_2 +++ b/tests/partialator_merge_check_2 @@ -46,10 +46,13 @@ Symmetry: 1 19 0 0 75.00 - 0.00 2 EOF -src/partialator -i partialator_merge_check_2.stream \ +partialator -i partialator_merge_check_2.stream \ -o partialator_merge_check_2.hkl \ --model=unity --iterations=1 --no-polarisation \ --no-free +if [ $? -ne 0 ]; then + exit 1 +fi ex -c '/End of reflections/ .,$d diff --git a/tests/partialator_merge_check_3 b/tests/partialator_merge_check_3 index 08f9f481..1f6acf35 100755 --- a/tests/partialator_merge_check_3 +++ b/tests/partialator_merge_check_3 @@ -48,10 +48,13 @@ Symmetry: 4 20 0 0 75.00 - 0.00 2 EOF -src/partialator -i partialator_merge_check_3.stream \ +partialator -i partialator_merge_check_3.stream \ -o partialator_merge_check_3.hkl \ --model=unity --iterations=1 -y 4 --no-polarisation \ --no-free +if [ $? -ne 0 ]; then + exit 1 +fi ex -c '/End of reflections/ .,$d diff --git a/tests/second_merge_check b/tests/second_merge_check index 1283cb0a..2636ccdb 100755 --- a/tests/second_merge_check +++ b/tests/second_merge_check @@ -41,7 +41,10 @@ Symmetry: -1 1 0 0 150.00 - 35.36 2 EOF -src/process_hkl -y -1 -i second_merge_check.stream -o second_merge_check.hkl --no-polarisation +process_hkl -y -1 -i second_merge_check.stream -o second_merge_check.hkl --no-polarisation +if [ $? -ne 0 ]; then + exit 1; +fi ex -c '/End of reflections/ .,$d x' second_merge_check.hkl diff --git a/tests/third_merge_check b/tests/third_merge_check index d4f5f9ef..7daf708d 100755 --- a/tests/third_merge_check +++ b/tests/third_merge_check @@ -56,7 +56,10 @@ Symmetry: 1 1 0 0 133.33 - 27.22 3 EOF -src/process_hkl -i third_merge_check.stream -o third_merge_check.hkl --no-polarisation +process_hkl -i third_merge_check.stream -o third_merge_check.hkl --no-polarisation +if [ $? -ne 0 ]; then + exit 1; +fi ex -c '/End of reflections/ .,$d x' third_merge_check.hkl |