patches/mpfr/2.4.1/150-test-tmul.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Aug 02 18:28:10 2011 +0200 (2011-08-02)
changeset 2590 b64cfb67944e
permissions -rw-r--r--
scripts/functions: svn retrieval first tries the mirror for tarballs

The svn download helper looks for the local tarballs dir to see if it
can find a pre-downloaded tarball, and if it does not find it, does
the actual fetch to upstream via svn.

In the process, it does not even try to get a tarball from the local
mirror, which can be useful if the mirror has been pre-populated
manually (or with a previously downloaded tree).

Fake a tarball get with the standard tarball-download helper, but
without specifying any upstream URL, which makes the helper directly
try the LAN mirror.

Of course, if no mirror is specified, no URL wil be available, and
the standard svn retrieval will kick in.

Reported-by: ANDY KENNEDY <ANDY.KENNEDY@adtran.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 diff -up ./tests/Makefile.am.orig ./tests/Makefile.am
     2 --- ./tests/Makefile.am.orig	2009-07-28 16:28:55.377059021 +0300
     3 +++ ./tests/Makefile.am	2009-07-28 16:31:01.136810734 +0300
     4 @@ -20,7 +20,7 @@ check_PROGRAMS = tversion tinternals tin
     5  
     6  EXTRA_DIST = tgeneric.c tgeneric_ui.c mpf_compat.h inp_str.data tmul.dat
     7  
     8 -tmul_CPPFLAGS = -DMPFR_SRCDIR=$(srcdir)
     9 +tmul_CPPFLAGS = -DMPFR_SRCDIR=\"$(srcdir)\"
    10  
    11  LDADD = libfrtests.la $(MPFR_LIBM) $(top_builddir)/libmpfr.la
    12  INCLUDES = -I$(top_srcdir) -I$(top_builddir)
    13 diff -up ./tests/tmul.c.orig ./tests/tmul.c
    14 --- ./tests/tmul.c.orig	2009-07-28 16:29:03.761058919 +0300
    15 +++ ./tests/tmul.c	2009-07-28 16:30:46.369812215 +0300
    16 @@ -26,10 +26,8 @@ MA 02110-1301, USA. */
    17  #include "mpfr-test.h"
    18  
    19  #ifndef MPFR_SRCDIR
    20 -#define MPFR_SRCDIR .
    21 +#define MPFR_SRCDIR "."
    22  #endif
    23 -#define QUOTE(X) NAME(X)
    24 -#define NAME(X) #X
    25  
    26  #ifdef CHECK_EXTERNAL
    27  static int
    28 @@ -482,10 +480,10 @@ check_regression (void)
    29    mpfr_inits2 (6177, x, y, z, (mpfr_ptr) 0);
    30    /* we read long strings from a file since ISO C90 does not support strings of
    31       length > 509 */
    32 -  fp = fopen (QUOTE (MPFR_SRCDIR)"/tmul.dat", "r");
    33 +  fp = fopen (MPFR_SRCDIR "/tmul.dat", "r");
    34    if (fp == NULL)
    35      {
    36 -      fprintf (stderr, "Error, cannot open "QUOTE (MPFR_SRCDIR)"/tmul.dat\n");
    37 +      fprintf (stderr, "Error, cannot open " MPFR_SRCDIR "/tmul.dat\n");
    38        exit (1);
    39      }
    40    get_string (s, fp);