From 5803dc0fdb911a67ad9ca1ef9600edc58331d55a Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 2 Jul 2020 10:53:55 -0400 Subject: Add basic test framework and a few tests --- tests/test_split.sh | 35 +++++++++++++++++++++++++++++++++++ tests/test_usage.sh | 9 +++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/test_split.sh create mode 100644 tests/test_usage.sh (limited to 'tests') diff --git a/tests/test_split.sh b/tests/test_split.sh new file mode 100644 index 0000000..141e320 --- /dev/null +++ b/tests/test_split.sh @@ -0,0 +1,35 @@ +test_splitfits_data1() { + local datafile + local retval + + retval=0 + datafile=$(get_data generic/fits/sample.fits) + [[ ! -f ${datafile} ]] && return 1 + + if ! ${test_program} -o ${test_case} ${datafile}; then + return 1 + fi + + set +x + return $retval +} + +test_splitfits_combine_data1() { + local datafile + local retval + + retval=0 + datafile=$(get_data generic/fits/sample.fits) + [[ ! -f ${datafile} ]] && return 1 + + if ! ${test_program} -o ${test_case} ${datafile}; then + return 1 + fi + + if ! ${test_program} -c ${test_case}/$(basename ${datafile}).part_map; then + return 1 + fi + + set +x + return $retval +} diff --git a/tests/test_usage.sh b/tests/test_usage.sh new file mode 100644 index 0000000..2a257d9 --- /dev/null +++ b/tests/test_usage.sh @@ -0,0 +1,9 @@ +test_splitfits_usage_longopt() { + ${test_program} --help + return $? +} + +test_splitfits_usage_shortopt() { + ${test_program} -h + return $? +} -- cgit