gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master e0f1e7c: make check: using printf instead of S


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master e0f1e7c: make check: using printf instead of SED in 1D convolution check
Date: Mon, 11 Oct 2021 06:10:45 -0400 (EDT)

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

    make check: using printf instead of SED in 1D convolution check
    
    Until now, to feed the 1D kernel into Convolve's 1D convolution feature on
    a test spectrum, we were using 'echo "1 3 10 3 1" | sed 's/ /\n/g''. But
    after the build of Gnuastro on macOS of CondaForge (after the new release
    0.16), I noticed that it crashed with this error:
    
        astconvolve: '1n3n10n3n1' couldn't be read as a number (element 1
        of first uncommented line)
        FAIL convolve/spectrum-1d.sh (exit status: 1)
    
    With this commit, to fix the problem, instead of the pipe above, we are
    simply using 'printf '1\n3\n10\n3\n1\n'' to avoid portability problems with
    SED on different OSs.
    
    This fix was implemented with the help of Sebastian Luna-Valero (while
    testing on CondaForge's automatic build [1]).
    
    This fixes bug #61329.
    
    [1] https://github.com/conda-forge/gnuastro-feedstock/pull/14
---
 NEWS                          | 16 ++++++++++++++++
 doc/announce-acknowledge.txt  |  1 +
 tests/convolve/spectrum-1d.sh |  3 +--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 4c6e317..2c407fd 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,22 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 Copyright (C) 2015-2021 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
+* Noteworthy changes in release X.XX (library XX.0.0) (YYYY-MM-DD) [stable]
+
+** New features
+
+** Removed features
+
+** Changed features
+
+** Bugs fixed
+  bug #61329: make check crash in macOS in convolve/spectrum-1d.sh, found
+              and fixed with the help of Sebastian Luna-Valero.
+
+
+
+
+
 * Noteworthy changes in release 0.16 (library 14.0.0) (2021-10-10) [stable]
 
 ** New features
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index 8e985e1..aa37c7a 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -1,5 +1,6 @@
 Alphabetically ordered list to acknowledge in the next release.
 
+Sebastian Luna-Valero
 
 
 
diff --git a/tests/convolve/spectrum-1d.sh b/tests/convolve/spectrum-1d.sh
index 4881836..32b4cb4 100755
--- a/tests/convolve/spectrum-1d.sh
+++ b/tests/convolve/spectrum-1d.sh
@@ -54,7 +54,6 @@ if [ ! -f $spec     ]; then echo "$spec does not exist.";  
exit 77; fi
 # 'check_with_program' can be something like Valgrind or an empty
 # string. Such programs will execute the command if present and help in
 # debugging when the developer doesn't have access to the user's system.
-echo "1 3 10 3 1" \
-    | sed 's/ /\n/g' \
+printf '1\n3\n10\n3\n1\n' \
     | $check_with_program $execname $spec --domain=spatial   \
                           --output=convolve_spectrum.txt



reply via email to

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