aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-07-02 10:53:55 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-07-02 10:53:55 -0400
commit5803dc0fdb911a67ad9ca1ef9600edc58331d55a (patch)
tree0289621a8a98b3dd91a7d9b0e35ec62b5c160e24 /tests
parent8e0934853a374eb340ee0dd96fd21a3d7c74183d (diff)
downloadsplitfits-5803dc0fdb911a67ad9ca1ef9600edc58331d55a.tar.gz
Add basic test framework and a few tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test_split.sh35
-rw-r--r--tests/test_usage.sh9
2 files changed, 44 insertions, 0 deletions
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 $?
+}