1# This is not actually a test of any of the programs, it just brings 2# in all the configuration files into a locally created .gnuastro 3# directory for all the tests to use. It is part of the GNU Astronomy 4# Utilities (Gnuastro). 5# 6# Original author: 7# Mohammad Akhlaghi <mohammad@akhlaghi.org> 8# Contributing author(s): 9# Copyright (C) 2016-2021, Free Software Foundation, Inc. 10# 11# Gnuastro is free software: you can redistribute it and/or modify it 12# under the terms of the GNU General Public License as published by the 13# Free Software Foundation, either version 3 of the License, or (at your 14# option) any later version. 15# 16# Gnuastro is distributed in the hope that it will be useful, but 17# WITHOUT ANY WARRANTY; without even the implied warranty of 18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19# General Public License for more details. 20# 21# You should have received a copy of the GNU General Public License 22# along with Gnuastro. If not, see <http://www.gnu.org/licenses/>. 23 24 25 26 27# Make the .gnuastro directory 28# ---------------------------- 29# 30# This directory will keep the default configuration files for all the 31# programs. If it already exists, delete it. 'mkdir_p' is the equivalent to 32# GNU's 'mkdir -p' which might not exist on some systems. It comes from 33# Autoconf's tests and is exported to the test shell scripts from the 34# 'tests/Makefile.am' file. 35$mkdir_p .gnuastro 36 37 38 39 40 41# Common options for all programs 42# ------------------------------- 43# 44# Copy the common options while adding the following optios only for make 45# check. 46# 47# - 'lastconfig' will make sure that the program stop searching for 48# configuration files after this one. 49# 50# - Log files are not necessary during tests, they are mainly used for 51# reporting extra information about successful tests. Failed messages 52# will be printed on the command-line not in a log-file. So to keep 53# this directory clean, we'll ask the programs to not generate any. 54cat > addedoptions.txt <<EOF 55 56 57# Added only for "make check": 58 lastconfig 1 59 log 0 60EOF 61cat $topsrc/bin/gnuastro.conf addedoptions.txt > .gnuastro/gnuastro.conf 62rm addedoptions.txt 63 64 65 66 67 68# Bring utility configuration files 69# --------------------------------- 70# 71# Each utility's configuration file is copied in the 'tests' directory for 72# easy readability. Note that some programs may need to build their 73# configuration files during compilation. Hence, their configuration files 74# are in the build directory, not the source directory. 75for prog in arithmetic buildprog convertt convolve cosmiccal crop fits \ 76 match mkcatalog mknoise mkprof noisechisel segment \ 77 statistics table warp 78do 79 if test -f $topsrc/bin/$prog/ast$prog.conf; then 80 ctopdir=$topsrc 81 else 82 ctopdir=$topbuild 83 fi 84 cp $ctopdir/bin/$prog/*.conf .gnuastro/ 85done 86