Skip to content

Commit 03d6ffc

Browse files
committed
Worked on tests and changes for CI tests
1 parent 069c071 commit 03d6ffc

11 files changed

Lines changed: 89 additions & 373 deletions

File tree

.github/workflows/build_freebsd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v6
10-
- name: Building from source
10+
- name: Build from source
1111
id: build_freebsd
1212
uses: vmactions/freebsd-vm@v1
1313
with:

.github/workflows/build_linux.yml

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Download test data
3131
run: |
3232
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
33-
- name: Building from source
33+
- name: Build from source
3434
env:
3535
CC: ${{ matrix.compiler }}
3636
run: |
@@ -54,7 +54,7 @@ jobs:
5454
- name: Download test data
5555
run: |
5656
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
57-
- name: Building from source
57+
- name: Build from source
5858
env:
5959
CC: ${{ matrix.compiler }}
6060
run: |
@@ -81,45 +81,11 @@ jobs:
8181
- name: Prepare shared libraries
8282
run: |
8383
tests/syncsharedlibs.sh --use-head
84-
- name: Building from source
84+
- name: Build from source
8585
env:
8686
CC: ${{ matrix.compiler }}
8787
run: |
8888
tests/build.sh ${{ matrix.configure_options }}
8989
- name: Run tests
9090
run: |
9191
tests/runtests.sh
92-
coverage:
93-
runs-on: ${{ matrix.os }}
94-
strategy:
95-
matrix:
96-
include:
97-
- os: ubuntu-24.04
98-
compiler: 'gcc'
99-
configure_options: 'CPPFLAGS=-DHAVE_MEMORY_TESTS=1 --enable-code-coverage'
100-
steps:
101-
- uses: actions/checkout@v6
102-
- name: Install build dependencies
103-
run: |
104-
sudo apt -y install curl autoconf automake autopoint build-essential git libtool pkg-config
105-
- name: Download test data
106-
run: |
107-
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
108-
- name: Building from source
109-
env:
110-
CC: ${{ matrix.compiler }}
111-
run: |
112-
tests/build.sh ${{ matrix.configure_options }}
113-
- name: Run tests
114-
run: |
115-
make check CHECK_WITH_STDERR=1 SKIP_TOOLS_END_TO_END_TESTS=1
116-
- name: Generate coverage data
117-
run: |
118-
for DIRECTORY in `find . -maxdepth 1 -type d`; do \
119-
(cd ${DIRECTORY} && find . -maxdepth 1 -name \*.gcno -type f -exec gcov -pb {} \;) \
120-
done
121-
- name: Upload coverage report to Codecov
122-
uses: codecov/codecov-action@v6
123-
with:
124-
name: ${{ matrix.os }}-gcc-no-optimization
125-
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/build_macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Download test data
2929
run: |
3030
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
31-
- name: Building from source
31+
- name: Build from source
3232
run: |
3333
tests/build.sh ${{ matrix.configure_options }}
3434
- name: Run tests

.github/workflows/build_windows.yml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,70 @@ jobs:
2323
- name: Download test data
2424
run: |
2525
if (Test-Path .\synctestdata.ps1) { .\synctestdata.ps1 }
26-
- name: Building from source
26+
- name: Build from source
2727
run: |
2828
.\synclibs.ps1 -UseHead
2929
.\autogen.ps1
3030
.\build.ps1 -VisualStudioVersion 2022 -Configuration Release -Platform x64 -PythonPath ${{ env.pythonLocation }} -VSToolsOptions "--extend-with-x64 --no-python-dll"
3131
- name: Run tests
3232
run: |
3333
.\runtests.ps1
34+
build_cygwin:
35+
runs-on: windows-latest
36+
strategy:
37+
matrix:
38+
include:
39+
- configure_options: '--enable-winapi=no'
40+
- configure_options: '--enable-winapi=yes'
41+
steps:
42+
- name: Configure git
43+
run: git config --global core.autocrlf false
44+
- uses: actions/checkout@v6
45+
- name: Install Cygwin and build dependencies
46+
uses: cygwin/cygwin-install-action@v6
47+
with:
48+
packages: autoconf, automake, gettext-devel, git, libtool, make, mingw-w64-x86_64-gcc, pkg-config
49+
platform: x86_64
50+
add-to-path: true
51+
- name: Build from source
52+
shell: bash --login -e -o pipefail -o igncr {0}
53+
working-directory: ${{ github.workspace }}
54+
env:
55+
CHERE_INVOKING: 1
56+
CONFIGURE_OPTIONS: ${{ matrix.configure_options }}
57+
LD: ld
58+
run: |
59+
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
60+
tests/build.sh ${CONFIGURE_OPTIONS}
61+
- name: Run tests
62+
shell: bash --login -e -o pipefail -o igncr {0}
63+
working-directory: ${{ github.workspace }}
64+
env:
65+
CHERE_INVOKING: 1
66+
run: |
67+
tests/runtests.sh
68+
build_mingw:
69+
runs-on: windows-latest
70+
strategy:
71+
matrix:
72+
include:
73+
- configure_options: ''
74+
steps:
75+
- uses: actions/checkout@v6
76+
- name: Set up MSYS2 with MinGW-w64
77+
uses: msys2/setup-msys2@v2
78+
with:
79+
msystem: MINGW64
80+
update: true
81+
install: autoconf automake gettext gettext-devel libtool make mingw-w64-x86_64-gcc pkg-config
82+
- name: Build from source
83+
shell: msys2 {0}
84+
env:
85+
CONFIGURE_OPTIONS: ${{ matrix.configure_options }}
86+
run: |
87+
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
88+
tests/build.sh ${CONFIGURE_OPTIONS}
89+
- name: Run tests
90+
shell: msys2 {0}
91+
run: |
92+
tests/runtests.sh

.github/workflows/check_source.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Download test data
2424
run: |
2525
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
26-
- name: Building from source
26+
- name: Build from source
2727
env:
2828
CC: ${{ matrix.compiler }}
2929
run: |
@@ -48,7 +48,7 @@ jobs:
4848
- name: Install build dependencies
4949
run: |
5050
sudo apt -y install autoconf automake autopoint build-essential clang clang-tools git jq libtool pkg-config
51-
- name: Building from source
51+
- name: Build from source
5252
env:
5353
CC: ${{ matrix.compiler }}
5454
run: |
@@ -111,7 +111,7 @@ jobs:
111111
- name: Download test data
112112
run: |
113113
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
114-
- name: Building from source
114+
- name: Build from source
115115
env:
116116
CC: ${{ matrix.compiler }}
117117
run: |

appveyor.yml

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -91,38 +91,12 @@ environment:
9191
APPVEYOR_BUILD_WORKER_IMAGE: macos-sonoma
9292
HOMEBREW_NO_INSTALL_CLEANUP: 1
9393
CONFIGURE_OPTIONS: "--disable-dependency-tracking --prefix=/usr/local --with-pyprefix"
94-
- TARGET: cygwin64-gcc
95-
BUILD_ENVIRONMENT: cygwin64
96-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
97-
CONFIGURE_OPTIONS: ""
98-
- TARGET: cygwin64-gcc-no-optimization
99-
BUILD_ENVIRONMENT: cygwin64
100-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
101-
CONFIGURE_OPTIONS: "--enable-code-coverage"
102-
- TARGET: mingw-w64-gcc
103-
BUILD_ENVIRONMENT: mingw-w64
104-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
105-
CONFIGURE_OPTIONS: ""
106-
- TARGET: mingw-w64-gcc-no-optimization
107-
BUILD_ENVIRONMENT: mingw-w64
108-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
109-
CONFIGURE_OPTIONS: "--enable-code-coverage"
11094

11195
install:
11296
- cmd: if [%BUILD_ENVIRONMENT%]==[msbuild] (
11397
git clone https://github.com/libyal/vstools.git ..\vstools )
11498
- sh: if test ${BUILD_ENVIRONMENT} = "xcode"; then brew untap homebrew/homebrew-cask-versions && brew update -q; fi
11599
- sh: if test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q autoconf automake gettext gnu-sed libtool pkg-config || true; fi
116-
- ps: If ($env:BUILD_ENVIRONMENT -eq "cygwin64") {
117-
Invoke-WebRequest -Uri "https://cygwin.com/setup-x86_64.exe" -Outfile C:\cygwin64\setup-x86_64.exe }
118-
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
119-
C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P gettext-devel )
120-
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
121-
git clone git://git.savannah.gnu.org/config.git ..\config )
122-
- cmd: if [%BUILD_ENVIRONMENT%]==[mingw-w64] (
123-
C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gettext-devel libtool make mingw-w64-x86_64-gcc pkg-config )
124-
- ps: If (("cygwin64-gcc-no-optimization", "mingw-w64-gcc-no-optimization").Contains($env:TARGET)) {
125-
Invoke-WebRequest -Uri "https://uploader.codecov.io/latest/windows/codecov.exe" -Outfile ..\codecov.exe }
126100

127101
build_script:
128102
- ps: If ($env:BUILD_ENVIRONMENT -eq "msbuild") {
@@ -135,30 +109,11 @@ build_script:
135109
- ps: If (("vs2017", "vs2019", "vs2022", "vs2022-vsdebug", "vs2022-x64").Contains($env:TARGET)) {
136110
.\build.ps1 -VisualStudioVersion $env:TARGET.Substring(2, 4) -Configuration $env:CONFIGURATION -Platform $env:PLATFORM -PythonPath $env:PYTHON_PATH -VSToolsOptions "--extend-with-x64 --no-python-dll --with-dokany" }
137111
- sh: if test ${BUILD_ENVIRONMENT} = "xcode"; then export PATH="/usr/local/opt/gettext/bin:$PATH"; export SED="/usr/local/bin/gsed"; tests/build.sh ${CONFIGURE_OPTIONS}; fi
138-
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
139-
xcopy /i /q /s C:\projects\libcthreads C:\cygwin64\home\appveyor\libcthreads &&
140-
xcopy /i /q ..\config\config.* C:\cygwin64\home\appveyor\libcthreads &&
141-
C:\cygwin64\bin\bash -e -l -c "cd libcthreads && tests/build.sh ${CONFIGURE_OPTIONS}" )
142-
- cmd: if [%BUILD_ENVIRONMENT%]==[mingw-w64] (
143-
xcopy /i /q /s C:\projects\libcthreads C:\msys64\home\appveyor\libcthreads &&
144-
C:\msys64\usr\bin\bash -e -l -c "cd libcthreads && tests/build.sh ${CONFIGURE_OPTIONS}" )
145112

146113
test_script:
147114
- cmd: rem Run tests
148115
- ps: If ($env:BUILD_ENVIRONMENT -eq "msbuild") {
149116
.\runtests.ps1 }
150117
- sh: if test ${BUILD_ENVIRONMENT} = "xcode" && test ${TARGET} != "macos-pkgbuild"; then tests/runtests.sh; fi
151118
- sh: if test ${TARGET} = "macos-pkgbuild"; then tests/pkgbuild.sh; fi
152-
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
153-
C:\cygwin64\bin\bash -l -c "cd libcthreads && tests/runtests.sh" )
154-
- cmd: if [%BUILD_ENVIRONMENT%]==[mingw-w64] (
155-
C:\msys64\usr\bin\bash -l -c "cd libcthreads && tests/runtests.sh" )
156-
157-
after_test:
158-
- cmd: if [%TARGET%]==[cygwin64-gcc-no-optimization] (
159-
C:\cygwin64\bin\bash -e -l -c "cd libcthreads && for DIRECTORY in `find . -maxdepth 1 -type d`; do (cd ${DIRECTORY} && find . -maxdepth 1 -name \*.gcno -type f -exec gcov -pb {} \;) done" &&
160-
C:\projects\codecov.exe -R \cygwin64\home\appveyor\libcthreads --name %TARGET% )
161-
- cmd: if [%TARGET%]==[mingw-w64-gcc-no-optimization] (
162-
C:\msys64\usr\bin\bash -e -l -c "cd libcthreads && for DIRECTORY in `find . -maxdepth 1 -type d`; do (cd ${DIRECTORY} && find . -maxdepth 1 -name \*.gcno -type f -exec gcov -pb {} \;) done" &&
163-
C:\projects\codecov.exe -R \msys64\home\appveyor\libcthreads --name %TARGET% )
164119

configure.ac

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AC_PREREQ([2.71])
22

33
AC_INIT(
44
[libcthreads],
5-
[20260528],
5+
[20260529],
66
[joachim.metz@gmail.com])
77

88
AC_CONFIG_SRCDIR(
@@ -44,6 +44,15 @@ AC_SYS_LARGEFILE
4444
dnl Check if shared library support should be disabled
4545
AX_COMMON_CHECK_DISABLE_SHARED_LIBS
4646

47+
dnl Check if asan support should be enabled
48+
AX_TESTS_CHECK_ENABLE_ASAN
49+
50+
dnl Check if ubsan support should be enabled
51+
AX_TESTS_CHECK_ENABLE_UBSAN
52+
53+
dnl Check if code coverage support should be enabled
54+
AX_TESTS_CHECK_ENABLE_CODE_COVERAGE
55+
4756
dnl Check if WINAPI support should be enabled
4857
AX_COMMON_CHECK_ENABLE_WINAPI
4958

@@ -62,18 +71,8 @@ AX_LIBCTHREADS_CHECK_LOCAL
6271
dnl Check if DLL support is needed
6372
AX_LIBCTHREADS_CHECK_DLL_SUPPORT
6473

65-
dnl Check if asan support should be enabled
66-
AX_TESTS_CHECK_ENABLE_ASAN
67-
68-
dnl Check if ubsan support should be enabled
69-
AX_TESTS_CHECK_ENABLE_UBSAN
70-
71-
dnl Check if code coverage support should be enabled
72-
AX_TESTS_CHECK_ENABLE_CODE_COVERAGE
73-
7474
dnl Check if tests required headers and functions are available
7575
AX_TESTS_CHECK_LOCAL
76-
AX_TESTS_CHECK_PTHREAD_RWLOCK_UNLOCK_HOOK
7776

7877
dnl Set additional compiler flags
7978
CFLAGS="$CFLAGS -Wall";

libcthreads/libcthreads.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
#pragma managed( push, off )
3838
#endif
3939

40+
/* LCOV_EXCL_START */
41+
4042
/* Defines the entry point for the DLL
4143
*/
4244
BOOL WINAPI DllMain(
@@ -65,6 +67,8 @@ BOOL WINAPI DllMain(
6567
return( TRUE );
6668
}
6769

70+
/* LCOV_EXCL_STOP */
71+
6872
/* Function that indicates the library is a DLL
6973
* Returns 1
7074
*/

m4/common.m4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dnl Checks for common headers and functions
22
dnl
3-
dnl Version: 20260528
3+
dnl Version: 20260529
44

55
dnl Function to test if a certain feature was disabled
66
AC_DEFUN([AX_COMMON_ARG_DISABLE],
@@ -79,7 +79,7 @@ AC_DEFUN([AX_COMMON_CHECK_DISABLE_SHARED_LIBS],
7979
[AX_COMMON_ARG_DISABLE(
8080
[shared-libs],
8181
[shared_libs],
82-
[disable shared library support])
82+
[shared library support])
8383
])
8484

8585
dnl Function to detect whether debug output should be enabled
@@ -151,7 +151,7 @@ AC_DEFUN([AX_COMMON_CHECK_ENABLE_WINAPI],
151151
[AX_COMMON_ARG_ENABLE(
152152
[winapi],
153153
[winapi],
154-
[enable WINAPI support for cross-compilation],
154+
[WINAPI support for cross-compilation],
155155
[auto-detect])
156156
157157
AS_IF(

m4/tests.m4

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

55
dnl Function to check whether libasan is functional
66
AC_DEFUN([AX_TESTS_CHECK_LIBASAN],
@@ -76,7 +76,7 @@ AC_DEFUN([AX_TESTS_CHECK_ENABLE_ASAN],
7676
[AX_COMMON_ARG_ENABLE(
7777
[asan],
7878
[asan],
79-
[build with asan)],
79+
[build with asan],
8080
[no])
8181
8282
AS_IF(
@@ -100,7 +100,7 @@ AC_DEFUN([AX_TESTS_CHECK_ENABLE_UBSAN],
100100
[AX_COMMON_ARG_ENABLE(
101101
[ubsan],
102102
[ubsan],
103-
[build with ubsan)],
103+
[build with ubsan],
104104
[no])
105105
106106
AS_IF(

0 commit comments

Comments
 (0)