From 5dd87260434756f3c974a6c75d373645d84f7b30 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 2 Jul 2020 12:37:28 -0400 Subject: Break up configuration from test script --- CMakeLists.txt | 3 ++- test.sh | 8 ++------ test_config.sh | 6 ++++++ 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 test_config.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f3a91d..db56622 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,9 @@ set(CMAKE_C_STANDARD 99) add_executable(splitfits splitfits.c) +file(GLOB TEST_RUNNER "test*.sh") +file(COPY ${TEST_RUNNER} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(GLOB TEST_FRAMEWORK "tests") -file(COPY "test.sh" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY ${TEST_FRAMEWORK} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) add_custom_target(check "${CMAKE_CURRENT_BINARY_DIR}/test.sh") diff --git a/test.sh b/test.sh index 48216ff..99a78de 100755 --- a/test.sh +++ b/test.sh @@ -2,12 +2,8 @@ set -o pipefail RTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -test_program="${RTDIR}/splitfits" -test_program_version="$(git describe --always --tags --long)" -test_data="${RTDIR}/data" -test_data_remote=https://nx.astroconda.org/repository -test_data_remote_auth=${test_data_remote_auth:-} -test_data_upload="generic/spb-splitfits/${test_program_version}" + +source "${RTDIR}"/test_config.sh get_data_exists() { local url diff --git a/test_config.sh b/test_config.sh new file mode 100644 index 0000000..da541b3 --- /dev/null +++ b/test_config.sh @@ -0,0 +1,6 @@ +test_program="${RTDIR}/splitfits" +test_program_version="$(git describe --always --tags --long)" +test_data="${RTDIR}/data" +test_data_remote=https://nx.astroconda.org/repository +test_data_remote_auth=${test_data_remote_auth:-} +test_data_upload="generic/spb-splitfits/${test_program_version}" -- cgit