@@ -160,4 +160,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -153,4 +153,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -174,4 +174,5 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+
+#include <support/test-driver.c>
@@ -120,4 +120,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -166,4 +166,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -161,4 +161,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -120,4 +120,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -139,7 +139,7 @@ do_test (size_t align1, size_t align2, size_t len)
putchar ('\n');
}
-int
+static int
test_main (void)
{
size_t i;
@@ -188,4 +188,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -131,4 +131,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -190,4 +190,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -123,4 +123,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -173,4 +173,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -177,4 +177,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -171,4 +171,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -207,4 +207,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -238,4 +238,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -190,4 +190,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -53,8 +53,7 @@ simple_strcpy_chk (char *dst, const char *src, size_t len)
#include <setjmp.h>
#include <signal.h>
-static int test_main (void);
-#include "../test-skeleton.c"
+#include <support/support.h>
volatile int chk_fail_ok;
jmp_buf chk_fail_buf;
@@ -241,3 +240,5 @@ test_main (void)
return 0;
}
+
+#include <support/test-driver.c>
@@ -16,6 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <getopt.h>
#include <sys/cdefs.h>
typedef struct
@@ -55,7 +56,7 @@ extern impl_t __start_impls[], __stop_impls[];
# include "bench-timing.h"
-# define TEST_FUNCTION test_main ()
+# define TEST_FUNCTION test_main
# ifndef TIMEOUT
# define TIMEOUT (4 * 60)
# endif
@@ -87,24 +88,31 @@ size_t iterations = 100000;
# define CMDLINE_OPTIONS ITERATIONS_OPTIONS \
{ "random", no_argument, NULL, OPT_RANDOM }, \
{ "seed", required_argument, NULL, OPT_SEED },
-# define CMDLINE_PROCESS ITERATIONS_PROCESS \
- case OPT_RANDOM: \
- { \
- int fdr = open ("/dev/urandom", O_RDONLY); \
- \
- if (fdr < 0 || read (fdr, &seed, sizeof(seed)) != sizeof (seed)) \
- seed = time (NULL); \
- if (fdr >= 0) \
- close (fdr); \
- do_srandom = 1; \
- break; \
- } \
- \
- case OPT_SEED: \
- seed = strtoul (optarg, NULL, 0); \
- do_srandom = 1; \
- break;
+static void __attribute__ ((used))
+cmdline_process_function (int c)
+{
+ switch (c)
+ {
+ ITERATIONS_PROCESS
+ case OPT_RANDOM:
+ {
+ int fdr = open ("/dev/urandom", O_RDONLY);
+ if (fdr < 0 || read (fdr, &seed, sizeof(seed)) != sizeof (seed))
+ seed = time (NULL);
+ if (fdr >= 0)
+ close (fdr);
+ do_srandom = 1;
+ break;
+ }
+
+ case OPT_SEED:
+ seed = strtoul (optarg, NULL, 0);
+ do_srandom = 1;
+ break;
+ }
+}
+# define CMDLINE_PROCESS cmdline_process_function
# define CALL(impl, ...) \
(* (proto_t) (impl)->fn) (__VA_ARGS__)
@@ -139,4 +139,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -204,4 +204,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -296,4 +296,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -172,7 +172,7 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char)
putchar ('\n');
}
-int
+static int
test_main (void)
{
size_t i;
@@ -207,4 +207,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -150,4 +150,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -203,4 +203,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -181,4 +181,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -171,4 +171,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -189,4 +189,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -174,4 +174,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
@@ -177,4 +177,4 @@ test_main (void)
return ret;
}
-#include "../test-skeleton.c"
+#include <support/test-driver.c>