"Fossies" - the Fresh Open Source Software Archive

Member "gnuastro-0.9/tests/Makefile.am" (11 Apr 2019, 10215 Bytes) of package /linux/privat/gnuastro-0.9.tar.lz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "Makefile.am": 0.8_vs_0.9.

    1 ## Process this file with automake to produce Makefile.inx
    2 ##
    3 ## Original author:
    4 ##     Mohammad Akhlaghi <mohammad@akhlaghi.org>
    5 ## Contributing author(s):
    6 ## Copyright (C) 2015-2019, Free Software Foundation, Inc.
    7 ##
    8 ## Gnuastro is free software: you can redistribute it and/or modify it
    9 ## under the terms of the GNU General Public License as published by
   10 ## the Free Software Foundation, either version 3 of the License, or
   11 ## (at your option) any later version.
   12 ##
   13 ## Gnuastro is distributed in the hope that it will be useful, but
   14 ## WITHOUT ANY WARRANTY; without even the implied warranty of
   15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   16 ## General Public License for more details.
   17 ##
   18 ## You should have received a copy of the GNU General Public License
   19 ## along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
   20 
   21 
   22 
   23 
   24 
   25 ## Translate conditions that came from `./configure' into variables that can
   26 ## be used here. This includes the programs and teh dependencies of the
   27 ## checks.
   28 ##
   29 ## Dependency structure
   30 ## ====================
   31 ##
   32 ## The tests depend on each other. One way to fix this is to call them in
   33 ## the order that their dependence is satisfied. But that is prone to
   34 ## errors and a lot of problem. The user also not want to build all the
   35 ## programs. Also, Make allows us to work with multiple threads (with
   36 ## `-jN') and in that case, it is vital to define the dependencies.
   37 ##
   38 ## The output of all the tests that should be used (is recognized by
   39 ## Automake and will not mess the system) is the name of the test file
   40 ## appended by a `.log'. It contains the output of the program on standard
   41 ## output and error. THIS IS IMPORTANT: So even if the program fails, the
   42 ## .log file is created. The check if the input for a test exists or not
   43 ## should be checked in the test that depends on it, it can't be done here
   44 ## in the Makefile.
   45 if COND_CHECK_WITH_VALGRIND
   46   MAYBE_CHECK_WITH_PROGRAM = "valgrind"
   47 endif
   48 if COND_HASGHOSTSCRIPT
   49   MAYBE_HASGHOSTSCRIPT = "yes"
   50 endif
   51 if COND_HASLIBJPEG
   52   MAYBE_HASLIBJPEG = "yes"
   53 endif
   54 if COND_HASCXX
   55   MAYBE_CXX_PROGS    = versioncxx
   56   MAYBE_CXX_TESTS    = lib/versioncxx.sh
   57   versioncxx_SOURCES = lib/versioncxx.cpp
   58 endif
   59 if COND_ARITHMETIC
   60   MAYBE_ARITHMETIC_TESTS = arithmetic/snimage.sh arithmetic/onlynumbers.sh \
   61   arithmetic/where.sh arithmetic/or.sh arithmetic/connected-components.sh
   62 
   63   arithmetic/onlynumbers.sh: prepconf.sh.log
   64   arithmetic/connected-components.sh: noisechisel/noisechisel.sh.log
   65   arithmetic/snimage.sh: noisechisel/noisechisel.sh.log
   66   arithmetic/where.sh: noisechisel/noisechisel.sh.log
   67   arithmetic/or.sh: segment/segment.sh.log
   68 endif
   69 if COND_BUILDPROG
   70   MAYBE_BUILDPROG_TESTS = buildprog/simpleio.sh
   71 
   72   buildprog/simpleio.sh: mkprof/mosaic1.sh.log
   73 endif
   74 if COND_CONVERTT
   75   MAYBE_CONVERTT_TESTS = convertt/fitstotxt.sh convertt/fitstojpeg.sh	\
   76   convertt/blankch.sh convertt/jpegtotxt.sh convertt/fitstojpegcmyk.sh	\
   77   convertt/jpegtofits.sh convertt/fitstopdf.sh
   78 
   79   convertt/fitstotxt.sh: mkprof/mosaic1.sh.log
   80   convertt/fitstojpeg.sh: mkprof/mosaic1.sh.log
   81   convertt/blankch.sh: mkprof/mosaic1.sh.log
   82   convertt/jpegtotxt.sh: convertt/fitstojpeg.sh.log
   83   convertt/fitstojpegcmyk.sh: mkprof/mosaic1.sh.log
   84   convertt/jpegtofits.sh: convertt/blankch.sh.log
   85   convertt/fitstopdf.sh: crop/section.sh.log
   86 endif
   87 if COND_CONVOLVE
   88   MAYBE_CONVOLVE_TESTS = convolve/spatial.sh convolve/frequency.sh
   89 
   90   convolve/spatial.sh: mkprof/mosaic1.sh.log
   91   convolve/frequency.sh: mkprof/mosaic1.sh.log
   92 endif
   93 if COND_COSMICCAL
   94   MAYBE_COSMICCAL_TESTS = cosmiccal/simpletest.sh
   95 
   96   cosmiccal/simpletest.sh: prepconf.sh.log
   97 endif
   98 if COND_CROP
   99   MAYBE_CROP_TESTS = crop/imgcat.sh crop/wcscat.sh crop/imgcenter.sh	\
  100   crop/imgcenternoblank.sh crop/section.sh crop/wcscenter.sh		\
  101   crop/imgpolygon.sh crop/imgoutpolygon.sh crop/wcspolygon.sh
  102 
  103   crop/imgcat.sh: mkprof/mosaic1.sh.log
  104   crop/wcscat.sh: mkprof/mosaic1.sh.log mkprof/mosaic2.sh.log     \
  105                   mkprof/mosaic3.sh.log mkprof/mosaic4.sh.log
  106   crop/imgcenter.sh: mkprof/mosaic1.sh.log
  107   crop/imgcenternoblank.sh: mkprof/mosaic1.sh.log
  108   crop/section.sh: mkprof/mosaic1.sh.log
  109   crop/wcscenter.sh: mkprof/mosaic1.sh.log mkprof/mosaic2.sh.log      \
  110                      mkprof/mosaic3.sh.log mkprof/mosaic4.sh.log
  111   crop/imgpolygon.sh: mkprof/mosaic1.sh.log
  112   crop/imgoutpolygon.sh: mkprof/mosaic1.sh.log
  113   crop/wcspolygon.sh: mkprof/mosaic1.sh.log mkprof/mosaic2.sh.log \
  114                       mkprof/mosaic3.sh.log mkprof/mosaic4.sh.log
  115 endif
  116 if COND_FITS
  117   MAYBE_FITS_TESTS = fits/write.sh fits/print.sh fits/update.sh	\
  118   fits/delete.sh fits/copyhdu.sh
  119 
  120   fits/write.sh: mkprof/mosaic1.sh.log
  121   fits/print.sh: fits/write.sh.log
  122   fits/update.sh: fits/write.sh.log
  123   fits/delete.sh: fits/write.sh.log
  124   fits/copyhdu.sh: fits/write.sh.log mkprof/mosaic2.sh.log
  125 endif
  126 if COND_MATCH
  127   MAYBE_MATCH_TESTS = match/positions.sh match/merged-cols.sh
  128 
  129   match/positions.sh: prepconf.sh.log
  130   match/merged-cols.sh: prepconf.sh.log
  131 endif
  132 if COND_MKCATALOG
  133   MAYBE_MKCATALOG_TESTS = mkcatalog/detections.sh        \
  134   mkcatalog/objects-clumps.sh mkcatalog/aperturephot.sh
  135 
  136   mkcatalog/objects-clumps.sh: segment/segment.sh.log
  137   mkcatalog/detections.sh: arithmetic/connected-components.sh.log
  138   mkcatalog/aperturephot.sh: noisechisel/noisechisel.sh.log          \
  139                              mkprof/clearcanvas.sh.log
  140 endif
  141 if COND_MKNOISE
  142   MAYBE_MKNOISE_TESTS = mknoise/addnoise.sh
  143 
  144   mknoise/addnoise.sh: warp/warp_scale.sh.log
  145 endif
  146 if COND_MKPROF
  147   MAYBE_MKPROF_TESTS = mkprof/mosaic1.sh mkprof/mosaic2.sh	\
  148   mkprof/mosaic3.sh mkprof/mosaic4.sh mkprof/radeccat.sh	\
  149   mkprof/ellipticalmasks.sh mkprof/clearcanvas.sh
  150 
  151   mkprof/mosaic1.sh: prepconf.sh.log
  152   mkprof/mosaic2.sh: prepconf.sh.log
  153   mkprof/mosaic3.sh: prepconf.sh.log
  154   mkprof/mosaic4.sh: prepconf.sh.log
  155   mkprof/radeccat.sh: prepconf.sh.log
  156   mkprof/ellipticalmasks.sh: mknoise/addnoise.sh.log
  157   mkprof/clearcanvas.sh: mknoise/addnoise.sh.log
  158 endif
  159 if COND_NOISECHISEL
  160   MAYBE_NOISECHISEL_TESTS = noisechisel/noisechisel.sh
  161 
  162   noisechisel/noisechisel.sh: mknoise/addnoise.sh.log
  163 endif
  164 if COND_SEGMENT
  165   MAYBE_SEGMENT_TESTS = segment/segment.sh
  166 
  167   segment/segment.sh: noisechisel/noisechisel.sh.log
  168 endif
  169 if COND_STATISTICS
  170   MAYBE_STATISTICS_TESTS = statistics/basicstats.sh statistics/estimate_sky.sh \
  171                            statistics/from-stdin.sh
  172 
  173   statistics/basicstats.sh: mknoise/addnoise.sh.log
  174   statistics/estimate_sky.sh: mknoise/addnoise.sh.log
  175   statistics/from-stdin.sh: prepconf.sh.log
  176 endif
  177 if COND_TABLE
  178   MAYBE_TABLE_TESTS = table/txt-to-fits-binary.sh		\
  179   table/fits-binary-to-txt.sh table/txt-to-fits-ascii.sh	\
  180   table/fits-ascii-to-txt.sh
  181 
  182   table/txt-to-fits-binary.sh: prepconf.sh.log
  183   table/fits-binary-to-txt.sh: table/txt-to-fits-binary.sh.log
  184   table/txt-to-fits-ascii.sh: prepconf.sh.log
  185   table/fits-ascii-to-txt.sh: table/txt-to-fits-ascii.sh.log
  186 endif
  187 if COND_WARP
  188   MAYBE_WARP_TESTS = warp/warp_scale.sh warp/homographic.sh
  189 
  190   warp/warp_scale.sh: convolve/spatial.sh.log
  191   warp/homographic.sh: convolve/spatial.sh.log
  192 endif
  193 
  194 # Script tests.
  195 SCRIPT_TESTS = script/list-by-night.sh
  196 
  197 # We want to have several FITS files as input for this script.
  198 script/list-by-night.sh: mkcatalog/aperturephot.sh.log
  199 
  200 
  201 
  202 
  203 # Environment variables for the test scripts.
  204 AM_TESTS_ENVIRONMENT =                                   \
  205 export mkdir_p="$(MKDIR_P)";                             \
  206 export topsrc=$(top_srcdir);                             \
  207 export topbuild=$(top_builddir);                         \
  208 export haslibjpeg=$(MAYBE_HASLIBJPEG);                   \
  209 export hasghostscript=$(MAYBE_HASGHOSTSCRIPT);           \
  210 export check_with_program=$(MAYBE_CHECK_WITH_PROGRAM);
  211 
  212 
  213 
  214 
  215 
  216 # Library checks
  217 # ==============
  218 #
  219 # The Gnuastro library is checked by compiling programs and linking them
  220 # with the library. As described in the last paragraph of the "Scripts
  221 # based test suites" section of the Automake manual, all targets specified
  222 # by `check_PROGRAMS' are compiled prior to actually running the targets of
  223 # `TESTS'. So they do not need to be specified as any dependency, they will
  224 # be present when the `.sh' based tests are run.
  225 
  226 # The `gnuastro/config.h' (needed by Gnuastro's library) is built by
  227 # `../lib/Makefile.am' and is only meant for outside users (to be tested
  228 # here). Thus (unlike the programs, which use `config.h') we need to add
  229 # the top build directory to the include search directories (`-I').
  230 AM_LDFLAGS = -L\$(top_builddir)/lib
  231 AM_CPPFLAGS = -I\$(top_srcdir)/lib -I\$(top_builddir)/lib
  232 
  233 # Rest of library check settings.
  234 LDADD = -lgnuastro
  235 check_PROGRAMS = multithread $(MAYBE_CXX_PROGS)
  236 multithread_SOURCES = lib/multithread.c
  237 lib/multithread.sh: mkprof/mosaic1.sh.log
  238 
  239 
  240 
  241 
  242 
  243 # Final Tests
  244 # ===========
  245 TESTS = prepconf.sh lib/multithread.sh $(MAYBE_CXX_TESTS)                  \
  246   $(MAYBE_ARITHMETIC_TESTS) $(MAYBE_BUILDPROG_TESTS)                       \
  247   $(MAYBE_CONVERTT_TESTS) $(MAYBE_CONVOLVE_TESTS) $(MAYBE_COSMICCAL_TESTS) \
  248   $(MAYBE_CROP_TESTS) $(MAYBE_FITS_TESTS) $(MAYBE_MATCH_TESTS)             \
  249   $(MAYBE_MKCATALOG_TESTS) $(MAYBE_MKNOISE_TESTS) $(MAYBE_MKPROF_TESTS)    \
  250   $(MAYBE_NOISECHISEL_TESTS) $(MAYBE_SEGMENT_TESTS)                        \
  251   $(MAYBE_STATISTICS_TESTS) $(MAYBE_SUBTRACTSKY_TESTS)                     \
  252   $(MAYBE_TABLE_TESTS) $(MAYBE_WARP_TESTS) $(SCRIPT_TESTS)
  253 
  254 
  255 
  256 
  257 
  258 # Files to distribute along with the tests.
  259 EXTRA_DIST = $(TESTS) during-dev.sh buildprog/simpleio.c crop/cat.txt     \
  260   match/positions-1.txt match/positions-2.txt mkprof/mkprofcat1.txt       \
  261   mkprof/ellipticalmasks.txt mkprof/clearcanvas.txt mkprof/mkprofcat2.txt \
  262   mkprof/mkprofcat3.txt mkprof/mkprofcat4.txt mkprof/radeccat.txt         \
  263   statistics/stdin-input.txt table/table.txt
  264 
  265 
  266 
  267 
  268 
  269 # Files that must be cleaned with `make clean'.
  270 CLEANFILES = *.log *.txt *.jpg *.fits *.pdf *.eps simpleio
  271 
  272 
  273 
  274 
  275 
  276 # CLEANFILES is only for files, not directories. Therefore we are using
  277 # Automake's extending rules to clean the temporary `.gnuastro' directory
  278 # that was built by the `prepconf.sh' scripot. See "Extending Automake
  279 # rules", and the "What Gets Cleaned" sections of the Automake manual.
  280 clean-local:; rm -rf .gnuastro