[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 91c4fca 2/2: astscript-sort-by-night: make che
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 91c4fca 2/2: astscript-sort-by-night: make check tests done on certain files |
Date: |
Mon, 22 Mar 2021 15:06:07 -0400 (EDT) |
branch: master
commit 91c4fcad080106707d7112457dac535eda9b25e7
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
astscript-sort-by-night: make check tests done on certain files
Until now, the tests of the 'astscript-sort-by-night' script would run on
all the FITS files in the tests directory! As a result, when a problematic
file from a previously failed test existed, it would crash!
With this commit, instead of running blindly on all '*.fits' files, the
test will only run on files that have been successfully made by the
prerequisites of this test.
---
tests/script/list-by-night.sh | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/tests/script/list-by-night.sh b/tests/script/list-by-night.sh
index 4871eeb..3333a8e 100755
--- a/tests/script/list-by-night.sh
+++ b/tests/script/list-by-night.sh
@@ -16,24 +16,24 @@
+
# Preliminaries
# =============
#
# Set the variables (The executable is in the build tree). Do the
# basic checks to see if the executable is made or if the defaults
# file exists (basicchecks.sh is in the source tree).
-#
-# We will be adding noise to two images: the warped (smaller) and unwarped
-# (larger) mock images. The warped one will be used by programs that don't
-# care about the size of the image, but the larger one will be used by
-# those that do: for example SubtractSky and NoiseChisel will be better
-# tested on a larger image.
prog=sort-by-night
dep1=fits
dep2=table
dep1name=../bin/$dep1/ast$dep1
dep2name=../bin/$dep2/ast$dep2
execname=../bin/script/astscript-$prog
+fits1name=clearcanvas.fits
+fits2name=aperturephot.fits
+fits3name=convolve_spatial.fits
+fits4name=convolve_spatial_noised.fits
+fits5name=convolve_spatial_noised_detected.fits
@@ -47,9 +47,16 @@ execname=../bin/script/astscript-$prog
#
# - The executable script was not made.
# - The programs it use weren't made.
+# - The input data weren't made.
if [ ! -f $execname ]; then echo "$execname doesn't exist."; exit 77; fi
if [ ! -f $dep1name ]; then echo "$dep1name doesn't exist."; exit 77; fi
if [ ! -f $dep2name ]; then echo "$dep2name doesn't exist."; exit 77; fi
+if [ ! -f $fits1name ]; then echo "$dep1name doesn't exist."; exit 77; fi
+if [ ! -f $fits2name ]; then echo "$dep1name doesn't exist."; exit 77; fi
+if [ ! -f $fits3name ]; then echo "$dep1name doesn't exist."; exit 77; fi
+if [ ! -f $fits4name ]; then echo "$dep1name doesn't exist."; exit 77; fi
+if [ ! -f $fits5name ]; then echo "$dep1name doesn't exist."; exit 77; fi
+
@@ -74,4 +81,5 @@ ln -sf $dep2name ast$dep2
# Since we want the script to recognize the programs that it will use from
# this same build of Gnuastro, we'll add the current directory to PATH.
export PATH="./:$PATH"
-$check_with_program $execname *.fits
+$check_with_program $execname $fits1name $fits2name $fits3name \
+ $fits4name $fits5name