This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Pr libc/1421: tdlib test fails if {srcdir}/stdlib not writable
- To: libc-alpha Mailinglist <libc-alpha at sourceware dot cygnus dot com>
- Subject: Pr libc/1421: tdlib test fails if {srcdir}/stdlib not writable
- From: Andreas Jaeger <aj at suse dot de>
- Date: 16 May 2000 16:45:22 +0200
- Cc: lrgallardo at yahoo dot com
Here's a fix for PR libc/1421. Now the sourcedir doesn't need to be
writable for the tests anymore.
I've also fixed a bug in the dirent/Makefile.
Uli, is this ok to commit?
We use in two places testname.args (posix/tstgetopt.args,
time/test_time.args) - we can add this now to the Makefile instead and
remove the two lines from Rules. I'll submit a new patch to clean
this up if this patch is ok.
Andreas
2000-05-16 Andreas Jaeger <aj@suse.de>
* Rules: Allow arguments for test files to be specified in
Makefile with testname-ARGS.
* dirent/Makefile (opendir-tst1-ARGS): Use this for opendir-tst1,
remove old bogus rule for opendir-tst1.args.
* stdlib/test-canon.c: Rewrite to use test-skeleton.c.
* stdlib/Makefile (test-canon-ARGS): New, supply argument to chdir
into objdir. This allows a readonly sourcetree.
Reported by lrgallardo@yahoo.com, closes PR libc/1421.
============================================================
Index: Rules
--- Rules 1999/08/22 16:07:27 1.92
+++ Rules 2000/05/16 14:37:02
@@ -119,13 +119,13 @@
# These are the implicit rules for making test outputs
# from the test programs and whatever input files are present.
$(objpfx)%.out: %.args $(objpfx)% %.input
- $($*-ENV) $(built-program-cmd) `cat $(word 1,$^)` < $(word 3,$^) > $@
+ $($*-ENV) $(built-program-cmd) $($*-ARGS) `cat $(word 1,$^)` < $(word 3,$^) > $@
$(objpfx)%.out: %.args $(objpfx)%
- $($*-ENV) $(built-program-cmd) `cat $(word 1,$^)` > $@
+ $($*-ENV) $(built-program-cmd) $($*-ARGS) `cat $(word 1,$^)` > $@
$(objpfx)%.out: %.input $(objpfx)%
- $($*-ENV) $(built-program-cmd) < $(word 1,$^) > $@
+ $($*-ENV) $(built-program-cmd) $($*-ARGS) < $(word 1,$^) > $@
$(objpfx)%.out: /dev/null $(objpfx)% # Make it 2nd arg for canned sequence.
- $($*-ENV) $(built-program-cmd) > $@
+ $($*-ENV) $(built-program-cmd) $($*-ARGS) > $@
endif # tests
.PHONY: distclean realclean subdir_distclean subdir_realclean \
============================================================
Index: dirent/Makefile
--- dirent/Makefile 1999/08/19 20:50:12 1.18
+++ dirent/Makefile 2000/05/16 14:37:02
@@ -32,4 +32,4 @@
include ../Rules
-opendir-tst1.args = --test-dir=${objdir}
+opendir-tst1-ARGS = --test-dir=${objdir}
============================================================
Index: stdlib/test-canon.c
--- stdlib/test-canon.c 1998/12/13 14:57:54 1.9
+++ stdlib/test-canon.c 2000/05/16 14:37:02
@@ -1,5 +1,5 @@
/* Test program for returning the canonical absolute name of a given file.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger <davidm@azstarnet.com>.
@@ -28,6 +28,10 @@
#include <unistd.h>
#include <sys/param.h>
+/* Prototype for our test function. */
+extern int do_test (int argc, char *argv[]);
+#include <test-skeleton.c>
+
#ifndef PATH_MAX
# define PATH_MAX 4096
#endif
@@ -55,7 +59,7 @@
{"/////////////////////////////////", "/"},
{"/.././.././.././..///", "/"},
{"/etc", "/etc"},
- {"/etc/../etc", "/etc"},
+ {"/etc/../etc", "/etc"},
/* 5 */
{"/doesNotExist/../etc", 0, "/doesNotExist", ENOENT},
{"./././././././././.", "."},
@@ -111,7 +115,7 @@
int
-main (int argc, char ** argv)
+do_test (int argc, char ** argv)
{
char * result;
int fd, i, errors = 0;
@@ -198,7 +202,7 @@
if (errors != 0)
{
printf ("%d errors.\n", errors);
- exit (EXIT_FAILURE);
+ return EXIT_FAILURE;
}
puts ("No errors.");
============================================================
Index: stdlib/Makefile
--- stdlib/Makefile 1999/12/27 21:48:18 1.58
+++ stdlib/Makefile 2000/05/16 14:37:02
@@ -1,4 +1,4 @@
-# Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
+# Copyright (C) 1991,92,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -125,6 +125,9 @@
rm -f $(mpn-stuff)
endif
+
+# Testdir has to be named stdlib and needs to be writable
+test-canon-ARGS = --test-dir=${objdir}/stdlib
# Run a test on the header files we use.
tests: $(objpfx)isomac
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de