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