diff options
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/Makefile | 5 | ||||
-rw-r--r-- | stdlib/test-canon.c | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/stdlib/Makefile b/stdlib/Makefile index 29adea4425..2427e617fc 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -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 @@ -126,6 +126,9 @@ clean-mpn: 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 $(dir $<)$(notdir $<) '$(CC)' '-I../include -I.. $(+sysdep-includes)' > $<.out diff --git a/stdlib/test-canon.c b/stdlib/test-canon.c index c8be8d2d96..2ece136435 100644 --- a/stdlib/test-canon.c +++ b/stdlib/test-canon.c @@ -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 @@ struct { {"/////////////////////////////////", "/"}, {"/.././.././.././..///", "/"}, {"/etc", "/etc"}, - {"/etc/../etc", "/etc"}, + {"/etc/../etc", "/etc"}, /* 5 */ {"/doesNotExist/../etc", 0, "/doesNotExist", ENOENT}, {"./././././././././.", "."}, @@ -111,7 +115,7 @@ check_path (const char * result, const char * expected) int -main (int argc, char ** argv) +do_test (int argc, char ** argv) { char * result; int fd, i, errors = 0; @@ -198,7 +202,7 @@ main (int argc, char ** argv) if (errors != 0) { printf ("%d errors.\n", errors); - exit (EXIT_FAILURE); + return EXIT_FAILURE; } puts ("No errors."); |