From patchwork Mon Jan 2 12:54:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wainer dos Santos Moschetta X-Patchwork-Id: 18752 Received: (qmail 58178 invoked by alias); 2 Jan 2017 12:54:46 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 58168 invoked by uid 89); 2 Jan 2017 12:54:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=dl-procinfo.h, dlprocinfoh, UD:dl-procinfo.h, Hx-languages-length:2999 X-HELO: mx0a-001b2d01.pphosted.com From: Wainer dos Santos Moschetta To: libc-alpha@sourceware.org Subject: [PATCH v2] powerpc: Convert tests to the new support test-driver Date: Mon, 2 Jan 2017 10:54:21 -0200 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17010212-0024-0000-0000-000001412395 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17010212-0025-0000-0000-000016062A75 Message-Id: <20170102125421.7585-1-wainersm@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-02_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701020219 Changes since v1: - Uses TEST_VERIFY_EXIT macro to check status of xpthread_join. Notice it is expected status == NULL for a success join. Depends on http://sourceware.org/ml/libc-alpha/2016-12/msg01021.html that introduced the TEST_VERIFY_EXIT macro. -- >8 -- Change the powerpc tests to use . Also replace some of pthread calls to its xpthread equivalent. Tested on ppc64le. 2016-12-15 Wainer dos Santos Moschetta * sysdeps/powerpc/test-get_hwcap.c: Use instead of test-skeleton.c. (do_test): Replaced pthread_create and pthread_join with xpthread_create and xpthread_join. (do_test): Use TEST_VERIFY_EXIT macro. * sysdeps/powerpc/test-gettimebase.c: Use instead of test-skeleton.c. * sysdeps/powerpc/tst-tlsopt-powerpc.c: Likewise. --- sysdeps/powerpc/test-get_hwcap.c | 23 +++++++---------------- sysdeps/powerpc/test-gettimebase.c | 3 +-- sysdeps/powerpc/tst-tlsopt-powerpc.c | 3 +-- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/sysdeps/powerpc/test-get_hwcap.c b/sysdeps/powerpc/test-get_hwcap.c index 14fe73b..f88cabe 100644 --- a/sysdeps/powerpc/test-get_hwcap.c +++ b/sysdeps/powerpc/test-get_hwcap.c @@ -23,6 +23,9 @@ #include #include +#include +#include + #include #include @@ -160,22 +163,11 @@ do_test (void) /* Check for other thread. */ i++; - if (pthread_create (&threads[i], &attr, t1, (void *)i)) - { - printf ("FAIL: error creating thread %ld.\n", i); - return 1; - } + threads[i] = xpthread_create (&attr, t1, (void *)i); pthread_attr_destroy (&attr); - if (pthread_join (threads[i], &status)) - { - printf ("FAIL: error joining thread %ld.\n", i); - return 1; - } - if (status) - { - return 1; - } + status = xpthread_join (threads[i]); + TEST_VERIFY_EXIT (status == NULL); printf("PASS: HWCAP, HWCAP2 and AT_PLATFORM are correctly set in the TCB for" " all threads.\n"); @@ -184,5 +176,4 @@ do_test (void) } -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" +#include diff --git a/sysdeps/powerpc/test-gettimebase.c b/sysdeps/powerpc/test-gettimebase.c index d6e1324..af502a4 100644 --- a/sysdeps/powerpc/test-gettimebase.c +++ b/sysdeps/powerpc/test-gettimebase.c @@ -43,5 +43,4 @@ do_test (void) return 1; } -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" +#include diff --git a/sysdeps/powerpc/tst-tlsopt-powerpc.c b/sysdeps/powerpc/tst-tlsopt-powerpc.c index c9a14cb..8ae928a 100644 --- a/sysdeps/powerpc/tst-tlsopt-powerpc.c +++ b/sysdeps/powerpc/tst-tlsopt-powerpc.c @@ -8,7 +8,6 @@ COMMON_INT_DEF(foo); -#define TEST_FUNCTION do_test () static int do_test (void) { @@ -49,4 +48,4 @@ do_test (void) return result; } -#include "../../test-skeleton.c" +#include