bca718
commit 29955b5d9658b02d3a678d1f785db3d1e63184ca
bca718
Author: Arjun Shankar <arjun.is@lostca.se>
bca718
Date:   Wed Nov 5 15:24:08 2014 +0530
bca718
bca718
    Modify several tests to use test-skeleton.c
bca718
    
bca718
    This patch modifies several test cases to use test-skeleton.c.
bca718
    It was generated by a bash script written for this purpose and
bca718
    thus excludes several other tests which I deemed worth a visual
bca718
    inspection before making the change.
bca718
    
bca718
    I intend to follow up with individual patches to the tests
bca718
    skipped by the script.
bca718
    
bca718
    The script itself resides at http://git.io/WODAmg and should
bca718
    reproduce this very patch when run against master.
bca718
    
bca718
    ChangeLog:
bca718
    
bca718
    2014-10-30  Arjun Shankar  <arjun.is@lostca.se>
bca718
    
bca718
    	* catgets/test-gencat.c: Use test-skeleton.c.
bca718
    	* catgets/tst-catgets.c: Likewise.
bca718
    	* csu/tst-empty.c: Likewise.
bca718
    	* elf/tst-audit2.c: Likewise.
bca718
    	* elf/tst-global1.c: Likewise.
bca718
    	* elf/tst-pathopt.c: Likewise.
bca718
    	* elf/tst-piemod1.c: Likewise.
bca718
    	* elf/tst-tls10.c: Likewise.
bca718
    	* elf/tst-tls11.c: Likewise.
bca718
    	* elf/tst-tls12.c: Likewise.
bca718
    	* gnulib/tst-gcc.c: Likewise.
bca718
    	* iconvdata/tst-e2big.c: Likewise.
bca718
    	* iconvdata/tst-loading.c: Likewise.
bca718
    	* iconv/tst-iconv1.c: Likewise.
bca718
    	* iconv/tst-iconv2.c: Likewise.
bca718
    	* inet/test-inet6_opt.c: Likewise.
bca718
    	* inet/tst-gethnm.c: Likewise.
bca718
    	* inet/tst-network.c: Likewise.
bca718
    	* inet/tst-ntoa.c: Likewise.
bca718
    	* intl/tst-codeset.c: Likewise.
bca718
    	* intl/tst-gettext2.c: Likewise.
bca718
    	* intl/tst-gettext3.c: Likewise.
bca718
    	* intl/tst-ngettext.c: Likewise.
bca718
    	* intl/tst-translit.c: Likewise.
bca718
    	* io/test-stat.c: Likewise.
bca718
    	* libio/test-fmemopen.c: Likewise.
bca718
    	* libio/tst-freopen.c: Likewise.
bca718
    	* libio/tst-sscanf.c: Likewise.
bca718
    	* libio/tst-ungetwc1.c: Likewise.
bca718
    	* libio/tst-ungetwc2.c: Likewise.
bca718
    	* libio/tst-widetext.c: Likewise.
bca718
    	* localedata/tst-ctype.c: Likewise.
bca718
    	* localedata/tst-digits.c: Likewise.
bca718
    	* localedata/tst-leaks.c: Likewise.
bca718
    	* localedata/tst-mbswcs1.c: Likewise.
bca718
    	* localedata/tst-mbswcs2.c: Likewise.
bca718
    	* localedata/tst-mbswcs3.c: Likewise.
bca718
    	* localedata/tst-mbswcs4.c: Likewise.
bca718
    	* localedata/tst-mbswcs5.c: Likewise.
bca718
    	* localedata/tst-setlocale.c: Likewise.
bca718
    	* localedata/tst-trans.c: Likewise.
bca718
    	* localedata/tst-wctype.c: Likewise.
bca718
    	* localedata/tst-xlocale1.c: Likewise.
bca718
    	* login/tst-grantpt.c: Likewise.
bca718
    	* malloc/tst-calloc.c: Likewise.
bca718
    	* malloc/tst-malloc.c: Likewise.
bca718
    	* malloc/tst-mallocstate.c: Likewise.
bca718
    	* malloc/tst-mcheck.c: Likewise.
bca718
    	* malloc/tst-mtrace.c: Likewise.
bca718
    	* malloc/tst-obstack.c: Likewise.
bca718
    	* math/atest-exp2.c: Likewise.
bca718
    	* math/atest-exp.c: Likewise.
bca718
    	* math/atest-sincos.c: Likewise.
bca718
    	* math/test-matherr.c: Likewise.
bca718
    	* math/test-misc.c: Likewise.
bca718
    	* math/test-powl.c: Likewise.
bca718
    	* math/tst-definitions.c: Likewise.
bca718
    	* misc/tst-dirname.c: Likewise.
bca718
    	* misc/tst-efgcvt.c: Likewise.
bca718
    	* misc/tst-fdset.c: Likewise.
bca718
    	* misc/tst-hsearch.c: Likewise.
bca718
    	* misc/tst-mntent2.c: Likewise.
bca718
    	* nptl/tst-sem7.c: Likewise.
bca718
    	* nptl/tst-sem8.c: Likewise.
bca718
    	* nptl/tst-sem9.c: Likewise.
bca718
    	* nss/test-netdb.c: Likewise.
bca718
    	* posix/tst-fnmatch.c: Likewise.
bca718
    	* posix/tst-getlogin.c: Likewise.
bca718
    	* posix/tst-gnuglob.c: Likewise.
bca718
    	* posix/tst-mmap.c: Likewise.
bca718
    	* resolv/tst-inet_ntop.c: Likewise.
bca718
    	* rt/tst-timer.c: Likewise.
bca718
    	* stdio-common/test-fseek.c: Likewise.
bca718
    	* stdio-common/test-popen.c: Likewise.
bca718
    	* stdio-common/test-vfprintf.c: Likewise.
bca718
    	* stdio-common/tst-cookie.c: Likewise.
bca718
    	* stdio-common/tst-fileno.c: Likewise.
bca718
    	* stdio-common/tst-gets.c: Likewise.
bca718
    	* stdio-common/tst-obprintf.c: Likewise.
bca718
    	* stdio-common/tst-perror.c: Likewise.
bca718
    	* stdio-common/tst-sprintf2.c: Likewise.
bca718
    	* stdio-common/tst-sprintf3.c: Likewise.
bca718
    	* stdio-common/tst-sprintf.c: Likewise.
bca718
    	* stdio-common/tst-swprintf.c: Likewise.
bca718
    	* stdio-common/tst-tmpnam.c: Likewise.
bca718
    	* stdio-common/tst-unbputc.c: Likewise.
bca718
    	* stdio-common/tst-wc-printf.c: Likewise.
bca718
    	* stdlib/tst-environ.c: Likewise.
bca718
    	* stdlib/tst-fmtmsg.c: Likewise.
bca718
    	* stdlib/tst-limits.c: Likewise.
bca718
    	* stdlib/tst-rand48-2.c: Likewise.
bca718
    	* stdlib/tst-rand48.c: Likewise.
bca718
    	* stdlib/tst-random2.c: Likewise.
bca718
    	* stdlib/tst-random.c: Likewise.
bca718
    	* stdlib/tst-strtol.c: Likewise.
bca718
    	* stdlib/tst-strtoll.c: Likewise.
bca718
    	* stdlib/tst-xpg-basename.c: Likewise.
bca718
    	* string/test-ffs.c: Likewise.
bca718
    	* string/tst-bswap.c: Likewise.
bca718
    	* string/tst-inlcall.c: Likewise.
bca718
    	* string/tst-strtok.c: Likewise.
bca718
    	* string/tst-strxfrm.c: Likewise.
bca718
    	* sysdeps/x86_64/tst-audit10.c: Likewise.
bca718
    	* elf/tst-audit3.c: Likewise.
bca718
    	* elf/tst-audit4.c: Likewise.
bca718
    	* elf/tst-audit5.c: Likewise.
bca718
    	* time/tst-ftime_l.c: Likewise.
bca718
    	* time/tst-getdate.c: Likewise.
bca718
    	* time/tst-mktime3.c: Likewise.
bca718
    	* time/tst-mktime.c: Likewise.
bca718
    	* time/tst-posixtz.c: Likewise.
bca718
    	* time/tst-strptime2.c: Likewise.
bca718
    	* time/tst-strptime3.c: Likewise.
bca718
    	* wcsmbs/tst-btowc.c: Likewise.
bca718
    	* wcsmbs/tst-mbrtowc.c: Likewise.
bca718
    	* wcsmbs/tst-mbsrtowcs.c: Likewise.
bca718
    	* wcsmbs/tst-wchar-h.c: Likewise.
bca718
    	* wcsmbs/tst-wcpncpy.c: Likewise.
bca718
    	* wcsmbs/tst-wcrtomb.c: Likewise.
bca718
    	* wcsmbs/tst-wcsnlen.c: Likewise.
bca718
    	* wcsmbs/tst-wcstof.c: Likewise.
bca718
bca718
diff --git a/catgets/test-gencat.c b/catgets/test-gencat.c
bca718
index eaa9b89..282974c 100644
bca718
--- a/catgets/test-gencat.c
bca718
+++ b/catgets/test-gencat.c
bca718
@@ -3,8 +3,8 @@
bca718
 #include <stdio.h>
bca718
 #include <stdlib.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   nl_catd catalog;
bca718
   setlocale (LC_ALL, "");
bca718
@@ -29,3 +29,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/catgets/tst-catgets.c b/catgets/tst-catgets.c
bca718
index fdaa834..a0a4089 100644
bca718
--- a/catgets/tst-catgets.c
bca718
+++ b/catgets/tst-catgets.c
bca718
@@ -14,8 +14,8 @@ static const char *msgs[] =
bca718
 
bca718
 #define ROUNDS 5
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int rnd;
bca718
   int result = 0;
bca718
@@ -64,3 +64,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/csu/tst-empty.c b/csu/tst-empty.c
bca718
index 980dcd6..e99468e 100644
bca718
--- a/csu/tst-empty.c
bca718
+++ b/csu/tst-empty.c
bca718
@@ -1,6 +1,9 @@
bca718
 /* The most useful C program known to man.  */
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/elf/tst-audit2.c b/elf/tst-audit2.c
bca718
index b4fa906..acad1b0 100644
bca718
--- a/elf/tst-audit2.c
bca718
+++ b/elf/tst-audit2.c
bca718
@@ -31,8 +31,8 @@ calloc (size_t n, size_t m)
bca718
   return ptr;
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   if (magic[1] != MAGIC1 || magic[0] != MAGIC2)
bca718
     {
bca718
@@ -42,3 +42,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/elf/tst-global1.c b/elf/tst-global1.c
bca718
index 1611b51..4df335c 100644
bca718
--- a/elf/tst-global1.c
bca718
+++ b/elf/tst-global1.c
bca718
@@ -1,8 +1,8 @@
bca718
 #include <dlfcn.h>
bca718
 #include <stdio.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   void *h1 = dlopen ("$ORIGIN/testobj6.so", RTLD_GLOBAL|RTLD_LAZY);
bca718
   if (h1 == NULL)
bca718
@@ -34,3 +34,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/elf/tst-pathopt.c b/elf/tst-pathopt.c
bca718
index 1f7aac2..8d73ad4 100644
bca718
--- a/elf/tst-pathopt.c
bca718
+++ b/elf/tst-pathopt.c
bca718
@@ -4,8 +4,8 @@
bca718
 #include <stdlib.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   void *h;
bca718
   int (*fp) (int);
bca718
@@ -37,3 +37,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/elf/tst-piemod1.c b/elf/tst-piemod1.c
bca718
index ad439da..6e98b5f 100644
bca718
--- a/elf/tst-piemod1.c
bca718
+++ b/elf/tst-piemod1.c
bca718
@@ -6,8 +6,8 @@ foo (void)
bca718
   return 21;
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int val = foo ();
bca718
   if (val != 34)
bca718
@@ -18,3 +18,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/elf/tst-tls10.c b/elf/tst-tls10.c
bca718
index 347243f..eb1ecb9 100644
bca718
--- a/elf/tst-tls10.c
bca718
+++ b/elf/tst-tls10.c
bca718
@@ -8,8 +8,8 @@ __thread struct A local = { 1, 2, 3 };
bca718
   if (p->a != S || p->b != S + 1 || p->c != S + 2)	\
bca718
     abort ()
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   struct A *p;
bca718
   if (local.a != 1 || local.b != 2 || local.c != 3)
bca718
@@ -35,3 +35,6 @@ main (void)
bca718
 
bca718
   exit (0);
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/elf/tst-tls11.c b/elf/tst-tls11.c
bca718
index 8a2fef4..8ceac14 100644
bca718
--- a/elf/tst-tls11.c
bca718
+++ b/elf/tst-tls11.c
bca718
@@ -5,8 +5,8 @@
bca718
   if (p->a != S || p->b != S + 1 || p->c != S + 2)	\
bca718
     abort ()
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   struct A *p;
bca718
   check1 ();
bca718
@@ -24,3 +24,6 @@ main (void)
bca718
 
bca718
   exit (0);
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/elf/tst-tls12.c b/elf/tst-tls12.c
bca718
index 9086d17..8093894 100644
bca718
--- a/elf/tst-tls12.c
bca718
+++ b/elf/tst-tls12.c
bca718
@@ -5,8 +5,8 @@
bca718
   if (p->a != S || p->b != S + 1 || p->c != S + 2)	\
bca718
     abort ()
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   struct A *p;
bca718
   check1 ();
bca718
@@ -15,3 +15,6 @@ main (void)
bca718
 
bca718
   exit (0);
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/gnulib/tst-gcc.c b/gnulib/tst-gcc.c
bca718
index 71fab28..9f4ba83 100644
bca718
--- a/gnulib/tst-gcc.c
bca718
+++ b/gnulib/tst-gcc.c
bca718
@@ -51,8 +51,8 @@
bca718
   })
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
   int __integer_type;
bca718
@@ -71,3 +71,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/iconv/tst-iconv1.c b/iconv/tst-iconv1.c
bca718
index d806ce6..0609f50 100644
bca718
--- a/iconv/tst-iconv1.c
bca718
+++ b/iconv/tst-iconv1.c
bca718
@@ -5,8 +5,8 @@
bca718
 #include <stdio.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char utf8[5];
bca718
   wchar_t ucs4[5];
bca718
@@ -42,3 +42,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/iconv/tst-iconv2.c b/iconv/tst-iconv2.c
bca718
index 5036ad1..0672a51 100644
bca718
--- a/iconv/tst-iconv2.c
bca718
+++ b/iconv/tst-iconv2.c
bca718
@@ -25,8 +25,8 @@
bca718
 #include <string.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char buf[3];
bca718
   const wchar_t wc[1] = L"a";
bca718
@@ -97,3 +97,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/iconvdata/tst-e2big.c b/iconvdata/tst-e2big.c
bca718
index 9533eb0..8de64b2 100644
bca718
--- a/iconvdata/tst-e2big.c
bca718
+++ b/iconvdata/tst-e2big.c
bca718
@@ -95,10 +95,13 @@ test_tscii (void)
bca718
   test ("TSCII", inbuf, sizeof (inbuf), 9);
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   test_euc_jisx0213 ();
bca718
   test_tscii ();
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/iconvdata/tst-loading.c b/iconvdata/tst-loading.c
bca718
index 0d8a959..eff9d78 100644
bca718
--- a/iconvdata/tst-loading.c
bca718
+++ b/iconvdata/tst-loading.c
bca718
@@ -114,8 +114,8 @@ static const char inbuf[] =
bca718
 "     function.  Later modifications of the variable have no effect.\n";
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   size_t count = TEST_ROUNDS;
bca718
   int result = 0;
bca718
@@ -180,3 +180,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/inet/test-inet6_opt.c b/inet/test-inet6_opt.c
bca718
index 3bf319e..a7ebf00 100644
bca718
--- a/inet/test-inet6_opt.c
bca718
+++ b/inet/test-inet6_opt.c
bca718
@@ -194,8 +194,8 @@ decode_inet6_opt (void *eb, socklen_t el)
bca718
   return ret;
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   void *eb;
bca718
   socklen_t el;
bca718
@@ -206,3 +206,6 @@ main (void)
bca718
     return 1;
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/inet/tst-gethnm.c b/inet/tst-gethnm.c
bca718
index 8af44d6..dd3a547 100644
bca718
--- a/inet/tst-gethnm.c
bca718
+++ b/inet/tst-gethnm.c
bca718
@@ -10,8 +10,8 @@
bca718
 #include <netinet/in.h>
bca718
 #include <arpa/inet.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   struct hostent *ent;
bca718
   struct in_addr hostaddr;
bca718
@@ -62,3 +62,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/inet/tst-network.c b/inet/tst-network.c
bca718
index fc90bd7..cc840e0 100644
bca718
--- a/inet/tst-network.c
bca718
+++ b/inet/tst-network.c
bca718
@@ -51,8 +51,8 @@ struct
bca718
 };
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int errors = 0;
bca718
   size_t i;
bca718
@@ -76,3 +76,6 @@ main (void)
bca718
 
bca718
   return errors != 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/inet/tst-ntoa.c b/inet/tst-ntoa.c
bca718
index 9be91eb..ef82d4d 100644
bca718
--- a/inet/tst-ntoa.c
bca718
+++ b/inet/tst-ntoa.c
bca718
@@ -22,8 +22,8 @@ test (unsigned int inaddr, const char *expected)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -34,3 +34,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/intl/tst-codeset.c b/intl/tst-codeset.c
bca718
index f5b37ec..37f731e 100644
bca718
--- a/intl/tst-codeset.c
bca718
+++ b/intl/tst-codeset.c
bca718
@@ -23,8 +23,8 @@
bca718
 #include <stdlib.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char *s;
bca718
   int result = 0;
bca718
@@ -55,3 +55,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/intl/tst-gettext2.c b/intl/tst-gettext2.c
bca718
index 075680a..3c44165 100644
bca718
--- a/intl/tst-gettext2.c
bca718
+++ b/intl/tst-gettext2.c
bca718
@@ -40,8 +40,8 @@ struct data_t strings[] =
bca718
 const int lang_cnt = 3;
bca718
 const char *lang[] = {"lang1", "lang2", "lang3"};
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int i;
bca718
 
bca718
@@ -70,3 +70,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/intl/tst-gettext3.c b/intl/tst-gettext3.c
bca718
index dd88987..11e9b08 100644
bca718
--- a/intl/tst-gettext3.c
bca718
+++ b/intl/tst-gettext3.c
bca718
@@ -24,8 +24,8 @@
bca718
 #include <stdlib.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char *s;
bca718
   int result = 0;
bca718
@@ -57,3 +57,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/intl/tst-ngettext.c b/intl/tst-ngettext.c
bca718
index 4fb0ca2..71e91b9 100644
bca718
--- a/intl/tst-ngettext.c
bca718
+++ b/intl/tst-ngettext.c
bca718
@@ -25,8 +25,8 @@
bca718
 #include <string.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   const char *strs[2] = { "singular", "plural" };
bca718
   unsigned long int i;
bca718
@@ -63,3 +63,6 @@ main (void)
bca718
 
bca718
   return res;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/intl/tst-translit.c b/intl/tst-translit.c
bca718
index 1aecee7..299fa40 100644
bca718
--- a/intl/tst-translit.c
bca718
+++ b/intl/tst-translit.c
bca718
@@ -24,8 +24,8 @@
bca718
 #include <string.h>
bca718
 #include <unistd.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
   const char *s;
bca718
@@ -49,3 +49,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/io/test-stat.c b/io/test-stat.c
bca718
index c5cfd26..e9c8468 100644
bca718
--- a/io/test-stat.c
bca718
+++ b/io/test-stat.c
bca718
@@ -25,8 +25,8 @@
bca718
 #include <stddef.h>
bca718
 #include <sys/stat.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   /* With _FILE_OFFSET_BITS=64 struct stat and struct stat64 should
bca718
      be identical.  */
bca718
@@ -65,3 +65,6 @@ main (void)
bca718
 #endif
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/libio/test-fmemopen.c b/libio/test-fmemopen.c
bca718
index 3099894..211176e 100644
bca718
--- a/libio/test-fmemopen.c
bca718
+++ b/libio/test-fmemopen.c
bca718
@@ -22,8 +22,8 @@ static char buffer[] = "foobar";
bca718
 #include <stdio.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int ch;
bca718
   FILE *stream;
bca718
@@ -37,3 +37,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/libio/tst-freopen.c b/libio/tst-freopen.c
bca718
index f9e7177..94284ec 100644
bca718
--- a/libio/tst-freopen.c
bca718
+++ b/libio/tst-freopen.c
bca718
@@ -22,8 +22,8 @@
bca718
 #include <string.h>
bca718
 #include <unistd.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char name[] = "/tmp/tst-freopen.XXXXXX";
bca718
   const char * const test = "Let's test freopen.\n";
bca718
@@ -100,3 +100,6 @@ main (void)
bca718
   unlink (name);
bca718
   exit (0);
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/libio/tst-sscanf.c b/libio/tst-sscanf.c
bca718
index b1a2b84..fb4be34 100644
bca718
--- a/libio/tst-sscanf.c
bca718
+++ b/libio/tst-sscanf.c
bca718
@@ -3,8 +3,8 @@
bca718
 
bca718
 #define WCS_LENGTH 256
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   const char cnv[] ="%l[abc]";
bca718
   const char str[] = "abbcXab";
bca718
@@ -18,3 +18,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/libio/tst-ungetwc1.c b/libio/tst-ungetwc1.c
bca718
index f74c407..f71b390 100644
bca718
--- a/libio/tst-ungetwc1.c
bca718
+++ b/libio/tst-ungetwc1.c
bca718
@@ -7,8 +7,8 @@
bca718
 #include <unistd.h>
bca718
 #include <wchar.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   FILE *fp;
bca718
   const char *str = "abcdef";
bca718
@@ -79,3 +79,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/libio/tst-ungetwc2.c b/libio/tst-ungetwc2.c
bca718
index d15e287..a7c5193 100644
bca718
--- a/libio/tst-ungetwc2.c
bca718
+++ b/libio/tst-ungetwc2.c
bca718
@@ -7,8 +7,8 @@
bca718
 #include <unistd.h>
bca718
 #include <wchar.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   FILE *fp;
bca718
   const char *str = "abcdef";
bca718
@@ -79,3 +79,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/libio/tst-widetext.c b/libio/tst-widetext.c
bca718
index 179763e..acab72b 100644
bca718
--- a/libio/tst-widetext.c
bca718
+++ b/libio/tst-widetext.c
bca718
@@ -31,8 +31,8 @@
bca718
 #define SIZE 210000
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char name[] = "/tmp/widetext.out.XXXXXX";
bca718
   char mbbuf[SIZE];
bca718
@@ -367,3 +367,6 @@ main (void)
bca718
 
bca718
   return status;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-ctype.c b/localedata/tst-ctype.c
bca718
index ceda891..a4e8fcf 100644
bca718
--- a/localedata/tst-ctype.c
bca718
+++ b/localedata/tst-ctype.c
bca718
@@ -61,8 +61,8 @@ static struct classes
bca718
   }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   const char *cp;
bca718
   const char *cp2;
bca718
@@ -447,3 +447,6 @@ punct = %04x  alnum = %04x\n",
bca718
   printf ("  No errors for `%s' locale\n\n\n", setlocale (LC_ALL, NULL));
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-digits.c b/localedata/tst-digits.c
bca718
index 9b3ebcd..76356e9 100644
bca718
--- a/localedata/tst-digits.c
bca718
+++ b/localedata/tst-digits.c
bca718
@@ -111,8 +111,8 @@ static struct wprintf_int_test
bca718
   (sizeof (wprintf_int_tests) / sizeof (wprintf_int_tests[0]))
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int cnt;
bca718
   int failures;
bca718
@@ -246,3 +246,6 @@ main (void)
bca718
 
bca718
   return status;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-leaks.c b/localedata/tst-leaks.c
bca718
index 7a4b557..ccd44f2 100644
bca718
--- a/localedata/tst-leaks.c
bca718
+++ b/localedata/tst-leaks.c
bca718
@@ -1,8 +1,8 @@
bca718
 #include <locale.h>
bca718
 #include <mcheck.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int cnt;
bca718
 
bca718
@@ -16,3 +16,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-mbswcs1.c b/localedata/tst-mbswcs1.c
bca718
index 14f1372..1404829 100644
bca718
--- a/localedata/tst-mbswcs1.c
bca718
+++ b/localedata/tst-mbswcs1.c
bca718
@@ -33,8 +33,8 @@
bca718
     }									  \
bca718
   putc ('\n', stdout)
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   const unsigned char buf[6] = { 0x25,  0xe2, 0x82, 0xac,  0xce, 0xbb };
bca718
   mbstate_t state;
bca718
@@ -60,3 +60,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-mbswcs2.c b/localedata/tst-mbswcs2.c
bca718
index 25fa951..9cd95d6 100644
bca718
--- a/localedata/tst-mbswcs2.c
bca718
+++ b/localedata/tst-mbswcs2.c
bca718
@@ -35,8 +35,8 @@
bca718
     }									\
bca718
   putc ('\n', stdout)
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   unsigned char buf[6] = { 0x25,  0xe2, 0x82, 0xac,  0xce, 0xbb };
bca718
   mbstate_t state;
bca718
@@ -62,3 +62,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-mbswcs3.c b/localedata/tst-mbswcs3.c
bca718
index 8db65c5..a068541 100644
bca718
--- a/localedata/tst-mbswcs3.c
bca718
+++ b/localedata/tst-mbswcs3.c
bca718
@@ -38,8 +38,8 @@
bca718
     putc ('\n', stdout);						\
bca718
   }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   unsigned char buf[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
bca718
   const unsigned char bufcheck[6] = { 0x25, 0xe2, 0x82, 0xac, 0xce, 0xbb };
bca718
@@ -73,3 +73,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-mbswcs4.c b/localedata/tst-mbswcs4.c
bca718
index 09b7417..a4fe60d 100644
bca718
--- a/localedata/tst-mbswcs4.c
bca718
+++ b/localedata/tst-mbswcs4.c
bca718
@@ -34,8 +34,8 @@
bca718
     }									\
bca718
   putc ('\n', stdout)
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   unsigned char buf[6] = { 0x25,  0xe2, 0x82, 0xac,  0xce, 0xbb };
bca718
   mbstate_t state;
bca718
@@ -60,3 +60,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-mbswcs5.c b/localedata/tst-mbswcs5.c
bca718
index e18862c..c44f12a 100644
bca718
--- a/localedata/tst-mbswcs5.c
bca718
+++ b/localedata/tst-mbswcs5.c
bca718
@@ -37,8 +37,8 @@
bca718
     putc ('\n', stdout);						\
bca718
   }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   unsigned char buf[7] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
bca718
   const unsigned char bufcheck[7] = { 0x25, 0xe2, 0x82, 0xac, 0xce, 0xbb, 0 };
bca718
@@ -72,3 +72,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-setlocale.c b/localedata/tst-setlocale.c
bca718
index 1f8e68d..a09a4de 100644
bca718
--- a/localedata/tst-setlocale.c
bca718
+++ b/localedata/tst-setlocale.c
bca718
@@ -3,8 +3,8 @@
bca718
 #include <stdio.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char q[30];
bca718
   char *s;
bca718
@@ -23,3 +23,6 @@ main (void)
bca718
 
bca718
   return strcmp (s, "de_DE.UTF-8") != 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-trans.c b/localedata/tst-trans.c
bca718
index 5e09631..0b0be83 100644
bca718
--- a/localedata/tst-trans.c
bca718
+++ b/localedata/tst-trans.c
bca718
@@ -24,8 +24,8 @@
bca718
 #include <wchar.h>
bca718
 #include <wctype.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char buf[30];
bca718
   wchar_t wbuf[30];
bca718
@@ -68,3 +68,6 @@ main (void)
bca718
 
bca718
   return errors;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-wctype.c b/localedata/tst-wctype.c
bca718
index bd2b057..eb72030 100644
bca718
--- a/localedata/tst-wctype.c
bca718
+++ b/localedata/tst-wctype.c
bca718
@@ -24,8 +24,8 @@
bca718
 #include <wchar.h>
bca718
 #include <wctype.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   wctype_t wct;
bca718
   wchar_t buf[1000];
bca718
@@ -141,3 +141,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/localedata/tst-xlocale1.c b/localedata/tst-xlocale1.c
bca718
index 297c9ad..9f545a0 100644
bca718
--- a/localedata/tst-xlocale1.c
bca718
+++ b/localedata/tst-xlocale1.c
bca718
@@ -20,8 +20,8 @@ static struct
bca718
 #define ntests (sizeof (tests) / sizeof (tests[0]))
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   size_t cnt;
bca718
   int result = 0;
bca718
@@ -73,3 +73,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/login/tst-grantpt.c b/login/tst-grantpt.c
bca718
index 5078dac..65bb344 100644
bca718
--- a/login/tst-grantpt.c
bca718
+++ b/login/tst-grantpt.c
bca718
@@ -66,8 +66,8 @@ test_einval (void)
bca718
   return ret;
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -76,3 +76,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/malloc/tst-calloc.c b/malloc/tst-calloc.c
bca718
index 51e6c25..7ad5124 100644
bca718
--- a/malloc/tst-calloc.c
bca718
+++ b/malloc/tst-calloc.c
bca718
@@ -104,8 +104,8 @@ null_test (void)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   /* We are allocating blocks with `calloc' and check whether every
bca718
      block is completely cleared.  We first try this for some fixed
bca718
@@ -123,3 +123,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
bca718
index a75ab1e..2685315 100644
bca718
--- a/malloc/tst-malloc.c
bca718
+++ b/malloc/tst-malloc.c
bca718
@@ -29,8 +29,8 @@ merror (const char *msg)
bca718
   printf ("Error: %s\n", msg);
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   void *p, *q;
bca718
   int save;
bca718
@@ -75,3 +75,6 @@ main (void)
bca718
 
bca718
   return errors != 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/malloc/tst-mallocstate.c b/malloc/tst-mallocstate.c
bca718
index 69c4500..539539e 100644
bca718
--- a/malloc/tst-mallocstate.c
bca718
+++ b/malloc/tst-mallocstate.c
bca718
@@ -29,8 +29,8 @@ merror (const char *msg)
bca718
   printf ("Error: %s\n", msg);
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   void *p1, *p2;
bca718
   void *save_state;
bca718
@@ -79,3 +79,6 @@ main (void)
bca718
  * c-basic-offset: 2
bca718
  * End:
bca718
  */
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/malloc/tst-mcheck.c b/malloc/tst-mcheck.c
bca718
index 478ca8c..bd9ab0e 100644
bca718
--- a/malloc/tst-mcheck.c
bca718
+++ b/malloc/tst-mcheck.c
bca718
@@ -29,8 +29,8 @@ merror (const char *msg)
bca718
   printf ("Error: %s\n", msg);
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   void *p, *q;
bca718
 
bca718
@@ -88,3 +88,6 @@ main (void)
bca718
 
bca718
   return errors != 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/malloc/tst-mtrace.c b/malloc/tst-mtrace.c
bca718
index 9b5151c..b2c0c2c 100644
bca718
--- a/malloc/tst-mtrace.c
bca718
+++ b/malloc/tst-mtrace.c
bca718
@@ -30,8 +30,8 @@ static void print (const void *node, VISIT value, int level);
bca718
 static FILE *fp;
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   void *root = NULL;
bca718
   size_t linelen = 0;
bca718
@@ -100,3 +100,6 @@ print (const void *node, VISIT value, int level)
bca718
   if (value == postorder || value == leaf)
bca718
     fprintf (fp, "%3d: %s", ++cnt, *(const char **) node);
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/malloc/tst-obstack.c b/malloc/tst-obstack.c
bca718
index 769697f..ee1385d 100644
bca718
--- a/malloc/tst-obstack.c
bca718
+++ b/malloc/tst-obstack.c
bca718
@@ -25,8 +25,8 @@ verbose_free (void *buf)
bca718
   printf ("free (%p)\n", buf);
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
   int align = 2;
bca718
@@ -62,3 +62,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/math/atest-exp.c b/math/atest-exp.c
bca718
index 3a538b2..6a551de 100644
bca718
--- a/math/atest-exp.c
bca718
+++ b/math/atest-exp.c
bca718
@@ -102,8 +102,8 @@ mpn_bitsize(const mp_limb_t *SRC_PTR, mp_size_t SIZE)
bca718
    return i * mpbpl + j;
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
    mp1 ex, x, xt, e2, e3;
bca718
    int i;
bca718
@@ -190,3 +190,6 @@ main (void)
bca718
 
bca718
    return failures == 0 ? 0 : 1;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/math/atest-exp2.c b/math/atest-exp2.c
bca718
index 3442715..945bb7a 100644
bca718
--- a/math/atest-exp2.c
bca718
+++ b/math/atest-exp2.c
bca718
@@ -144,8 +144,8 @@ mpn_bitsize(const mp_limb_t *SRC_PTR, mp_size_t SIZE)
bca718
   return i * mpbpl + j;
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   mp1 ex, x, xt, e2, e3;
bca718
   int i;
bca718
@@ -227,3 +227,6 @@ main (void)
bca718
 
bca718
   return failures == 0 ? 0 : 1;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/math/atest-sincos.c b/math/atest-sincos.c
bca718
index 5ad59b2..1f5e730 100644
bca718
--- a/math/atest-sincos.c
bca718
+++ b/math/atest-sincos.c
bca718
@@ -141,8 +141,8 @@ mpn_bitsize (const mp_limb_t *SRC_PTR, mp_size_t SIZE)
bca718
    return i * mpbpl + j;
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   mp1 si, co, x, ox, xt, s2, c2, s3, c3;
bca718
   int i;
bca718
@@ -277,3 +277,6 @@ main (void)
bca718
 
bca718
    return (sin_failures == 0 && cos_failures == 0) ? 0 : 1;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/math/test-matherr.c b/math/test-matherr.c
bca718
index cd09a39..6983879 100644
bca718
--- a/math/test-matherr.c
bca718
+++ b/math/test-matherr.c
bca718
@@ -12,10 +12,13 @@ matherr (struct exception *s)
bca718
   return 1;
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   _LIB_VERSION = _SVID_;
bca718
   acos (2.0);
bca718
   return fail;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/math/test-misc.c b/math/test-misc.c
bca718
index 3fd2bca..4801bfe 100644
bca718
--- a/math/test-misc.c
bca718
+++ b/math/test-misc.c
bca718
@@ -25,8 +25,8 @@
bca718
 #include <string.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -1201,3 +1201,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/math/test-powl.c b/math/test-powl.c
bca718
index fd2a1cb..66ef886 100644
bca718
--- a/math/test-powl.c
bca718
+++ b/math/test-powl.c
bca718
@@ -21,8 +21,8 @@
bca718
 #include <float.h>
bca718
 #include <ieee754.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -48,3 +48,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/math/tst-definitions.c b/math/tst-definitions.c
bca718
index 2501c8c..76a4125 100644
bca718
--- a/math/tst-definitions.c
bca718
+++ b/math/tst-definitions.c
bca718
@@ -21,8 +21,8 @@
bca718
 #include <stdio.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -44,3 +44,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/misc/tst-dirname.c b/misc/tst-dirname.c
bca718
index d8f33df..d6c05ad 100644
bca718
--- a/misc/tst-dirname.c
bca718
+++ b/misc/tst-dirname.c
bca718
@@ -37,8 +37,8 @@ test (const char *input, const char *result)
bca718
   return retval;
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -67,3 +67,6 @@ main (void)
bca718
 
bca718
   return result != 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/misc/tst-efgcvt.c b/misc/tst-efgcvt.c
bca718
index 303042d..11427a0 100644
bca718
--- a/misc/tst-efgcvt.c
bca718
+++ b/misc/tst-efgcvt.c
bca718
@@ -200,8 +200,8 @@ special (void)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   test (ecvt_tests, ecvt, "ecvt");
bca718
   test (fcvt_tests, fcvt, "fcvt");
bca718
@@ -211,3 +211,6 @@ main (void)
bca718
 
bca718
   return error_count;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/misc/tst-fdset.c b/misc/tst-fdset.c
bca718
index 78a34e9..ef93ac3 100644
bca718
--- a/misc/tst-fdset.c
bca718
+++ b/misc/tst-fdset.c
bca718
@@ -20,8 +20,8 @@
bca718
 #include <stdio.h>
bca718
 #include <sys/types.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int retval = 0;
bca718
   int i;
bca718
@@ -62,3 +62,6 @@ main (void)
bca718
 
bca718
   return retval;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/misc/tst-hsearch.c b/misc/tst-hsearch.c
bca718
index 6c19b22..d390f1d 100644
bca718
--- a/misc/tst-hsearch.c
bca718
+++ b/misc/tst-hsearch.c
bca718
@@ -1,8 +1,8 @@
bca718
 #include <search.h>
bca718
 #include <stdio.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int a = 1;
bca718
   int b = 2;
bca718
@@ -29,3 +29,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/misc/tst-mntent2.c b/misc/tst-mntent2.c
bca718
index 6c25e01..e61d506 100644
bca718
--- a/misc/tst-mntent2.c
bca718
+++ b/misc/tst-mntent2.c
bca718
@@ -3,8 +3,8 @@
bca718
 #include <string.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
   struct mntent mef;
bca718
@@ -39,3 +39,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/nptl/tst-sem7.c b/nptl/tst-sem7.c
bca718
index d0e7f05..4fc5f1f 100644
bca718
--- a/nptl/tst-sem7.c
bca718
+++ b/nptl/tst-sem7.c
bca718
@@ -31,8 +31,8 @@ remove_sem (int status, void *arg)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   sem_t *s;
bca718
   sem_t *s2;
bca718
@@ -106,3 +106,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/nptl/tst-sem8.c b/nptl/tst-sem8.c
bca718
index 1aeb1e1..4d7197c 100644
bca718
--- a/nptl/tst-sem8.c
bca718
+++ b/nptl/tst-sem8.c
bca718
@@ -31,8 +31,8 @@ remove_sem (int status, void *arg)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   sem_t *s;
bca718
   int i;
bca718
@@ -71,3 +71,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/nptl/tst-sem9.c b/nptl/tst-sem9.c
bca718
index 9727486..b7d81a9 100644
bca718
--- a/nptl/tst-sem9.c
bca718
+++ b/nptl/tst-sem9.c
bca718
@@ -31,8 +31,8 @@ remove_sem (int status, void *arg)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   sem_t *s;
bca718
   int i;
bca718
@@ -78,3 +78,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/nss/test-netdb.c b/nss/test-netdb.c
bca718
index 1620b5b..384f32b 100644
bca718
--- a/nss/test-netdb.c
bca718
+++ b/nss/test-netdb.c
bca718
@@ -356,8 +356,8 @@ setdb (const char *dbname)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   /*
bca718
     setdb ("db");
bca718
@@ -376,3 +376,6 @@ main (void)
bca718
 
bca718
   return (error_count != 0);
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/posix/tst-fnmatch.c b/posix/tst-fnmatch.c
bca718
index ff2674c..021734d 100644
bca718
--- a/posix/tst-fnmatch.c
bca718
+++ b/posix/tst-fnmatch.c
bca718
@@ -33,8 +33,8 @@ static char *flag_output (int flags);
bca718
 static char *escape (const char *str, size_t *reslenp, char **resbuf);
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char *linebuf = NULL;
bca718
   size_t linebuflen = 0;
bca718
@@ -388,3 +388,6 @@ escape (const char *str, size_t *reslenp, char **resbufp)
bca718
 
bca718
   return resbuf;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/posix/tst-getlogin.c b/posix/tst-getlogin.c
bca718
index 1393c3a..141a699 100644
bca718
--- a/posix/tst-getlogin.c
bca718
+++ b/posix/tst-getlogin.c
bca718
@@ -19,8 +19,8 @@
bca718
 #include <stdio.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char *login;
bca718
   int errors = 0;
bca718
@@ -55,3 +55,6 @@ main (void)
bca718
 
bca718
   return errors != 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/posix/tst-gnuglob.c b/posix/tst-gnuglob.c
bca718
index 1c72357..39b5b24 100644
bca718
--- a/posix/tst-gnuglob.c
bca718
+++ b/posix/tst-gnuglob.c
bca718
@@ -379,8 +379,8 @@ test_result (const char *fmt, int flags, glob_t *gl, const char *str[])
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   glob_t gl;
bca718
   int errval;
bca718
@@ -497,3 +497,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/posix/tst-mmap.c b/posix/tst-mmap.c
bca718
index c03acf5..5e52b49 100644
bca718
--- a/posix/tst-mmap.c
bca718
+++ b/posix/tst-mmap.c
bca718
@@ -6,8 +6,8 @@
bca718
 #include <sys/mman.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
   FILE *fp;
bca718
@@ -195,3 +195,6 @@ main (void)
bca718
   /* That's it.  */
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/resolv/tst-inet_ntop.c b/resolv/tst-inet_ntop.c
bca718
index f968ec4..f0de063 100644
bca718
--- a/resolv/tst-inet_ntop.c
bca718
+++ b/resolv/tst-inet_ntop.c
bca718
@@ -4,8 +4,8 @@
bca718
 #include <stdio.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   struct in_addr addr4;
bca718
   struct in6_addr addr6;
bca718
@@ -109,3 +109,6 @@ main (void)
bca718
   
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/rt/tst-timer.c b/rt/tst-timer.c
bca718
index f35d3e7..87f6491 100644
bca718
--- a/rt/tst-timer.c
bca718
+++ b/rt/tst-timer.c
bca718
@@ -20,8 +20,8 @@
bca718
 
bca718
 /* This file is only used if there is no other implementation and it should
bca718
    means that there is no implementation of POSIX timers.  */
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
 #ifdef _POSIX_TIMERS
bca718
   /* There should be a test.  */
bca718
@@ -30,3 +30,6 @@ main (void)
bca718
   return 0;
bca718
 #endif
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/test-fseek.c b/stdio-common/test-fseek.c
bca718
index fe57df6..8a7f1ae 100644
bca718
--- a/stdio-common/test-fseek.c
bca718
+++ b/stdio-common/test-fseek.c
bca718
@@ -19,8 +19,8 @@
bca718
 
bca718
 #define TESTFILE "/tmp/test.dat"
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   FILE *fp;
bca718
   int i, j;
bca718
@@ -82,3 +82,6 @@ main (void)
bca718
   puts ((i > 255) ? "Test succeeded." : "Test FAILED!");
bca718
   return (i > 255) ? 0 : 1;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/test-popen.c b/stdio-common/test-popen.c
bca718
index d36cd61..1f1c88a 100644
bca718
--- a/stdio-common/test-popen.c
bca718
+++ b/stdio-common/test-popen.c
bca718
@@ -49,8 +49,8 @@ read_data (FILE *stream)
bca718
     }
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   FILE *output, *input;
bca718
   int wstatus, rstatus;
bca718
@@ -100,3 +100,6 @@ main (void)
bca718
   puts (wstatus | rstatus  ? "Test FAILED!" : "Test succeeded.");
bca718
   return (wstatus | rstatus);
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/test-vfprintf.c b/stdio-common/test-vfprintf.c
bca718
index a936c28..9cc56d7 100644
bca718
--- a/stdio-common/test-vfprintf.c
bca718
+++ b/stdio-common/test-vfprintf.c
bca718
@@ -36,8 +36,8 @@ const char *locs[] =
bca718
 
bca718
 char large[50000];
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char buf[25];
bca718
   size_t i;
bca718
@@ -124,3 +124,6 @@ main (void)
bca718
 
bca718
   return res;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-cookie.c b/stdio-common/tst-cookie.c
bca718
index dcdabf3..030e684 100644
bca718
--- a/stdio-common/tst-cookie.c
bca718
+++ b/stdio-common/tst-cookie.c
bca718
@@ -63,8 +63,8 @@ cookieclose (void *cookie)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   cookie_io_functions_t fcts;
bca718
   char buf[1];
bca718
@@ -90,3 +90,6 @@ main (void)
bca718
 
bca718
   return errors != 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-fileno.c b/stdio-common/tst-fileno.c
bca718
index a0c8853..753df9f 100644
bca718
--- a/stdio-common/tst-fileno.c
bca718
+++ b/stdio-common/tst-fileno.c
bca718
@@ -28,10 +28,13 @@ check (const char *name, FILE *stream, int fd)
bca718
   return sfd != fd;
bca718
 }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   return (check ("stdin", stdin, STDIN_FILENO) ||
bca718
 	  check ("stdout", stdout, STDOUT_FILENO) ||
bca718
 	  check ("stderr", stderr, STDERR_FILENO));
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-gets.c b/stdio-common/tst-gets.c
bca718
index 7f78fc1..052f1f9 100644
bca718
--- a/stdio-common/tst-gets.c
bca718
+++ b/stdio-common/tst-gets.c
bca718
@@ -21,8 +21,8 @@
bca718
 #include <string.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char buf[100];
bca718
   int result = 0;
bca718
@@ -61,3 +61,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-obprintf.c b/stdio-common/tst-obprintf.c
bca718
index 39e8fda..5151593 100644
bca718
--- a/stdio-common/tst-obprintf.c
bca718
+++ b/stdio-common/tst-obprintf.c
bca718
@@ -4,8 +4,8 @@
bca718
 #include <stdlib.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   struct obstack ob;
bca718
   int n;
bca718
@@ -40,3 +40,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-perror.c b/stdio-common/tst-perror.c
bca718
index b809c2f..416b120 100644
bca718
--- a/stdio-common/tst-perror.c
bca718
+++ b/stdio-common/tst-perror.c
bca718
@@ -24,8 +24,8 @@
bca718
 #define WC_EXP_LEN (sizeof (WC_EXP) - 1)
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int fd;
bca718
   char fname[] = "/tmp/tst-perror.XXXXXX";
bca718
@@ -152,3 +152,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-sprintf.c b/stdio-common/tst-sprintf.c
bca718
index c4e911f..2fe373f 100644
bca718
--- a/stdio-common/tst-sprintf.c
bca718
+++ b/stdio-common/tst-sprintf.c
bca718
@@ -4,8 +4,8 @@
bca718
 #include <string.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char buf[100];
bca718
   int result = 0;
bca718
@@ -73,3 +73,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-sprintf2.c b/stdio-common/tst-sprintf2.c
bca718
index 422278d..0ddf15b 100644
bca718
--- a/stdio-common/tst-sprintf2.c
bca718
+++ b/stdio-common/tst-sprintf2.c
bca718
@@ -3,8 +3,8 @@
bca718
 #include <stdio.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
 #if LDBL_MANT_DIG >= 106
bca718
   volatile union { long double l; long long x[2]; } u, v;
bca718
@@ -82,3 +82,6 @@ main (void)
bca718
 #endif
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-sprintf3.c b/stdio-common/tst-sprintf3.c
bca718
index e54b23b..e927761 100644
bca718
--- a/stdio-common/tst-sprintf3.c
bca718
+++ b/stdio-common/tst-sprintf3.c
bca718
@@ -22,8 +22,8 @@
bca718
 #include <stdio.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
 #if LDBL_MANT_DIG >= 106
bca718
   volatile union { long double l; long long x[2]; } u, v;
bca718
@@ -88,3 +88,6 @@ main (void)
bca718
 #endif
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-swprintf.c b/stdio-common/tst-swprintf.c
bca718
index e65234b..ce62c6b 100644
bca718
--- a/stdio-common/tst-swprintf.c
bca718
+++ b/stdio-common/tst-swprintf.c
bca718
@@ -12,8 +12,8 @@
bca718
 
bca718
 const char input[] = "\x8e\xa1g\x8e\xa2h\x8e\xa3i\x8e\xa4j";
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   wchar_t buf[1000];
bca718
 #define nbuf (sizeof (buf) / sizeof (buf[0]))
bca718
@@ -54,3 +54,6 @@ swprintf (.., .., L\"%ls\", \"%ls\") produced \"%ls\", not \"%ls\"\n",	      \
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-tmpnam.c b/stdio-common/tst-tmpnam.c
bca718
index a3bd9fb..3b97064 100644
bca718
--- a/stdio-common/tst-tmpnam.c
bca718
+++ b/stdio-common/tst-tmpnam.c
bca718
@@ -19,8 +19,8 @@
bca718
 #include <stdlib.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   const char *name;
bca718
   int retval = 0;
bca718
@@ -48,3 +48,6 @@ main (void)
bca718
 
bca718
   return retval;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-unbputc.c b/stdio-common/tst-unbputc.c
bca718
index bbd8622..7200a82 100644
bca718
--- a/stdio-common/tst-unbputc.c
bca718
+++ b/stdio-common/tst-unbputc.c
bca718
@@ -1,11 +1,14 @@
bca718
 #include <stdio.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   putc ('1', stderr);
bca718
   putc ('2', stderr);
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdio-common/tst-wc-printf.c b/stdio-common/tst-wc-printf.c
bca718
index abbeeb5..2a2acb5 100644
bca718
--- a/stdio-common/tst-wc-printf.c
bca718
+++ b/stdio-common/tst-wc-printf.c
bca718
@@ -4,8 +4,8 @@
bca718
 #include <string.h>
bca718
 #include <wctype.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   wchar_t tmp[3];
bca718
   tmp[0] = '8';
bca718
@@ -20,3 +20,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdlib/tst-environ.c b/stdlib/tst-environ.c
bca718
index 3316d7e..b1de2f9 100644
bca718
--- a/stdlib/tst-environ.c
bca718
+++ b/stdlib/tst-environ.c
bca718
@@ -25,8 +25,8 @@
bca718
 
bca718
 char putenv_val[100] = VAR "=some longer value";
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
   const char *valp;
bca718
@@ -219,3 +219,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdlib/tst-fmtmsg.c b/stdlib/tst-fmtmsg.c
bca718
index c3748d6..b7948c5 100644
bca718
--- a/stdlib/tst-fmtmsg.c
bca718
+++ b/stdlib/tst-fmtmsg.c
bca718
@@ -7,8 +7,8 @@
bca718
 
bca718
 #define MM_TEST 10
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -80,3 +80,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdlib/tst-limits.c b/stdlib/tst-limits.c
bca718
index 265b9db..6e51dca 100644
bca718
--- a/stdlib/tst-limits.c
bca718
+++ b/stdlib/tst-limits.c
bca718
@@ -16,8 +16,8 @@ bitval (int bits)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -67,3 +67,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdlib/tst-rand48-2.c b/stdlib/tst-rand48-2.c
bca718
index 3079b98..8b8fef4 100644
bca718
--- a/stdlib/tst-rand48-2.c
bca718
+++ b/stdlib/tst-rand48-2.c
bca718
@@ -3,8 +3,8 @@
bca718
 #include <stdlib.h>
bca718
 #include <time.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   time_t t = time (NULL);
bca718
   int i, ret = 0;
bca718
@@ -111,3 +111,6 @@ main (void)
bca718
 
bca718
   return ret;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdlib/tst-rand48.c b/stdlib/tst-rand48.c
bca718
index 52e1b96..973c62e 100644
bca718
--- a/stdlib/tst-rand48.c
bca718
+++ b/stdlib/tst-rand48.c
bca718
@@ -8,8 +8,8 @@
bca718
 #endif
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   unsigned short int xs[3] = { 0x0001, 0x0012, 0x0123 };
bca718
   unsigned short int lxs[7];
bca718
@@ -388,3 +388,6 @@ drand48() and erand48 in lines %d and %d produce different results\n",
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdlib/tst-random.c b/stdlib/tst-random.c
bca718
index 47195d6..8fe0993 100644
bca718
--- a/stdlib/tst-random.c
bca718
+++ b/stdlib/tst-random.c
bca718
@@ -46,8 +46,8 @@ const unsigned int seed[3] = { 0x12344321U, 0xEE11DD22U, 0xFEDCBA98 };
bca718
 
bca718
 void fail (const char *msg, int s, int i) __attribute__ ((__noreturn__));
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   long int rnd[nseq][nrnd];	/* pseudorandom numbers */
bca718
   char* state[nseq];		/* state for PRNG */
bca718
@@ -117,3 +117,6 @@ fail (const char *msg, int s, int i)
bca718
   printf ("%s (seq %d, pos %d).\n", msg, s, i);
bca718
   exit (1);
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdlib/tst-random2.c b/stdlib/tst-random2.c
bca718
index 0553b62..da840f3 100644
bca718
--- a/stdlib/tst-random2.c
bca718
+++ b/stdlib/tst-random2.c
bca718
@@ -20,8 +20,8 @@
bca718
 #include <stdio.h>
bca718
 #include <stdlib.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int pass;
bca718
   int ret = 0;
bca718
@@ -56,3 +56,6 @@ main (void)
bca718
     }
bca718
   return ret;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdlib/tst-strtol.c b/stdlib/tst-strtol.c
bca718
index eebd8f7..448102a 100644
bca718
--- a/stdlib/tst-strtol.c
bca718
+++ b/stdlib/tst-strtol.c
bca718
@@ -534,8 +534,8 @@ static const struct ltest tests[] =
bca718
 /* Prototypes for local functions.  */
bca718
 static void expand (char *dst, int c);
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   register const struct ltest *lt;
bca718
   char *ep;
bca718
@@ -623,3 +623,6 @@ expand (dst, c)
bca718
   else
bca718
     (void) sprintf (dst, "%#.3o", (unsigned int) c);
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdlib/tst-strtoll.c b/stdlib/tst-strtoll.c
bca718
index 0c77254..93f1a56 100644
bca718
--- a/stdlib/tst-strtoll.c
bca718
+++ b/stdlib/tst-strtoll.c
bca718
@@ -309,8 +309,8 @@ static const struct ltest tests[] =
bca718
 /* Prototypes for local functions.  */
bca718
 static void expand (char *dst, int c);
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   register const struct ltest *lt;
bca718
   char *ep;
bca718
@@ -398,3 +398,6 @@ expand (dst, c)
bca718
   else
bca718
     (void) sprintf (dst, "%#.3o", (unsigned int) c);
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/stdlib/tst-xpg-basename.c b/stdlib/tst-xpg-basename.c
bca718
index 61e2e4b..facc783 100644
bca718
--- a/stdlib/tst-xpg-basename.c
bca718
+++ b/stdlib/tst-xpg-basename.c
bca718
@@ -37,8 +37,8 @@ static struct
bca718
 };
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   size_t i = 0;
bca718
   int errors = 0;
bca718
@@ -64,3 +64,6 @@ main (void)
bca718
 
bca718
   return errors;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/string/test-ffs.c b/string/test-ffs.c
bca718
index 7ac1dd6..a64a1cc 100644
bca718
--- a/string/test-ffs.c
bca718
+++ b/string/test-ffs.c
bca718
@@ -21,8 +21,8 @@
bca718
 #include <stdio.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int failures = 0;
bca718
   int i;
bca718
@@ -61,3 +61,6 @@ main (void)
bca718
 
bca718
   return failures;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/string/tst-bswap.c b/string/tst-bswap.c
bca718
index cca704c..6c1c911 100644
bca718
--- a/string/tst-bswap.c
bca718
+++ b/string/tst-bswap.c
bca718
@@ -21,8 +21,8 @@
bca718
 
bca718
 extern unsigned long long int wash (unsigned long long int a);
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -71,3 +71,6 @@ wash (unsigned long long int a)
bca718
      regards the argument to the bswap_*() functions as constant.  */
bca718
   return a + 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/string/tst-inlcall.c b/string/tst-inlcall.c
bca718
index 32d8863..0f8b1bd 100644
bca718
--- a/string/tst-inlcall.c
bca718
+++ b/string/tst-inlcall.c
bca718
@@ -31,8 +31,8 @@
bca718
 #include <fcntl.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int status;
bca718
   int errors = 0;
bca718
@@ -80,3 +80,6 @@ main (void)
bca718
     }
bca718
   return status;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/string/tst-strtok.c b/string/tst-strtok.c
bca718
index 7e34aee..6fbef9f 100644
bca718
--- a/string/tst-strtok.c
bca718
+++ b/string/tst-strtok.c
bca718
@@ -2,8 +2,8 @@
bca718
 #include <stdio.h>
bca718
 #include <string.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   char buf[1] = { 0 };
bca718
   int result = 0;
bca718
@@ -21,3 +21,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/string/tst-strxfrm.c b/string/tst-strxfrm.c
bca718
index 2ae2e29..f48cfc0 100644
bca718
--- a/string/tst-strxfrm.c
bca718
+++ b/string/tst-strxfrm.c
bca718
@@ -58,8 +58,8 @@ test (const char *locale)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -69,3 +69,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/sysdeps/x86_64/tst-audit10.c b/sysdeps/x86_64/tst-audit10.c
bca718
index 24c9696..8d6721a 100644
bca718
--- a/sysdeps/x86_64/tst-audit10.c
bca718
+++ b/sysdeps/x86_64/tst-audit10.c
bca718
@@ -45,8 +45,8 @@ avx512_enabled (void)
bca718
 
bca718
 extern __m512i audit_test (__m512i, __m512i, __m512i, __m512i,
bca718
 			   __m512i, __m512i, __m512i, __m512i);
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   /* Run AVX512 test only if AVX512 is supported.  */
bca718
   if (avx512_enabled ())
bca718
@@ -62,9 +62,12 @@ main (void)
bca718
   return 0;
bca718
 }
bca718
 #else
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   return 0;
bca718
 }
bca718
 #endif
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../../test-skeleton.c"
bca718
diff --git a/elf/tst-audit3.c b/elf/tst-audit3.c
bca718
index d00db99..0602aa2 100644
bca718
--- a/elf/tst-audit3.c
bca718
+++ b/elf/tst-audit3.c
bca718
@@ -7,8 +7,8 @@
bca718
 
bca718
 extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i,
bca718
 			   __m128i, __m128i, __m128i, __m128i);
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   __m128i xmm = _mm_setzero_si128 ();
bca718
   __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm);
bca718
@@ -18,3 +18,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../../test-skeleton.c"
bca718
diff --git a/elf/tst-audit4.c b/elf/tst-audit4.c
bca718
index c4f1d5b..44d5123 100644
bca718
--- a/elf/tst-audit4.c
bca718
+++ b/elf/tst-audit4.c
bca718
@@ -25,8 +25,8 @@ avx_enabled (void)
bca718
 
bca718
 extern __m256i audit_test (__m256i, __m256i, __m256i, __m256i,
bca718
 			   __m256i, __m256i, __m256i, __m256i);
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   /* Run AVX test only if AVX is supported.  */
bca718
   if (avx_enabled ())
bca718
@@ -41,9 +41,12 @@ main (void)
bca718
   return 0;
bca718
 }
bca718
 #else
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   return 0;
bca718
 }
bca718
 #endif
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../../test-skeleton.c"
bca718
diff --git a/elf/tst-audit5.c b/elf/tst-audit5.c
bca718
index 0094fee..225b4c8 100644
bca718
--- a/elf/tst-audit5.c
bca718
+++ b/elf/tst-audit5.c
bca718
@@ -7,8 +7,8 @@
bca718
 
bca718
 extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i,
bca718
 			   __m128i, __m128i, __m128i, __m128i);
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   __m128i xmm = _mm_setzero_si128 ();
bca718
   __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm);
bca718
@@ -19,3 +19,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../../test-skeleton.c"
bca718
diff --git a/time/tst-ftime_l.c b/time/tst-ftime_l.c
bca718
index fc3d78d..6690efe 100644
bca718
--- a/time/tst-ftime_l.c
bca718
+++ b/time/tst-ftime_l.c
bca718
@@ -6,8 +6,8 @@
bca718
 #include <wchar.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   locale_t l;
bca718
   locale_t old;
bca718
@@ -124,3 +124,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/time/tst-getdate.c b/time/tst-getdate.c
bca718
index fd87923..b3377ee 100644
bca718
--- a/time/tst-getdate.c
bca718
+++ b/time/tst-getdate.c
bca718
@@ -76,8 +76,8 @@ report_date_error (int err)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int errors = 0;
bca718
   size_t i;
bca718
@@ -121,3 +121,6 @@ main (void)
bca718
     printf ("No errors found.\n");
bca718
   return errors != 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/time/tst-mktime.c b/time/tst-mktime.c
bca718
index 416a856..c147360 100644
bca718
--- a/time/tst-mktime.c
bca718
+++ b/time/tst-mktime.c
bca718
@@ -3,8 +3,8 @@
bca718
 #include <string.h>
bca718
 #include <time.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   struct tm time_str, *tm;
bca718
   time_t t;
bca718
@@ -68,3 +68,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/time/tst-mktime3.c b/time/tst-mktime3.c
bca718
index 60d0e0b..c738e53 100644
bca718
--- a/time/tst-mktime3.c
bca718
+++ b/time/tst-mktime3.c
bca718
@@ -17,8 +17,8 @@ struct tm expected[] =
bca718
   { .tm_sec = 5, .tm_mday = 1, .tm_year = 102, .tm_wday = 2 }
bca718
 };
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   setenv ("TZ", "UTC", 1);
bca718
   int i;
bca718
@@ -48,3 +48,6 @@ main (void)
bca718
     }
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/time/tst-posixtz.c b/time/tst-posixtz.c
bca718
index 019d92a..c1ea267 100644
bca718
--- a/time/tst-posixtz.c
bca718
+++ b/time/tst-posixtz.c
bca718
@@ -28,8 +28,8 @@ struct
bca718
     "1999/02/25 15:18:12 dst=0 zone=EST" },
bca718
 };
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
   size_t cnt;
bca718
@@ -116,3 +116,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/time/tst-strptime2.c b/time/tst-strptime2.c
bca718
index 73552bb..bcd6cc8 100644
bca718
--- a/time/tst-strptime2.c
bca718
+++ b/time/tst-strptime2.c
bca718
@@ -26,8 +26,8 @@ static const struct
bca718
 #define ntests (sizeof (tests) / sizeof (tests[0]))
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -57,3 +57,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/time/tst-strptime3.c b/time/tst-strptime3.c
bca718
index 9a8c648..75b57c1 100644
bca718
--- a/time/tst-strptime3.c
bca718
+++ b/time/tst-strptime3.c
bca718
@@ -4,8 +4,8 @@
bca718
 #include <time.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
   struct tm tm;
bca718
@@ -53,3 +53,6 @@ main (void)
bca718
 
bca718
   return 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/wcsmbs/tst-btowc.c b/wcsmbs/tst-btowc.c
bca718
index d793622..dc34f2b 100644
bca718
--- a/wcsmbs/tst-btowc.c
bca718
+++ b/wcsmbs/tst-btowc.c
bca718
@@ -74,8 +74,8 @@ eof_test (void)
bca718
 
bca718
 
bca718
 /* Test the btowc() function for a few locales with known character sets.  */
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -172,3 +172,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/wcsmbs/tst-mbrtowc.c b/wcsmbs/tst-mbrtowc.c
bca718
index 3e1eb72..a30b619 100644
bca718
--- a/wcsmbs/tst-mbrtowc.c
bca718
+++ b/wcsmbs/tst-mbrtowc.c
bca718
@@ -151,8 +151,8 @@ utf8_test (void)
bca718
 }
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -230,3 +230,6 @@ check_ascii (const char *locname)
bca718
 
bca718
   return res != 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/wcsmbs/tst-mbsrtowcs.c b/wcsmbs/tst-mbsrtowcs.c
bca718
index 8d7e2cb..405534d 100644
bca718
--- a/wcsmbs/tst-mbsrtowcs.c
bca718
+++ b/wcsmbs/tst-mbsrtowcs.c
bca718
@@ -21,8 +21,8 @@
bca718
 #include <string.h>
bca718
 #include <wchar.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   const unsigned char buf[] = { 'a', 'b', '\0', 'c', 'd', '\0', 'e' };
bca718
   wchar_t out[sizeof (buf)];
bca718
@@ -62,3 +62,6 @@ main (void)
bca718
     }
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/wcsmbs/tst-wchar-h.c b/wcsmbs/tst-wchar-h.c
bca718
index 4cf2dd0..fd2ad56 100644
bca718
--- a/wcsmbs/tst-wchar-h.c
bca718
+++ b/wcsmbs/tst-wchar-h.c
bca718
@@ -1,9 +1,12 @@
bca718
 #include <stdlib.h>
bca718
 #include <wchar.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   mbstate_t x;
bca718
   return sizeof (x) - sizeof (mbstate_t);
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/wcsmbs/tst-wcpncpy.c b/wcsmbs/tst-wcpncpy.c
bca718
index 74765e7..4cf4aec 100644
bca718
--- a/wcsmbs/tst-wcpncpy.c
bca718
+++ b/wcsmbs/tst-wcpncpy.c
bca718
@@ -20,8 +20,8 @@
bca718
 #include <wchar.h>
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -74,3 +74,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/wcsmbs/tst-wcrtomb.c b/wcsmbs/tst-wcrtomb.c
bca718
index 3f052f3..cad343e 100644
bca718
--- a/wcsmbs/tst-wcrtomb.c
bca718
+++ b/wcsmbs/tst-wcrtomb.c
bca718
@@ -26,8 +26,8 @@
bca718
 static int check_ascii (const char *locname);
bca718
 
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
 
bca718
@@ -92,3 +92,6 @@ check_ascii (const char *locname)
bca718
 
bca718
   return res != 0;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/wcsmbs/tst-wcsnlen.c b/wcsmbs/tst-wcsnlen.c
bca718
index 60e64ad..8d4b8b5 100644
bca718
--- a/wcsmbs/tst-wcsnlen.c
bca718
+++ b/wcsmbs/tst-wcsnlen.c
bca718
@@ -27,8 +27,8 @@
bca718
       printf ("wcsnlen (L\"%s\", %d) = %d, not %d\n", Str, Max, n, Exp);      \
bca718
     }
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
   int n;
bca718
@@ -48,3 +48,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"
bca718
diff --git a/wcsmbs/tst-wcstof.c b/wcsmbs/tst-wcstof.c
bca718
index 197cb5c..576a58c 100644
bca718
--- a/wcsmbs/tst-wcstof.c
bca718
+++ b/wcsmbs/tst-wcstof.c
bca718
@@ -4,8 +4,8 @@
bca718
 #include <string.h>
bca718
 #include <wctype.h>
bca718
 
bca718
-int
bca718
-main (void)
bca718
+static int
bca718
+do_test (void)
bca718
 {
bca718
   int result = 0;
bca718
   char buf[100];
bca718
@@ -21,3 +21,6 @@ main (void)
bca718
 
bca718
   return result;
bca718
 }
bca718
+
bca718
+#define TEST_FUNCTION do_test ()
bca718
+#include "../test-skeleton.c"