gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 1abef591 2/2: PSF-scripts: make check tests no


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 1abef591 2/2: PSF-scripts: make check tests now include tmpdir and output name
Date: Sat, 19 Mar 2022 15:39:23 -0400 (EDT)

branch: master
commit 1abef591a8f6b7a80d04251601ddaee6ea657872
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    PSF-scripts: make check tests now include tmpdir and output name
    
    Until now, in the recipes for 'make check' tests, no temporary directory or
    outputname was defined for them! This could potentially cause conflicts and
    make things hard to debug.
    
    With this commit, to be more clear, the test script for each PSF script now
    has a '--tmpdir' and '--output' option that use the name of the script as
    reference. This will help in debugging in case of errors.
    
    Also, I noticed that the indentation of some of the script wasn't correct
    (the options of the next lines should start after the '$execname' component
    (since this is the actual program being run!): the '$check_with_program' is
    usually empty (and will be replaced with 'valgrind' when the user
    configures Gnuastro with '--enable-check-with-valgrind'.
---
 tests/script/psf-scale-factor.sh |  4 ++--
 tests/script/psf-select-stars.sh | 16 +++++++++-------
 tests/script/psf-stamp.sh        |  5 ++++-
 tests/script/psf-subtract.sh     |  4 +++-
 tests/script/psf-unite.sh        |  4 +++-
 5 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/tests/script/psf-scale-factor.sh b/tests/script/psf-scale-factor.sh
index 413c1ec0..b403caf1 100755
--- a/tests/script/psf-scale-factor.sh
+++ b/tests/script/psf-scale-factor.sh
@@ -74,5 +74,5 @@ export PATH="$progbdir:$PATH"
 x=$($dep1name $fits1name -h1 | awk '/^NAXIS1/{print $3/2}')
 y=$($dep1name $fits1name -h1 | awk '/^NAXIS2/{print $3/2}')
 $check_with_program $execname $fits1name --center=$x,$y --mode=img \
-                                         --psf=$fits1name \
-                                         --normradii=5,10
+                              --psf=$fits1name --normradii=5,10 \
+                              --tmpdir=tmpdir-$prog
diff --git a/tests/script/psf-select-stars.sh b/tests/script/psf-select-stars.sh
index 039b9ad4..ceebba72 100755
--- a/tests/script/psf-select-stars.sh
+++ b/tests/script/psf-select-stars.sh
@@ -74,10 +74,12 @@ $check_with_program astmkcatalog $fits2name \
 
 # Test the script: selecting good stars
 $check_with_program $execname $fits1name --hdu=1 \
-                    --segmented=$fits2name \
-                    --catalog=$fits3name \
-                    --field=magnitude \
-                    --magnituderange=-17,-10 \
-                    --minaxisratio=0.85 \
-                    --mindistdeg=0.05 \
-                    --matchaperturedeg=0.5
+                              --segmented=$fits2name \
+                              --catalog=$fits3name \
+                              --field=magnitude \
+                              --magnituderange=-17,-10 \
+                              --minaxisratio=0.85 \
+                              --mindistdeg=0.05 \
+                              --matchaperturedeg=0.5 \
+                              --output=$prog.fits \
+                              --tmpdir=tmpdir-$prog
diff --git a/tests/script/psf-stamp.sh b/tests/script/psf-stamp.sh
index d19d0d11..fb9c7775 100755
--- a/tests/script/psf-stamp.sh
+++ b/tests/script/psf-stamp.sh
@@ -74,4 +74,7 @@ if [ ! -f $fits1name ]; then echo "$fits1name doesn't 
exist."; exit 77; fi
 export PATH="$progbdir:$PATH"
 x=$($dep2name $fits1name -h1 | awk '/^NAXIS1/{print $3/2}')
 y=$($dep2name $fits1name -h1 | awk '/^NAXIS2/{print $3/2}')
-$check_with_program $execname $fits1name --center=$x,$y --mode=img 
--stampwidth=100,100
+$check_with_program $execname $fits1name --center=$x,$y --mode=img \
+                              --stampwidth=100,100 \
+                              --output=$prog.fits \
+                              --tmpdir=tmpdir-$prog
diff --git a/tests/script/psf-subtract.sh b/tests/script/psf-subtract.sh
index ea16fadc..df390501 100755
--- a/tests/script/psf-subtract.sh
+++ b/tests/script/psf-subtract.sh
@@ -74,4 +74,6 @@ export PATH="$progbdir:$PATH"
 x=$($dep1name $fits1name -h1 | awk '/^NAXIS1/{print $3/2}')
 y=$($dep1name $fits1name -h1 | awk '/^NAXIS2/{print $3/2}')
 $check_with_program $execname $fits1name --center=$x,$y --mode=img \
-                                         --psf=$fits1name --scale=3.3
+                              --psf=$fits1name --scale=3.3 \
+                              --output=$prog.fits \
+                              --tmpdir=tmpdir-$prog
diff --git a/tests/script/psf-unite.sh b/tests/script/psf-unite.sh
index cb4fe4b5..fe7f686c 100755
--- a/tests/script/psf-unite.sh
+++ b/tests/script/psf-unite.sh
@@ -70,4 +70,6 @@ if [ ! -f $fits1name ]; then echo "$fits1name doesn't 
exist."; exit 77; fi
 # this same build of Gnuastro, we'll add the current directory to PATH.
 export PATH="$progbdir:$PATH"
 $check_with_program $execname $fits1name --inner=$fits1name \
-                              --scale=3.3 --radius=5
+                              --scale=3.3 --radius=5 \
+                              --output=$prog.fits \
+                              --tmpdir=tmpdir-$prog



reply via email to

[Prev in Thread] Current Thread [Next in Thread]