gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 9f67cdd8: Tests: LANG=C is set avoid floating


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 9f67cdd8: Tests: LANG=C is set avoid floating points with , in some systems
Date: Sun, 6 Mar 2022 17:54:00 -0500 (EST)

branch: master
commit 9f67cdd87bbad3f9506c73c40b50d95c1c5ee358
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Tests: LANG=C is set avoid floating points with , in some systems
    
    Until now, the outputs of some shell number substitutions would be printed
    in the local language of the host operating system. This would cause
    problems in languages that use a coma (,) instead of a point (.) for the
    floating point of numbers. This problem was introduced in the recently
    added tests for 'astscript-psf-create-make-stamp' and
    'astscript-psf-model-flux-factor' (where we read the center of the image
    and give it as a value in the 'make check' tests).
    
    With this commit, the 'tests/Makefile.am' now also exports 'LANG=C' to make
    sure that all the tests are run in the standard C environment, allowing the
    scripts to print the numbers with a (.) as floating point.
    
    This issue was found with the help of Manuel Sánchez-Benavente.
---
 bin/script/psf-model-flux-factor.in | 2 +-
 tests/Makefile.am                   | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/script/psf-model-flux-factor.in 
b/bin/script/psf-model-flux-factor.in
index 11513a2d..8fd9207d 100644
--- a/bin/script/psf-model-flux-factor.in
+++ b/bin/script/psf-model-flux-factor.in
@@ -338,7 +338,7 @@ else
     ncenter=$(echo $center | awk 'BEGIN{FS=","}END{print NF}')
     if [ x$ncenter != x2 ]; then
         cat <<EOF
-$scriptname: '--center' (or '-c') only take two values, but $ncenter were given
+$scriptname: '--center' (or '-c') only take two values, but $ncenter were 
given in '$center'
 EOF
         exit 1
     fi
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 70591a4d..c4b74b3e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -227,6 +227,7 @@ script/psf-model-scattered-light.sh: mkprof/mosaic2.sh.log
 
 # Environment variables for the test scripts.
 AM_TESTS_ENVIRONMENT = \
+export LANG=C; \
 export mkdir_p="$(MKDIR_P)"; \
 export progbdir=programs-built; \
 export topsrc=$(abs_top_srcdir); \



reply via email to

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