diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-09-04 15:18:54 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-09-04 15:18:54 +0200 |
commit | 36043b37739dffdaea8d31457570810e492268d7 (patch) | |
tree | 0045cba85b862ecca89cf7b5aff336bddbabad89 /test | |
parent | a5352e212fcd4da83c8ff4fe542ef23c8e3187f8 (diff) | |
parent | 6d550ddd129b18cf800eab604f74536754526cd8 (diff) |
Merge remote-tracking branch 'origin/upstream'
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile | 2 | ||||
-rw-r--r-- | test/README | 5 | ||||
-rw-r--r-- | test/librt/Makefile.in | 4 | ||||
-rw-r--r-- | test/math/Makefile.in | 3 | ||||
-rw-r--r-- | test/nptl/tst-cancel4.c | 28 | ||||
-rw-r--r-- | test/nptl/tst-sem3.c | 33 | ||||
-rw-r--r-- | test/nptl/tst-sem4.c | 7 | ||||
-rw-r--r-- | test/time/Makefile.in | 2 |
8 files changed, 60 insertions, 24 deletions
diff --git a/test/Makefile b/test/Makefile index b759bf9ea..787c530d4 100644 --- a/test/Makefile +++ b/test/Makefile @@ -45,7 +45,7 @@ endif test check all: run -run: compile subdirs_run +run: subdirs_run compile: $(top_builddir)$(LOCAL_INSTALL_PATH) subdirs_compile diff --git a/test/README b/test/README index 8fb12d9a7..28225b063 100644 --- a/test/README +++ b/test/README @@ -5,12 +5,11 @@ Following make targets are avaialable make compile -This will compile and link the tests +This will compile and link the tests. make run -This will check for binaries, if they are not there it -will call 'compile' target, then it will execute all the tests. +This will execute all the tests. make check make all diff --git a/test/librt/Makefile.in b/test/librt/Makefile.in index 15ecbae5b..f25522cbe 100644 --- a/test/librt/Makefile.in +++ b/test/librt/Makefile.in @@ -2,3 +2,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. LDFLAGS_shmtest := -lrt + +ifeq ($(ARCH_USE_MMU),) +TESTS_DISABLED := shmtest +endif diff --git a/test/math/Makefile.in b/test/math/Makefile.in index d241baa9e..147d579f4 100644 --- a/test/math/Makefile.in +++ b/test/math/Makefile.in @@ -13,6 +13,9 @@ endif ifeq ($(DO_C99_MATH),) TESTS_DISABLED += test-float test-ifloat test-double test-idouble rint signgam ilogb endif +ifeq ($(UCLIBC_HAS_FPU),) +TESTS_DISABLED += test-fpucw +endif DODIFF_rint := 1 DODIFF_signgam := 1 diff --git a/test/nptl/tst-cancel4.c b/test/nptl/tst-cancel4.c index e7119589f..4ba40450e 100644 --- a/test/nptl/tst-cancel4.c +++ b/test/nptl/tst-cancel4.c @@ -83,7 +83,30 @@ static pthread_barrier_t b2; # define IPC_ADDVAL 0 #endif -#define WRITE_BUFFER_SIZE 4096 +/* The WRITE_BUFFER_SIZE value needs to be chosen such that if we set + the socket send buffer size to '1', a write of this size on that + socket will block. + + The Linux kernel imposes a minimum send socket buffer size which + has changed over the years. As of Linux 3.10 the value is: + + 2 * (2048 + SKB_DATA_ALIGN(sizeof(struct sk_buff))) + + which is attempting to make sure that with standard MTUs, + TCP can always queue up at least 2 full sized packets. + + Furthermore, there is logic in the socket send paths that + will allow one more packet (of any size) to be queued up as + long as some socket buffer space remains. Blocking only + occurs when we try to queue up a new packet and the send + buffer space has already been fully consumed. + + Therefore we must set this value to the largest possible value of + the formula above (and since it depends upon the size of "struct + sk_buff", it is dependent upon machine word size etc.) plus some + slack space. */ + +#define WRITE_BUFFER_SIZE 16384 /* Cleanup handling test. */ static int cl_called; @@ -758,7 +781,6 @@ tf_sigpause (void *arg) pthread_cleanup_push (cl, NULL); - /* Just for fun block the cancellation signal. */ sigpause (SIGCANCEL); pthread_cleanup_pop (0); @@ -993,6 +1015,8 @@ tf_accept (void *arg) if (++tries > 10) { printf ("%s: too many unsuccessful bind calls\n", __FUNCTION__); + /* prevent endless loop, when bind fails forever */ + exit (1); } strcpy (sun.sun_path, "/tmp/tst-cancel4-socket-1-XXXXXX"); diff --git a/test/nptl/tst-sem3.c b/test/nptl/tst-sem3.c index d14f6f633..7b75e29e2 100644 --- a/test/nptl/tst-sem3.c +++ b/test/nptl/tst-sem3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2002-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -28,7 +28,7 @@ int -main (void) +do_test (void) { size_t ps = sysconf (_SC_PAGESIZE); char tmpfname[] = "/tmp/tst-sem3.XXXXXX"; @@ -43,7 +43,7 @@ main (void) if (fd == -1) { printf ("cannot open temporary file: %m\n"); - exit (1); + return 1; } /* Make sure it is always removed. */ @@ -56,14 +56,14 @@ main (void) if (write (fd, data, ps) != (ssize_t) ps) { puts ("short write"); - exit (1); + return 1; } mem = mmap (NULL, ps, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (mem == MAP_FAILED) { printf ("mmap failed: %m\n"); - exit (1); + return 1; } s = (sem_t *) (((uintptr_t) mem + __alignof (sem_t)) @@ -73,25 +73,25 @@ main (void) if (sem_init (s, 1, 1) == -1) { puts ("init failed"); - exit (1); + return 1; } if (TEMP_FAILURE_RETRY (sem_wait (s)) == -1) { puts ("1st wait failed"); - exit (1); + return 1; } errno = 0; if (TEMP_FAILURE_RETRY (sem_trywait (s)) != -1) { puts ("trywait succeeded"); - exit (1); + return 1; } else if (errno != EAGAIN) { puts ("trywait didn't return EAGAIN"); - exit (1); + return 1; } *p = 0; @@ -101,7 +101,7 @@ main (void) if (pid == -1) { puts ("fork failed"); - exit (1); + return 1; } else if (pid == 0) { @@ -109,13 +109,13 @@ main (void) if ((*p)++ != 0) { puts ("child: *p != 0"); - exit (1); + return 1; } if (sem_post (s) == -1) { puts ("child: 1st post failed"); - exit (1); + return 1; } puts ("child done"); @@ -125,17 +125,20 @@ main (void) if (TEMP_FAILURE_RETRY (sem_wait (s)) == -1) { printf ("parent: 2nd wait failed: %m\n"); - exit (1); + return 1; } if (*p != 1) { puts ("*p != 1"); - exit (1); + return 1; } puts ("parent done"); } - exit (0); + return 0; } + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/test/nptl/tst-sem4.c b/test/nptl/tst-sem4.c index 125759bab..72ed97d37 100644 --- a/test/nptl/tst-sem4.c +++ b/test/nptl/tst-sem4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -32,7 +32,7 @@ remove_sem (int status, void *arg) int -main (void) +do_test (void) { sem_t *s; sem_t *s2; @@ -144,3 +144,6 @@ main (void) return 0; } + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/test/time/Makefile.in b/test/time/Makefile.in index 05f73a45d..02c8d910c 100644 --- a/test/time/Makefile.in +++ b/test/time/Makefile.in @@ -5,7 +5,7 @@ TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 tst-posixtz \ tst-strftime tst-strptime tst-timezone ifneq ($(UCLIBC_HAS_XLOCALE),y) -TESTS_DISABLED += tst-ftime_l +TESTS_DISABLED += tst-ftime_l tst_wcsftime endif CFLAGS_tst-strptime2 := -std=c99 |