On 25/04/2017 14:49, Wainer dos Santos Moschetta wrote:
> Updated all tests of grp, gshadow, inet, nss, pwd, resolv, and shadow
> to use the support test driver.
>
> Checked on x86_64-linux-gnu.
>
> 2017-04-25 Wainer dos Santos Moschetta <wainersm@gmail.com>
>
> * grp/tst-putgrent.c: Replace test-skeleton.c with support/test-driver.c
> and remove TEST_FUNCTION macro.
> * gshadow/tst-gshadow.c: Likewise.
> * gshadow/tst-putsgent.c: Likewise.
> * inet/bug-if1.c: Likewise.
> * inet/test-ifaddrs.c: Likewise.
> * inet/test-inet6_opt.c: Likewise.
> * inet/test_ifindex.c: Likewise.
> * inet/tst-ether_aton.c: Likewise.
> * inet/tst-ether_line.c: Likewise.
> * inet/tst-gethnm.c: Likewise.
> * inet/tst-getni1.c: Likewise.
> * inet/tst-getni2.c: Likewise.
> * inet/tst-inet6_rth.c: Likewise.
> * inet/tst-inet6_scopeid_pton.c: Likewise.
> * inet/tst-network.c: Likewise.
> * inet/tst-ntoa.c: Likewise.
> * inet/tst-sockaddr.c: Likewise.
> * nss/bug17079.c: Likewise.
> * nss/test-digits-dots.c: Likewise.
> * nss/test-netdb.c: Likewise.
> * nss/tst-field.c: Likewise.
> * nss/tst-nss-getpwent.c: Likewise.
> * nss/tst-nss-static.c: Likewise.
> * nss/tst-nss-test1.c: Likewise.
> * pwd/tst-getpw.c: Likewise.
> * pwd/tst-putpwent.c: Likewise.
> * resolv/tst-aton.c: Likewise.
> * resolv/tst-inet_ntop.c: Likewise.
> * resolv/tst-leaks.c: Likewise.
> * resolv/tst-leaks2.c: Likewise.
> * resolv/tst-res_hconf_reorder.c: Likewise.
> * shadow/tst-putspent.c: Likewise.
> * shadow/tst-shadow.c: Likewise.
LGTM with small request below.
> diff --git a/resolv/tst-leaks.c b/resolv/tst-leaks.c
> index 4f64535..c49d8c6 100644
> --- a/resolv/tst-leaks.c
> +++ b/resolv/tst-leaks.c
> @@ -21,15 +21,10 @@
> #include <resolv.h>
> #include <mcheck.h>
>
> -/* Prototype for our test function. */
> -extern int do_test (int argc, char *argv[]);
> -
> -/* This defines the `main' function and some more. */
> #define TIMEOUT 40
> -#include <test-skeleton.c>
>
> int
> -do_test (int argc, char *argv[])
> +do_test (void)
Since you are there, add static on do_test.
@@ -163,5 +163,4 @@ do_test (void)
return errors;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -1,3 +1,21 @@
+/* Test for gshadow functions.
+ Copyright (C) 2009-2017 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
#include <gshadow.h>
#include <stdio.h>
#include <string.h>
@@ -137,5 +155,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -164,5 +164,4 @@ do_test (void)
return errors;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -49,5 +49,4 @@ do_test (void)
return 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -95,5 +95,4 @@ Name Flags Address Netmask Broadcast/Destination");
return failures ? 1 : 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -207,5 +207,4 @@ do_test (void)
return 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -63,5 +63,4 @@ do_test (void)
return failures ? 1 : 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -56,5 +56,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -34,5 +34,4 @@ do_test (void)
return res;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -63,5 +63,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -32,5 +32,4 @@ do_test (void)
return retval;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -37,5 +37,4 @@ do_test (void)
return retval;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -188,5 +188,4 @@ address %d after second inet6_rth_reverse wrong (%s)\n",
return res;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -127,5 +127,4 @@ do_test (void)
return 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -77,5 +77,4 @@ do_test (void)
return errors != 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -35,5 +35,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -121,5 +121,4 @@ do_test (void)
return errors;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -240,5 +240,4 @@ do_test (void)
return 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -34,5 +34,4 @@ do_test (void)
return err == ERANGE && h_err == NETDB_INTERNAL ? EXIT_SUCCESS : EXIT_FAILURE;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -336,5 +336,4 @@ do_test (void)
return (error_count != 0);
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -97,5 +97,4 @@ do_test (void)
return errors;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -115,5 +115,4 @@ do_test (void)
}
#define TIMEOUT 300
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -1,7 +1,6 @@
/* glibc test for static NSS. */
#include <stdio.h>
-#define TEST_FUNCTION do_test ()
static int
do_test (void)
{
@@ -12,4 +11,4 @@ do_test (void)
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -1,3 +1,21 @@
+/* Test for NSS configure lookup.
+ Copyright (C) 2010-2017 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
#include <nss.h>
#include <pwd.h>
#include <stdio.h>
@@ -68,5 +86,4 @@ do_test (void)
return retval;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -110,5 +110,4 @@ do_test (void)
return errors;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -164,5 +164,4 @@ do_test (void)
return errors > 0;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -73,5 +73,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -110,5 +110,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -21,15 +21,10 @@
#include <resolv.h>
#include <mcheck.h>
-/* Prototype for our test function. */
-extern int do_test (int argc, char *argv[]);
-
-/* This defines the `main' function and some more. */
#define TIMEOUT 40
-#include <test-skeleton.c>
int
-do_test (int argc, char *argv[])
+do_test (void)
{
unsigned char buf[256];
@@ -41,3 +36,5 @@ do_test (int argc, char *argv[])
return 0;
}
+
+#include <support/test-driver.c>
@@ -34,7 +34,6 @@ do_test (void)
return 0;
}
-#define TEST_FUNCTION do_test ()
#define TIMEOUT 30
/* This defines the `main' function and some more. */
-#include <test-skeleton.c>
+#include <support/test-driver.c>
@@ -109,5 +109,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -160,5 +160,4 @@ do_test (void)
return errors;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -80,5 +80,4 @@ do_test (void)
return result;
}
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>