xref: /netbsd-src/external/lgpl3/mpfr/dist/tests/Makefile.am (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1# Copyright 2000-2016 Free Software Foundation, Inc.
2# This Makefile.am is free software; the Free Software Foundation
3# gives unlimited permission to copy and/or distribute it,
4# with or without modifications, as long as this notice is preserved.
5
6# This program is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
8# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
9# PARTICULAR PURPOSE.
10
11
12AUTOMAKE_OPTIONS = 1.6 gnu
13
14check_PROGRAMS = tversion tinternals tinits tisqrt tsgn tcheck		\
15     tisnan texceptions tset_exp tset mpf_compat mpfr_compat		\
16     reuse tabs tacos tacosh tadd tadd1sp tadd_d tadd_ui tagm		\
17     tai tasin tasinh tatan tatanh taway tbuildopt tcan_round		\
18     tcbrt tcmp tcmp2 tcmp_d tcmp_ld tcmp_ui tcmpabs			\
19     tcomparisons tconst_catalan tconst_euler tconst_log2		\
20     tconst_pi tcopysign tcos tcosh tcot tcoth tcsc tcsch		\
21     td_div td_sub tdigamma tdim tdiv tdiv_d tdiv_ui teint teq		\
22     terf texp texp10 texp2 texpm1 tfactorial tfits tfma tfmod		\
23     tfms tfprintf tfrac tfrexp tgamma tget_flt tget_d tget_d_2exp 	\
24     tget_f tget_ld_2exp tget_set_d64 tget_sj tget_str tget_z		\
25     tgmpop tgrandom thyperbolic thypot tinp_str tj0 tj1 tjn tl2b	\
26     tlgamma tli2 tlngamma tlog tlog10 tlog1p tlog2 tmin_prec		\
27     tminmax tmodf tmul tmul_2exp tmul_d tmul_ui tnext			\
28     tout_str toutimpl tpow tpow3 tpow_all tpow_z tprintf		\
29     trandom trec_sqrt tremquo trint troot tround_prec tsec		\
30     tsech tset_d tset_f tset_ld tset_q tset_si tset_sj			\
31     tset_str tset_z tset_z_exp tsi_op tsin tsin_cos tsinh		\
32     tsinh_cosh tsprintf tsqr tsqrt tsqrt_ui tstckintc tstdint tstrtofr	\
33     tsub tsub1sp tsub_d tsub_ui tsubnormal tsum tswap ttan		\
34     ttanh ttrunc tui_div tui_pow tui_sub turandom 	 		\
35     tvalist ty0 ty1 tyn tzeta tzeta_ui
36
37# Before Automake 1.13, we ran tversion at the beginning and at the end
38# of the tests, and output from tversion appeared at the same place as
39# the tests results (make output). With Automake 1.13+, the tests are
40# parallelized by default and their output is sent to log files instead
41# of the make output, so that the user could no longer see information
42# from tversion. To mimic the old behavior, we now output the contents
43# of the tversion log file if this file exists (i.e. if the Makefile
44# has been generated with Automake 1.13+).
45check:
46	cat tversion.log 2> /dev/null || true
47
48AM_CPPFLAGS = -DSRCDIR='"$(srcdir)"'
49
50EXTRA_DIST = tgeneric.c tgeneric_ui.c mpf_compat.h inp_str.data tmul.dat
51
52LDADD = libfrtests.la $(MPFR_LIBM) $(top_builddir)/src/libmpfr.la
53AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_builddir)/src
54
55# LOADLIBES (documented in the "GNU make" manual and equivalent to LDLIBS)
56# enables to compile a program foo.c in the test directory by simply doing
57# "make foo".
58# Warning! This is not guaranteed to work, as libtool is not used. In
59# particular, this may not work as expected under GNU/Linux if --with-gmp
60# has been used, unless the directory is in your $LD_LIBRARY_PATH.
61# Moreover, dependencies are not tracked. Thus you may want to run
62# "make tversion" (for instance) just before, to make sure that every
63# dependency has been rebuilt.
64LOADLIBES=$(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $(top_builddir)/tests/.libs/libfrtests.a $(top_builddir)/src/.libs/libmpfr.a $(LIBS) $(MPFR_LIBM)
65
66check_LTLIBRARIES = libfrtests.la
67libfrtests_la_SOURCES = mpfr-test.h memory.c rnd_mode.c tests.c cmp_str.c random2.c
68
69$(top_builddir)/src/libmpfr.la:
70	cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) libmpfr.la
71
72TESTS = $(check_PROGRAMS)
73TESTS_ENVIRONMENT = MPFR_QUIET=1 $(VALGRIND)
74
75# The -no-install option prevents libtool from generating wrapper scripts
76# for the tests.
77# This is useful to easily run the test scripts under valgrind or gdb.
78# See discussion http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28033
79# http://article.gmane.org/gmane.comp.lib.gnulib.bugs/28140 in particular.
80#
81# The -L$(top_builddir)/src/.libs option is necessary for some platforms,
82# such as HP-UX, when --with-gmp or --with-gmp-lib is used and an old MPFR
83# library is already installed in the corresponding lib directory: its
84# purpose is to make sure that the local .libs comes first in the library
85# search path (otherwise the tests are linked against the old MPFR library
86# by the LINK command -- see the generated Makefile). See:
87#   https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00042.html
88#   https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00043.html
89#   https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00044.html
90#   https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00066.html
91#   https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00065.html
92# and
93#   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9728
94#
95AM_LDFLAGS = -no-install -L$(top_builddir)/src/.libs
96