This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: Pr libc/1421: tdlib test fails if {srcdir}/stdlib not writable
>>>>> Ulrich Drepper writes:
Uli> Andreas Jaeger <aj@suse.de> writes:
>> But I first wanted to hear if this if the change is ok in general.
Uli> Make the whole change as Andreas suggests. That'll be fine.
Here's the complete patch. Andreas, can you look over it again and
give me a ok, please?
Thanks,
Andreas
2000-05-17 Andreas Jaeger <aj@suse.de>
* time/test_time.args: Removed.
* time/Makefile (test_time-ARGS): Added contents here instead.
* posix/tstgetopt.args: Removed.
* posix/Makefile (tstgetopt-ARGS): Added contents here instead.
* Rules: Allow arguments for test files to be specified in
Makefile with testname-ARGS; remove rules with .args in it.
* 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: time/Makefile
--- time/Makefile 2000/04/11 07:07:03 1.91
+++ time/Makefile 2000/05/17 08:47:08
@@ -46,3 +46,4 @@
CFLAGS-test_time.c = -Wno-format
tst-getdate-ENV= DATEMSK=datemsk
+test_time-ARGS= EST5EDT CST
============================================================
Index: posix/Makefile
--- posix/Makefile 2000/04/18 07:55:45 1.90
+++ posix/Makefile 2000/05/17 08:47:08
@@ -101,6 +101,8 @@
CFLAGS-regex.c = -Wno-strict-prototypes
CFLAGS-getaddrinfo.c = -DRESOLVER
+tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
+ --none random
$(objpfx)libposix.a: $(dep-dummy-lib); $(make-dummy-lib)
lib: $(objpfx)libposix.a
============================================================
Index: Rules
--- Rules 1999/08/22 16:07:27 1.92
+++ Rules 2000/05/17 08:47:08
@@ -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
@@ -118,14 +118,10 @@
ifneq "$(strip $(tests) $(test-srcs))" ""
# 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,$^) > $@
-$(objpfx)%.out: %.args $(objpfx)%
- $($*-ENV) $(built-program-cmd) `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/17 08:47:08
@@ -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/17 08:47:08
@@ -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/17 08:47:09
@@ -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
============================================================
Index: time/test_time.args
--- time/test_time.args Sat Jan 17 11:05:13 1998 1.2
+++ time/test_time.args removed
@@ -1,2 +0,0 @@
-EST5EDT
-CST
============================================================
Index: posix/tstgetopt.args
--- posix/tstgetopt.args Sat Jan 17 11:01:24 1998 1.2
+++ posix/tstgetopt.args removed
@@ -1,2 +0,0 @@
--a -b -cfoobar --required foobar --optional=bazbug --none random
-
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de