diff --git a/add-test-cases.patch b/add-test-cases.patch new file mode 100644 index 0000000000000000000000000000000000000000..1e12f497c26b821b3582b56654aff4f86b051fc8 --- /dev/null +++ b/add-test-cases.patch @@ -0,0 +1,768 @@ +From 694367df75b425f05efd934f1f4442d28c633717 Mon Sep 17 00:00:00 2001 +From: yaowenbin +Date: Tue, 1 Mar 2022 08:30:38 +0000 +Subject: [PATCH 1/1] add test cases + +The following test cases are added to test more interfaces of npth: +t-condlock.c test npth condlock interfaces +t-fork-enhance.c test npth fork interfaces +t-rwlock.c test npth rwlock interfaces +t-signal.c test npth signal interfaces +t-socket.c test npth socket interfaces + +Signed-off-by: yaowenbin +--- + tests/Makefile.am | 3 +- + tests/t-condlock.c | 104 ++++++++++++++++ + tests/t-fork-enhance.c | 68 +++++++++++ + tests/t-rwlock.c | 196 ++++++++++++++++++++++++++++++ + tests/t-signal.c | 49 ++++++++ + tests/t-socket.c | 270 +++++++++++++++++++++++++++++++++++++++++ + 6 files changed, 689 insertions(+), 1 deletion(-) + create mode 100644 tests/t-condlock.c + create mode 100644 tests/t-fork-enhance.c + create mode 100644 tests/t-rwlock.c + create mode 100644 tests/t-signal.c + create mode 100644 tests/t-socket.c + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 8092a3c..f37e798 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -18,7 +18,7 @@ + + ## Process this file with automake to produce Makefile.in + +-TESTS = t-mutex t-thread ++TESTS = t-mutex t-thread t-condlock t-rwlock t-signal t-socket + + # We explicitly require POSIX.1-2001 so that pthread_rwlock_t is + # available when build with c99. +@@ -31,6 +31,7 @@ AM_CPPFLAGS = -I../src -D_POSIX_C_SOURCE=200112L + AM_LDFLAGS = + LDADD = ../src/libnpth.la $(LIBSOCKET) $(LIB_CLOCK_GETTIME) + TESTS += t-fork ++TESTS += t-fork-enhance + endif + + noinst_HEADERS = t-support.h +diff --git a/tests/t-condlock.c b/tests/t-condlock.c +new file mode 100644 +index 0000000..483e58d +--- /dev/null ++++ b/tests/t-condlock.c +@@ -0,0 +1,104 @@ ++/* t-condlock.c ++ * ++ * This file is free software; as a special exception the author gives ++ * unlimited permission to copy and/or distribute it, with or without ++ * modifications, as long as this notice is preserved. ++ * ++ * This file is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the ++ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ */ ++ ++#include "t-support.h" ++ ++ ++static int counter; ++static npth_mutex_t cond_mutex; ++static npth_cond_t cond = NPTH_COND_INITIALIZER; ++ ++static void * ++thread_one (void *arg) ++{ ++ int rc, i; ++ struct timespec tout; ++ ++ rc = npth_mutex_lock (&cond_mutex); ++ if (counter == 0) ++ npth_cond_wait(&cond, &cond_mutex); ++ counter--; ++ info_msg ("count dec"); ++ clock_gettime(CLOCK_REALTIME, &tout); ++ tout.tv_sec += 1; ++ npth_cond_timedwait (&cond, &cond_mutex, &tout); ++ npth_mutex_unlock (&cond_mutex); ++ return (void*)4711; ++} ++ ++static void * ++thread_two (void *arg) ++{ ++ int rc, i; ++ ++ rc = npth_mutex_lock (&cond_mutex); ++ counter++; ++ info_msg ("count inc"); ++ if (counter != 0) ++ npth_cond_signal(&cond); ++ npth_mutex_unlock (&cond_mutex); ++ return (void*)4722; ++} ++ ++int ++main (int argc, char *argv[]) ++{ ++ int rc; ++ npth_attr_t tattr; ++ int state; ++ npth_t tid1, tid2; ++ void *retval; ++ ++ if (argc >= 2 && !strcmp (argv[1], "--verbose")) ++ opt_verbose = 1; ++ ++ rc = npth_init (); ++ fail_if_err (rc); ++ ++ rc = npth_mutex_init (&cond_mutex, NULL); ++ fail_if_err (rc); ++ ++ rc = npth_attr_init (&tattr); ++ fail_if_err (rc); ++ rc = npth_attr_getdetachstate (&tattr, &state); ++ fail_if_err (rc); ++ if ( state != NPTH_CREATE_JOINABLE ) ++ fail_msg ("new tattr is not joinable"); ++ ++ info_msg ("creating thread-one"); ++ rc = npth_create (&tid1, &tattr, thread_one, NULL); ++ fail_if_err (rc); ++ npth_setname_np (tid1, "thread-one"); ++ ++ npth_usleep(100); ++ ++ info_msg ("creating thread-two"); ++ rc = npth_create (&tid2, &tattr, thread_two, NULL); ++ fail_if_err (rc); ++ npth_setname_np (tid2, "thread-two"); ++ ++ rc = npth_attr_destroy (&tattr); ++ fail_if_err (rc); ++ ++ info_msg ("waiting for thread-one to terminate"); ++ rc = npth_join (tid1, &retval); ++ fail_if_err (rc); ++ if (retval != (void*)4711) ++ fail_msg ("thread-one returned an unexpected value"); ++ ++ info_msg ("waiting for thread-two to terminate"); ++ rc = npth_join (tid2, &retval); ++ fail_if_err (rc); ++ if (retval != (void*)4722) ++ fail_msg ("thread-two returned an unexpected value"); ++ ++ return 0; ++} +diff --git a/tests/t-fork-enhance.c b/tests/t-fork-enhance.c +new file mode 100644 +index 0000000..0c0a957 +--- /dev/null ++++ b/tests/t-fork-enhance.c +@@ -0,0 +1,68 @@ ++/* t-fork-enhance.c ++ * ++ * This file is free software; as a special exception the author gives ++ * unlimited permission to copy and/or distribute it, with or without ++ * modifications, as long as this notice is preserved. ++ * ++ * This file is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the ++ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ */ ++ ++#include ++#include ++#include ++#include "t-support.h" ++ ++/* This is a test if nPth can allow daemon-like applications ++ initializing earlier. ++ ++ For daemon-like applications, ideally, it is expected to call ++ npth_init after fork. This condition is not satisfied sometimes. ++ ++ Failure of this test means nPth implementation doesn't allow ++ npth_init after fork. In such a case, application should be ++ modified. ++ */ ++ ++int ++main (int argc, const char *argv[]) ++{ ++ int rc; ++ pid_t pid; ++ struct timespec ts; ++ ++ if (argc >= 2 && !strcmp (argv[1], "--verbose")) ++ opt_verbose = 1; ++ ++ rc = npth_init (); ++ fail_if_err (rc); ++ ++ rc = npth_system("pwd"); ++ fail_if_err (rc); ++ ++ npth_clock_gettime (&ts); ++ ++ npth_unprotect (); ++ npth_protect (); ++ npth_is_protected (); ++ ++ pid = fork (); ++ if (pid == (pid_t)-1) ++ fail_msg ("fork failed"); ++ else if (pid) ++ { ++ int status; ++ ++ info_msg ("forked"); ++ npth_waitpid(pid, &status, 0); ++ fail_if_err (status); ++ } ++ else ++ { ++ info_msg ("child exit"); ++ npth_usleep (1000); /* Let NPTH enter, sleep, and leave. */ ++ } ++ ++ return 0; ++} +diff --git a/tests/t-rwlock.c b/tests/t-rwlock.c +new file mode 100644 +index 0000000..6b06e05 +--- /dev/null ++++ b/tests/t-rwlock.c +@@ -0,0 +1,196 @@ ++/* t-rwlock.c ++ * ++ * This file is free software; as a special exception the author gives ++ * unlimited permission to copy and/or distribute it, with or without ++ * modifications, as long as this notice is preserved. ++ * ++ * This file is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the ++ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ */ ++ ++#include "t-support.h" ++ ++#define BUFLEN 100 ++ ++static int counter; ++static npth_mutex_t counter_mutex; ++static int thread_twoone_ready; ++static npth_rwlock_t counter_rwlock; ++ ++static void * ++thread_one (void *arg) ++{ ++ int rc, i; ++ struct timespec tout; ++ ++ clock_gettime(CLOCK_REALTIME, &tout); ++ tout.tv_sec += 1; ++ rc = npth_rwlock_timedrdlock (&counter_rwlock, &tout); ++ if (rc == 0) ++ npth_rwlock_unlock(&counter_rwlock); ++ ++ clock_gettime(CLOCK_REALTIME, &tout); ++ tout.tv_sec += 1; ++ rc = npth_rwlock_timedwrlock (&counter_rwlock, &tout); ++ if (rc == 0) ++ npth_rwlock_unlock(&counter_rwlock); ++ ++ info_msg ("thread-one started"); ++ npth_usleep (10); /* Give the other thread some time to start. */ ++ for (i=0; i < 10; i++) ++ { ++ /* We would not need the mutex here, but we use it to allow the ++ system to switch to another thread. */ ++ rc = npth_mutex_lock (&counter_mutex); ++ fail_if_err (rc); ++ ++ counter++; ++ ++ rc = npth_mutex_unlock (&counter_mutex); ++ fail_if_err (rc); ++ } ++ ++ info_msg ("thread-one terminated"); ++ ++ return (void*)4711; ++} ++ ++ ++static void * ++thread_twoone (void *arg) ++{ ++ int rc, i; ++ ++ npth_setname_np (npth_self (), "thread-twoone"); ++ info_msg ("thread-twoone started"); ++ ++ rc = npth_detach (npth_self ()); ++ fail_if_err (rc); ++ ++ while (counter < 100) ++ { ++ npth_usleep (1000); ++ counter++; ++ } ++ info_msg ("thread-twoone terminated"); ++ thread_twoone_ready = 1; ++ ++ npth_exit (&rc); ++ return NULL; ++} ++ ++ ++static void * ++thread_two (void *arg) ++{ ++ int rc, i; ++ ++ info_msg ("thread-two started"); ++ ++ for (i=0; i < 10; i++) ++ { ++ rc = npth_mutex_lock (&counter_mutex); ++ fail_if_err (rc); ++ ++ counter--; ++ ++ if (i == 5) ++ { ++ npth_t tid; ++ ++ info_msg ("creating thread-twoone"); ++ rc = npth_create (&tid, NULL, thread_twoone, NULL); ++ fail_if_err (rc); ++ npth_usleep (10); /* Give new thread some time to start. */ ++ } ++ ++ rc = npth_mutex_unlock (&counter_mutex); ++ fail_if_err (rc); ++ } ++ ++ info_msg ("busy waiting for thread twoone"); ++ while (!thread_twoone_ready) ++ npth_sleep (0); ++ ++ info_msg ("thread-two terminated"); ++ ++ return (void*)4722; ++} ++ ++int ++main (int argc, char *argv[]) ++{ ++ int rc; ++ npth_attr_t tattr; ++ int state; ++ npth_t tid1, tid2; ++ void *retval; ++ char bufname[BUFLEN]; ++ struct timespec tout; ++ ++ if (argc >= 2 && !strcmp (argv[1], "--verbose")) ++ opt_verbose = 1; ++ ++ rc = npth_init (); ++ fail_if_err (rc); ++ ++ rc = npth_mutex_init (&counter_mutex, NULL); ++ fail_if_err (rc); ++ ++ clock_gettime(CLOCK_REALTIME, &tout); ++ tout.tv_sec += 1; ++ rc = npth_mutex_timedlock (&counter_mutex, &tout); ++ npth_mutex_unlock (&counter_mutex); ++ ++ rc = npth_rwlock_init(&counter_rwlock, NULL); ++ fail_if_err (rc); ++ ++ npth_rwlock_rdlock(&counter_rwlock); ++ npth_rwlock_unlock(&counter_rwlock); ++ ++ npth_rwlock_wrlock(&counter_rwlock); ++ npth_rwlock_unlock(&counter_rwlock); ++ ++ rc = npth_attr_init (&tattr); ++ fail_if_err (rc); ++ rc = npth_attr_getdetachstate (&tattr, &state); ++ fail_if_err (rc); ++ if ( state != NPTH_CREATE_JOINABLE ) ++ fail_msg ("new tattr is not joinable"); ++ ++ info_msg ("creating thread-one"); ++ rc = npth_create (&tid1, &tattr, thread_one, NULL); ++ fail_if_err (rc); ++ npth_setname_np (tid1, "thread-one"); ++ npth_getname_np (tid1, bufname, BUFLEN); ++ ++ npth_rwlock_wrlock(&counter_rwlock); ++ npth_sleep(5); ++ npth_rwlock_unlock(&counter_rwlock); ++ ++ info_msg ("creating thread-two"); ++ rc = npth_create (&tid2, &tattr, thread_two, NULL); ++ fail_if_err (rc); ++ npth_setname_np (tid2, "thread-two"); ++ ++ rc = npth_attr_destroy (&tattr); ++ fail_if_err (rc); ++ ++ info_msg ("waiting for thread-one to terminate"); ++ rc = npth_join (tid1, &retval); ++ fail_if_err (rc); ++ if (retval != (void*)4711) ++ fail_msg ("thread-one returned an unexpected value"); ++ ++ info_msg ("waiting for thread-two to terminate"); ++ rc = npth_join (tid2, &retval); ++ fail_if_err (rc); ++ if (retval != (void*)4722) ++ fail_msg ("thread-two returned an unexpected value"); ++ ++ if (counter != 100) ++ fail_msg ("counter value not as expected"); ++ ++ return 0; ++} +diff --git a/tests/t-signal.c b/tests/t-signal.c +new file mode 100644 +index 0000000..45c7c97 +--- /dev/null ++++ b/tests/t-signal.c +@@ -0,0 +1,49 @@ ++/* t-signal.c ++ * ++ * This file is free software; as a special exception the author gives ++ * unlimited permission to copy and/or distribute it, with or without ++ * modifications, as long as this notice is preserved. ++ * ++ * This file is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the ++ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ */ ++ ++#include ++#include ++#include ++#include "t-support.h" ++ ++/* This is a test if nPth can allow daemon-like applications ++ initializing earlier. ++ ++ For daemon-like applications, ideally, it is expected to call ++ npth_init after fork. This condition is not satisfied sometimes. ++ ++ Failure of this test means nPth implementation doesn't allow ++ npth_init after fork. In such a case, application should be ++ modified. ++ */ ++ ++int ++main (int argc, const char *argv[]) ++{ ++ int rc; ++ pid_t pid; ++ int r_signum; ++ ++ if (argc >= 2 && !strcmp (argv[1], "--verbose")) ++ opt_verbose = 1; ++ ++ rc = npth_init (); ++ fail_if_err (rc); ++ ++ npth_sigev_init(); ++ npth_sigev_add (5); ++ npth_sigev_add (7); ++ npth_sigev_fini (); ++ npth_sigev_sigmask (); ++ npth_sigev_get_pending (&r_signum); ++ ++ return 0; ++} +diff --git a/tests/t-socket.c b/tests/t-socket.c +new file mode 100644 +index 0000000..c7bfc15 +--- /dev/null ++++ b/tests/t-socket.c +@@ -0,0 +1,270 @@ ++/* t-socket.c ++ * ++ * This file is free software; as a special exception the author gives ++ * unlimited permission to copy and/or distribute it, with or without ++ * modifications, as long as this notice is preserved. ++ * ++ * This file is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the ++ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ */ ++ ++#include "t-support.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define NAME "Socket" ++#define DATA "Hello, little Baby . . ." ++ ++static void * ++thread_one (void *arg) ++{ ++ int sock, msgsock, rval; ++ struct sockaddr_un server; ++ char buf[1024]; ++ struct timeval tv; ++ struct timespec ts; ++ ++ info_msg ("thread-one started"); ++ tv.tv_sec = 0; ++ tv.tv_usec = 100; ++ ts.tv_sec = 0; ++ ts.tv_nsec = 1000; ++ ++ sock = socket(AF_UNIX, SOCK_STREAM, 0); ++ if (sock < 0) { ++ perror("opening stream socket"); ++ exit(1); ++ } ++ server.sun_family = AF_UNIX; ++ strcpy(server.sun_path, NAME); ++ if (bind(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un))) { ++ perror("binding stream socket"); ++ exit(1); ++ } ++ printf("Socket has name %s\n", server.sun_path); ++ listen(sock, 5); ++ msgsock = npth_accept(sock, 0, 0); ++ if (msgsock == -1) ++ perror("accept"); ++ else do { ++ bzero(buf, sizeof(buf)); ++ if ((rval = npth_read(msgsock, buf, 1024)) < 0) ++ perror("reading stream message"); ++ else if (rval == 0) ++ printf("Ending connection\n"); ++ else ++ printf("-->%s\n", buf); ++ } while (rval > 0); ++ ++ npth_select(0, NULL, NULL, NULL, &tv); ++ npth_pselect(0, NULL, NULL, NULL, &ts, NULL); ++ close(msgsock); ++ close(sock); ++ unlink(NAME); ++ info_msg ("thread-one terminated"); ++ ++ return (void*)4711; ++} ++ ++ ++static void * ++thread_two (void *arg) ++{ ++ ++ int sock; ++ struct sockaddr_un server; ++ char buf[1024]; ++ ++ info_msg ("thread-two started"); ++ sock = socket(AF_UNIX, SOCK_STREAM, 0); ++ if (sock < 0) { ++ perror("opening stream socket"); ++ exit(1); ++ } ++ server.sun_family = AF_UNIX; ++ strcpy(server.sun_path, NAME); ++ ++ if (npth_connect(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) { ++ close(sock); ++ perror("connecting stream socket"); ++ exit(1); ++ } ++ if (npth_write(sock, DATA, sizeof(DATA)) < 0) ++ perror("writing on stream socket"); ++ close(sock); ++ ++ info_msg ("thread-two terminated"); ++ ++ return (void*)4722; ++} ++ ++static void * ++thread_three (void *arg) ++{ ++ int sock, msgsock, rval; ++ struct sockaddr_un server; ++ char buf[1024]; ++ struct msghdr msg; ++ struct iovec io; ++ ++ msg.msg_name = NULL; ++ io.iov_base = buf; ++ io.iov_len = 1024; ++ msg.msg_iov = &io; ++ msg.msg_iovlen = 1; ++ ++ info_msg ("thread-three started"); ++ ++ sock = socket(AF_UNIX, SOCK_STREAM, 0); ++ if (sock < 0) { ++ perror("opening stream socket"); ++ exit(1); ++ } ++ server.sun_family = AF_UNIX; ++ strcpy(server.sun_path, NAME); ++ if (bind(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un))) { ++ perror("binding stream socket"); ++ exit(1); ++ } ++ printf("Socket has name %s\n", server.sun_path); ++ listen(sock, 5); ++ msgsock = npth_accept(sock, 0, 0); ++ if (msgsock == -1) ++ perror("accept"); ++ else { ++ bzero(buf, sizeof(buf)); ++ ssize_t recv_size = npth_recvmsg(msgsock, &msg, 0); ++ char * temp = msg.msg_iov[0].iov_base; ++ temp[recv_size] = '\0'; ++ printf("get message:%s", temp); ++ }; ++ ++ close(msgsock); ++ close(sock); ++ unlink(NAME); ++ info_msg ("thread-three terminated"); ++ ++ return (void*)4711; ++} ++ ++ ++static void * ++thread_four (void *arg) ++{ ++ ++ int sock; ++ struct sockaddr_un server; ++ char buf[1024] = "test sendmsg and recvmsg\n"; ++ struct msghdr msg; ++ struct iovec io; ++ ++ msg.msg_name = NULL; ++ io.iov_base = buf; ++ io.iov_len = sizeof(buf); ++ msg.msg_iov = &io; ++ msg.msg_iovlen = 1; ++ ++ info_msg ("thread-four started"); ++ sock = socket(AF_UNIX, SOCK_STREAM, 0); ++ if (sock < 0) { ++ perror("opening stream socket"); ++ exit(1); ++ } ++ server.sun_family = AF_UNIX; ++ strcpy(server.sun_path, NAME); ++ ++ if (npth_connect(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) { ++ close(sock); ++ perror("connecting stream socket"); ++ exit(1); ++ } ++ npth_sendmsg(sock, &msg, 0); ++ close(sock); ++ ++ info_msg ("thread-four terminated"); ++ ++ return (void*)4722; ++} ++ ++int ++main (int argc, char *argv[]) ++{ ++ int rc; ++ npth_attr_t tattr; ++ int state; ++ npth_t tid1, tid2; ++ npth_t tid3, tid4; ++ void *retval; ++ ++ if (argc >= 2 && !strcmp (argv[1], "--verbose")) ++ opt_verbose = 1; ++ ++ rc = npth_init (); ++ fail_if_err (rc); ++ ++ rc = npth_attr_init (&tattr); ++ fail_if_err (rc); ++ rc = npth_attr_getdetachstate (&tattr, &state); ++ fail_if_err (rc); ++ if ( state != NPTH_CREATE_JOINABLE ) ++ fail_msg ("new tattr is not joinable"); ++ ++ info_msg ("creating thread-one"); ++ rc = npth_create (&tid1, &tattr, thread_one, NULL); ++ fail_if_err (rc); ++ npth_setname_np (tid1, "thread-one"); ++ ++ npth_usleep(100); ++ ++ info_msg ("creating thread-two"); ++ rc = npth_create (&tid2, &tattr, thread_two, NULL); ++ fail_if_err (rc); ++ npth_setname_np (tid2, "thread-two"); ++ ++ rc = npth_attr_destroy (&tattr); ++ fail_if_err (rc); ++ ++ info_msg ("waiting for thread-one to terminate"); ++ rc = npth_join (tid1, &retval); ++ fail_if_err (rc); ++ if (retval != (void*)4711) ++ fail_msg ("thread-one returned an unexpected value"); ++ ++ info_msg ("waiting for thread-two to terminate"); ++ rc = npth_join (tid2, &retval); ++ fail_if_err (rc); ++ if (retval != (void*)4722) ++ fail_msg ("thread-two returned an unexpected value"); ++ ++ info_msg ("creating thread-three"); ++ rc = npth_create (&tid3, NULL, thread_three, NULL); ++ fail_if_err (rc); ++ npth_setname_np (tid3, "thread-three"); ++ ++ npth_usleep(100); ++ ++ info_msg ("creating thread-four"); ++ rc = npth_create (&tid4, NULL, thread_four, NULL); ++ fail_if_err (rc); ++ npth_setname_np (tid4, "thread-two"); ++ ++ info_msg ("waiting for thread-three to terminate"); ++ rc = npth_join (tid3, &retval); ++ fail_if_err (rc); ++ if (retval != (void*)4711) ++ fail_msg ("thread-three returned an unexpected value"); ++ ++ info_msg ("waiting for thread-four to terminate"); ++ rc = npth_join (tid4, &retval); ++ fail_if_err (rc); ++ if (retval != (void*)4722) ++ fail_msg ("thread-four returned an unexpected value"); ++ ++ return 0; ++} +-- +2.23.0 + diff --git a/npth.spec b/npth.spec index 68c2379d6d93b5a7743ba03674926e873df83508..ba934d9e78bf18f9d690433f9c95d5044591d103 100644 --- a/npth.spec +++ b/npth.spec @@ -6,7 +6,7 @@ License: LGPLv2+ URL: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=npth.git Source: https://gnupg.org/ftp/gcrypt/npth/%{name}-%{version}.tar.bz2 -BuildRequires: make gcc +BuildRequires: make gcc automake %description The NPth package contains a very portable POSIX/ANSI-C based @@ -20,6 +20,7 @@ stack, signal mask and errno variable. %package devel Summary: Development files for %{name} Patch6000: backport-0001-w32-Use-cast-by-uintptr_t-for-thread-ID.patch +Patch6001: add-test-cases.patch Requires: %{name}%{?_isa} = %{version}-%{release} @@ -30,6 +31,9 @@ developing applications that use %{name}. %prep %autosetup -n %{name}-%{version} -p1 +aclocal +automake + %build %configure --disable-static %make_build @@ -57,6 +61,9 @@ make check %{_datadir}/aclocal/%{name}.m4 %changelog +* Tue Mar 1 2022 yaowenbinHW - 1.6-4 +- DESC: add test cases + * Fri Jul 30 2021 chenyanpanHW - 1.6-3 - DESC: delete -Sgit from %autosetup, and delete BuildRequires git