Skip to content

Commit 56eadd9

Browse files
committed
Worked on tests and changes for CI tests
1 parent e3881ef commit 56eadd9

11 files changed

Lines changed: 416 additions & 180 deletions

File tree

.github/workflows/build_freebsd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
./synclibs.sh --use-head
3333
./autogen.sh
3434
./configure ${{ matrix.configure_options }}
35-
make > /dev/null
35+
make -j4 > /dev/null
3636
- name: Run tests
3737
shell: freebsd {0}
3838
run: |
39-
tests/runtests.sh SKIP_MANPAGES_TESTS=1 VERBOSE=1
39+
tests/runtests.sh -j4 VERBOSE=1

.github/workflows/build_linux.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ jobs:
3838
./synclibs.sh --use-head
3939
./autogen.sh
4040
./configure ${{ matrix.configure_options }}
41-
make > /dev/null
41+
make -j4 > /dev/null
4242
- name: Run tests
4343
run: |
44-
tests/runtests.sh VERBOSE=1
44+
tests/runtests.sh -j4 VERBOSE=1
4545
build_dist:
4646
runs-on: ${{ matrix.os }}
4747
strategy:
@@ -66,10 +66,10 @@ jobs:
6666
./synclibs.sh --use-head
6767
./autogen.sh
6868
./configure ${{ matrix.configure_options }}
69-
make > /dev/null
69+
make -j4 > /dev/null
7070
- name: Run tests
7171
run: |
72-
make distcheck VERBOSE=1
72+
make distcheck AM_MAKEFLAGS="-j4" VERBOSE=1
7373
build_shared:
7474
runs-on: ${{ matrix.os }}
7575
strategy:
@@ -97,7 +97,7 @@ jobs:
9797
./synclibs.sh --use-head
9898
./autogen.sh
9999
./configure ${{ matrix.configure_options }}
100-
make > /dev/null
100+
make -j4 > /dev/null
101101
- name: Run tests
102102
run: |
103-
tests/runtests.sh VERBOSE=1
103+
tests/runtests.sh -j4 VERBOSE=1

.github/workflows/build_macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ jobs:
4242
./synclibs.sh --use-head
4343
./autogen.sh
4444
./configure ${{ matrix.configure_options }}
45-
make > /dev/null
45+
make -j4 > /dev/null
4646
- name: Run tests
4747
run: |
48-
tests/runtests.sh SKIP_MANPAGES_TESTS=1 VERBOSE=1
48+
tests/runtests.sh -j4 VERBOSE=1
4949
build_pkgbuild:
5050
runs-on: ${{ matrix.os }}
5151
strategy:
@@ -71,7 +71,7 @@ jobs:
7171
./synclibs.sh --use-head
7272
./autogen.sh
7373
./configure ${{ matrix.configure_options }}
74-
make > /dev/null
74+
make -j4 > /dev/null
7575
- name: Build pkg
7676
run: |
7777
tests/pkgbuild.sh

.github/workflows/build_windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ jobs:
6565
./synclibs.sh --use-head
6666
./autogen.sh
6767
./configure ${CONFIGURE_OPTIONS}
68-
make > /dev/null
68+
make -j4 > /dev/null
6969
- name: Run tests
7070
shell: bash --login -e -o pipefail -o igncr {0}
7171
working-directory: ${{ github.workspace }}
7272
env:
7373
CHERE_INVOKING: 1
7474
run: |
75-
tests/runtests.sh VERBOSE=1
75+
tests/runtests.sh -j4 VERBOSE=1
7676
build_msys2_mingw:
7777
runs-on: windows-latest
7878
strategy:
@@ -100,8 +100,8 @@ jobs:
100100
./synclibs.sh --use-head
101101
./autogen.sh
102102
./configure ${CONFIGURE_OPTIONS}
103-
make > /dev/null
103+
make -j4 > /dev/null
104104
- name: Run tests
105105
shell: msys2 {0}
106106
run: |
107-
tests/runtests.sh SKIP_MANPAGES_TESTS=1 VERBOSE=1
107+
tests/runtests.sh -j4 VERBOSE=1

acinclude.m4

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dnl Checks for required headers and functions
22
dnl
3-
dnl Version: 20260531
3+
dnl Version: 20260610
44

55
dnl Function to detect if libcthreads dependencies are available
66
AC_DEFUN([AX_LIBCTHREADS_CHECK_LOCAL],
@@ -38,46 +38,3 @@ AC_DEFUN([AX_LIBCTHREADS_CHECK_DLL_SUPPORT],
3838
])
3939
])
4040

41-
dnl Function to check if pthread_rwlock_unlock can be hooked for testing
42-
AC_DEFUN([AX_TESTS_CHECK_PTHREAD_RWLOCK_UNLOCK_HOOK],
43-
[AC_REQUIRE([AC_PROG_CC])
44-
45-
AC_MSG_CHECKING([whether pthread_rwlock_unlock can be hooked for testing])
46-
47-
BACKUP_LIBS="$LIBS"
48-
LIBS="-ldl -lpthread $LIBS"
49-
50-
AC_RUN_IFELSE(
51-
[AC_LANG_PROGRAM(
52-
[[#include <errno.h>
53-
#include <stdio.h>
54-
#include <pthread.h>
55-
#define __USE_GNU
56-
#include <dlfcn.h>
57-
#undef __USE_GNU]],
58-
[[static int (*hooked_pthread_rwlock_unlock)(pthread_rwlock_t *) = NULL;
59-
hooked_pthread_rwlock_unlock = dlsym( RTLD_NEXT, "pthread_rwlock_unlock" );
60-
if( hooked_pthread_rwlock_unlock == NULL ) { return 1; }
61-
pthread_rwlock_t rwlock;
62-
if( pthread_rwlock_init( &rwlock, NULL ) != 0 ) { return 2; }
63-
pthread_rwlock_wrlock( &rwlock );
64-
if( hooked_pthread_rwlock_unlock( &rwlock ) != 0 ) { return 3; }
65-
if( pthread_rwlock_destroy( &rwlock ) != 0 ) { return 4; }]] )],
66-
[ac_cv_have_pthread_rwlock_unlock_hook=yes],
67-
[ac_cv_have_pthread_rwlock_unlock_hook=no],
68-
[ac_cv_have_pthread_rwlock_unlock_hook=undetermined])
69-
70-
LIBS="$BACKUP_LIBS"
71-
72-
AC_MSG_RESULT(
73-
[$ac_cv_have_pthread_rwlock_unlock_hook])
74-
75-
AS_IF(
76-
[test "x$ac_cv_have_pthread_rwlock_unlock_hook" = xyes],
77-
[AC_DEFINE(
78-
[HAVE_PTHREAD_RWLOCK_UNLOCK_HOOK],
79-
[1],
80-
[Define to 1 whether pthread_rwlock_unlock can be hooked for testing.])
81-
])
82-
])
83-

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AC_PREREQ([2.71])
22

33
AC_INIT(
44
[libcthreads],
5-
[20260609],
5+
[20260610],
66
[https://github.com/libyal/libcthreads/issues])
77

88
AC_CONFIG_SRCDIR(

m4/tests.m4

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
dnl Functions for testing
22
dnl
3-
dnl Version: 20260607
3+
dnl Version: 20260610
44

55
dnl Function to check if pthread_rwlock_unlock can be hooked for testing
6-
AC_DEFUN([AX_TESTS_CHECK_PTHREAD_RWLOCK_UNLOCK_HOOK],
6+
AC_DEFUN([AX_TESTS_CHECK_CAN_HOOK_PTHREAD_RWLOCK_UNLOCK],
77
[AC_REQUIRE([AC_PROG_CC])
88
99
AC_MSG_CHECKING([whether pthread_rwlock_unlock can be hooked for testing])
@@ -48,7 +48,7 @@ if( pthread_rwlock_destroy( &rwlock ) != 0 ) { return 4; }]] )],
4848
])
4949

5050
dnl Function to detect whether the file system is case-insensitive
51-
AC_DEFUN([AX_TEST_CHECK_FILE_SYSTEM_IS_CASE_INSENSITIVE],
51+
AC_DEFUN([AX_TESTS_CHECK_FILE_SYSTEM_IS_CASE_INSENSITIVE],
5252
[AC_MSG_CHECKING([whether the file system is case-insensitive])
5353
5454
as_tmp_case_file="conftest.case.tst"
@@ -73,6 +73,39 @@ AC_DEFUN([AX_TEST_CHECK_FILE_SYSTEM_IS_CASE_INSENSITIVE],
7373
])
7474
])
7575

76+
dnl Function to check for a manpage linting command
77+
AC_DEFUN([AX_TESTS_CHECK_HAVE_MANPAGE_LINTER],
78+
[AC_PATH_PROG([MAN], [man])
79+
AC_PATH_PROG([MANDOC], [mandoc])
80+
81+
AC_CACHE_CHECK(
82+
[for manpage linter],
83+
[ac_cv_have_manpage_linter],
84+
[ac_cv_have_manpage_linter=no
85+
86+
printf '.Dd June 10, 2026\n.Dt TITLE 1\n.Os\n.Sh NAME\n.Nm command\n.Nd example\n' > conftest.1
87+
88+
AS_IF(
89+
[test "x$MAN" != x],
90+
[LC_ALL="en_US.UTF-8" MANROFFSEQ="" MANWIDTH="80" "$MAN" --warnings -E UTF-8 -l -Tutf8 -Z conftest.1 >/dev/null 2>&1
91+
AS_IF(
92+
[test $? -eq 0],
93+
[ac_cv_have_manpage_linter="man-db"])
94+
])
95+
96+
AS_IF(
97+
[test "x$ac_cv_have_manpage_linter" = xno && test "x$MANDOC" != x],
98+
[LC_ALL="en_US.UTF-8" "$MANDOC" -O width=80 -T lint -W all ./conftest.1 >/dev/null 2>&1
99+
100+
AS_IF(
101+
[test $? -eq 0],
102+
[ac_cv_have_manpage_linter="mandoc"])
103+
])
104+
105+
rm -f conftest.1
106+
])
107+
])
108+
76109
dnl Function to check whether libasan is functional
77110
AC_DEFUN([AX_TESTS_CHECK_LIBASAN],
78111
[AC_MSG_CHECKING([whether libasan is functional])
@@ -232,10 +265,13 @@ AC_DEFUN([AX_TESTS_CHECK_LOCAL],
232265
[Define to 1 if dlsym function is available in GNU dl.])
233266
])
234267
235-
AX_TESTS_CHECK_PTHREAD_RWLOCK_UNLOCK_HOOK
236-
237-
AX_TEST_CHECK_FILE_SYSTEM_IS_CASE_INSENSITIVE
268+
AX_TESTS_CHECK_CAN_HOOK_PTHREAD_RWLOCK_UNLOCK
269+
AX_TESTS_CHECK_FILE_SYSTEM_IS_CASE_INSENSITIVE
270+
AX_TESTS_CHECK_HAVE_MANPAGE_LINTER
238271
272+
AC_SUBST(
273+
[TESTS_MANPAGE_LINTER],
274+
[$ac_cv_have_manpage_linter])
239275
AC_SUBST(
240276
[TESTS_USE_WINAPI],
241277
[$ac_cv_enable_winapi])

0 commit comments

Comments
 (0)