Skip to content

Commit eef6c17

Browse files
committed
Replaced test scripts with autotest
1 parent 0d840e6 commit eef6c17

38 files changed

Lines changed: 920 additions & 1610 deletions

.github/workflows/build_freebsd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
usesh: true
2020
mem: 4096
2121
prepare: |
22-
pkg install -y autoconf automake bash curl gettext git libtool pkgconf
22+
pkg install -y autoconf automake curl gettext git libtool pkgconf
2323
- name: Download test data
2424
shell: freebsd {0}
2525
run: |
@@ -36,4 +36,4 @@ jobs:
3636
- name: Run tests
3737
shell: freebsd {0}
3838
run: |
39-
tests/runtests.sh
39+
tests/runtests.sh SKIP_MANPAGES_TESTS=1 VERBOSE=1

.github/workflows/build_linux.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
- uses: actions/checkout@v6
3030
- name: Install build dependencies
3131
run: |
32+
sudo apt -y update
3233
sudo apt -y install autoconf automake autopoint build-essential git libtool pkg-config
3334
- name: Download test data
3435
run: |
@@ -43,7 +44,7 @@ jobs:
4344
make > /dev/null
4445
- name: Run tests
4546
run: |
46-
tests/runtests.sh
47+
tests/runtests.sh VERBOSE=1
4748
build_dist:
4849
runs-on: ${{ matrix.os }}
4950
strategy:
@@ -56,6 +57,7 @@ jobs:
5657
- uses: actions/checkout@v6
5758
- name: Install build dependencies
5859
run: |
60+
sudo apt -y update
5961
sudo apt -y install autoconf automake autopoint build-essential git libtool pkg-config
6062
- name: Download test data
6163
run: |
@@ -70,7 +72,38 @@ jobs:
7072
make > /dev/null
7173
- name: Run tests
7274
run: |
73-
make distcheck
75+
make distcheck VERBOSE=1
76+
build_mingw:
77+
runs-on: ${{ matrix.os }}
78+
strategy:
79+
matrix:
80+
include:
81+
- os: ubuntu-24.04
82+
configure_options: '--enable-mingw-binmode --host=x86_64-w64-mingw32'
83+
steps:
84+
- uses: actions/checkout@v6
85+
- name: Install build dependencies
86+
run: |
87+
sudo apt -y update
88+
sudo apt -y install autoconf automake autopoint build-essential git libtool pkg-config mingw-w64 wine wine-binfmt
89+
sudo mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc 2>/dev/null || true
90+
sudo sh -c "echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register"
91+
- name: Download test data
92+
run: |
93+
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
94+
- name: Build from source
95+
run: |
96+
./synclibs.sh --use-head
97+
./autogen.sh
98+
./configure ${{ matrix.configure_options }}
99+
make > /dev/null
100+
- name: Run tests
101+
env:
102+
WINE_DRIVER: "null"
103+
WINEDEBUG: "-all,err-winediag,err-systray"
104+
WINEDLLOVERRIDES: "explorer.exe=d"
105+
run: |
106+
tests/runtests.sh VERBOSE=1
74107
build_shared:
75108
runs-on: ${{ matrix.os }}
76109
strategy:
@@ -83,6 +116,7 @@ jobs:
83116
- uses: actions/checkout@v6
84117
- name: Install build dependencies
85118
run: |
119+
sudo apt -y update
86120
sudo apt -y install autoconf automake autopoint build-essential git libtool pkg-config
87121
- name: Download test data
88122
run: |
@@ -100,4 +134,4 @@ jobs:
100134
make > /dev/null
101135
- name: Run tests
102136
run: |
103-
tests/runtests.sh
137+
tests/runtests.sh VERBOSE=1

.github/workflows/build_macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
make > /dev/null
4646
- name: Run tests
4747
run: |
48-
tests/runtests.sh
48+
tests/runtests.sh SKIP_MANPAGES_TESTS=1 VERBOSE=1
4949
build_pkgbuild:
5050
runs-on: ${{ matrix.os }}
5151
strategy:

.github/workflows/build_windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
env:
7373
CHERE_INVOKING: 1
7474
run: |
75-
tests/runtests.sh
75+
tests/runtests.sh VERBOSE=1
7676
build_msys2_mingw:
7777
runs-on: windows-latest
7878
strategy:
@@ -104,4 +104,4 @@ jobs:
104104
- name: Run tests
105105
shell: msys2 {0}
106106
run: |
107-
tests/runtests.sh
107+
tests/runtests.sh SKIP_MANPAGES_TESTS=1 VERBOSE=1

.github/workflows/check_source.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
make > /dev/null
3434
- name: Run tests
3535
run: |
36-
tests/runtests.sh
36+
tests/runtests.sh VERBOSE=1
3737
scan_build:
3838
name: Check source with scan-build
3939
runs-on: ${{ matrix.os }}
@@ -124,4 +124,4 @@ jobs:
124124
make > /dev/null
125125
- name: Run tests
126126
run: |
127-
tests/runtests.sh
127+
tests/runtests.sh VERBOSE=1

.github/workflows/coverage.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
env:
4848
CHERE_INVOKING: 1
4949
run: |
50-
tests/runtests.sh
50+
tests/runtests.sh VERBOSE=1
5151
- name: Generate coverage data
5252
shell: bash --login -e -o pipefail -o igncr {0}
5353
working-directory: ${{ github.workspace }}
@@ -63,6 +63,7 @@ jobs:
6363
env:
6464
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6565
run: |
66+
$ProgressPreference = 'SilentlyContinue'
6667
Invoke-WebRequest -Uri "https://cli.codecov.io/latest/windows/codecov.exe" -OutFile "codecov.exe"
6768
Unblock-File -Path "./codecov.exe"
6869
./codecov.exe --verbose upload-coverage --git-service github --gcov-executable gcov --name "${{ matrix.codecov_name }}"
@@ -79,6 +80,7 @@ jobs:
7980
- uses: actions/checkout@v6
8081
- name: Install build dependencies
8182
run: |
83+
sudo apt -y update
8284
sudo apt -y install curl autoconf automake autopoint build-essential git libtool pkg-config
8385
- name: Download test data
8486
run: |
@@ -93,7 +95,7 @@ jobs:
9395
make > /dev/null
9496
- name: Run tests
9597
run: |
96-
make check CHECK_WITH_STDERR=1 SKIP_TOOLS_END_TO_END_TESTS=1
98+
make check SKIP_TOOLS_END_TO_END_TESTS=1 VERBOSE=1
9799
- name: Generate coverage data
98100
run: |
99101
for DIRECTORY in `find . -maxdepth 1 -type d`; do \
@@ -136,7 +138,7 @@ jobs:
136138
- name: Run tests
137139
shell: msys2 {0}
138140
run: |
139-
tests/runtests.sh
141+
tests/runtests.sh VERBOSE=1
140142
- name: Generate coverage data
141143
shell: msys2 {0}
142144
run: |

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Files to ignore by git
22
#
3-
# Version: 20251129
3+
# Version: 20260604
44

55
# Generic auto-generated build files
66
*~
@@ -127,7 +127,12 @@ stamp-h[1-9]
127127
/libcdata.spec
128128
/libcdata/libcdata.rc
129129
/libcdata/libcdata_definitions.h
130+
/tests/*.dir
130131
/tests/*.exe
132+
/tests/*.log
133+
/tests/*.tmp
134+
/tests/atconfig
135+
/tests/atlocal
131136
/tests/cdata_test_array
132137
/tests/cdata_test_btree
133138
/tests/cdata_test_btree_node
@@ -139,6 +144,9 @@ stamp-h[1-9]
139144
/tests/cdata_test_range_list_value
140145
/tests/cdata_test_support
141146
/tests/cdata_test_tree_node
147+
/tests/package.m4
148+
/tests/test_library
149+
/tests/test_manpages
142150
/tests/tmp*
143151

144152
# Local library dependencies specific files

Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ pkgconfigdir = $(libdir)/pkgconfig
5454
pkgconfig_DATA = \
5555
libcdata.pc
5656

57+
check-build: all
58+
cd $(srcdir)/tests && $(MAKE) check-build $(AM_MAKEFLAGS)
59+
5760
libtool: @LIBTOOL_DEPS@
5861
cd $(srcdir) && $(SHELL) ./config.status --recheck
5962

appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,4 @@ test_script:
9090
- cmd: rem Run tests
9191
- ps: If ($env:BUILD_ENVIRONMENT -eq "msbuild") {
9292
.\runtests.ps1 }
93-
- sh: if test ${BUILD_ENVIRONMENT} = "xcode" && test ${TARGET} != "macos-pkgbuild"; then tests/runtests.sh; fi
94-
- sh: if test ${TARGET} = "macos-pkgbuild"; then tests/pkgbuild.sh; fi
9593

autogen.ps1

Lines changed: 64 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,102 @@
11
# Script to generate the necessary files for a msvscpp build
22
#
3-
# Version: 20260505
3+
# Version: 20260608
44

55
$WinFlex = "..\win_flex_bison\win_flex.exe"
66
$WinBison = "..\win_flex_bison\win_bison.exe"
77

8-
$Library = Get-Content -Path configure.ac | select -skip 3 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" }
9-
$Version = Get-Content -Path configure.ac | select -skip 4 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" }
10-
$Prefix = ${Library}.Substring(3)
8+
$PackageName = Get-Content -Path configure.ac |
9+
select -skip 3 -first 1 |
10+
% { $_ -Replace " \[","" } |
11+
% { $_ -Replace "\],","" }
12+
$PackageVersion = Get-Content -Path configure.ac |
13+
select -skip 4 -first 1 |
14+
% { $_ -Replace " \[","" } |
15+
% { $_ -Replace "\],","" }
1116

12-
Get-Content -Path "include\${Library}.h.in" | Out-File -Encoding ascii "include\${Library}.h"
13-
Get-Content -Path "include\${Library}\definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "include\${Library}\definitions.h"
14-
Get-Content -Path "include\${Library}\features.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } | Out-File -Encoding ascii "include\${Library}\features.h"
15-
Get-Content -Path "include\${Library}\types.h.in" | % { $_ -Replace "@[A-Z0-9_]*@","0" } | Out-File -Encoding ascii "include\${Library}\types.h"
16-
Get-Content -Path "common\types.h.in" | % { $_ -Replace "@PACKAGE@","${Library}" } | Out-File -Encoding ascii "common\types.h"
17-
Get-Content -Path "${Library}\${Library}_definitions.h.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Library}\${Library}_definitions.h"
18-
Get-Content -Path "${Library}\${Library}.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Library}\${Library}.rc"
17+
Get-Content -Path "common\types.h.in" |
18+
% { $_ -Replace "@PACKAGE@","${PackageName}" } |
19+
Out-File -Encoding ascii "common\types.h"
1920

21+
If (Test-Path "include\${PackageName}.h.in")
22+
{
23+
Get-Content -Path "include\${PackageName}.h.in" |
24+
Out-File -Encoding ascii "include\${PackageName}.h"
25+
Get-Content -Path "include\${PackageName}\definitions.h.in" |
26+
% { $_ -Replace "@VERSION@","${PackageVersion}" } |
27+
Out-File -Encoding ascii "include\${PackageName}\definitions.h"
28+
Get-Content -Path "include\${PackageName}\features.h.in" |
29+
% { $_ -Replace "@[A-Z0-9_]*@","0" } |
30+
Out-File -Encoding ascii "include\${PackageName}\features.h"
31+
Get-Content -Path "include\${PackageName}\types.h.in" |
32+
% { $_ -Replace "@[A-Z0-9_]*@","0" } |
33+
Out-File -Encoding ascii "include\${PackageName}\types.h"
34+
}
35+
If (Test-Path "${PackageName}\${PackageName}.c")
36+
{
37+
Get-Content -Path "${PackageName}\${PackageName}_definitions.h.in" |
38+
% { $_ -Replace "@VERSION@","${PackageVersion}" } |
39+
Out-File -Encoding ascii "${PackageName}\${PackageName}_definitions.h"
40+
Get-Content -Path "${PackageName}\${PackageName}.rc.in" |
41+
% { $_ -Replace "@VERSION@","${PackageVersion}" } |
42+
Out-File -Encoding ascii "${PackageName}\${PackageName}.rc"
43+
}
2044
If (Test-Path "pyproject.toml.in")
2145
{
22-
Get-Content -Path "pyproject.toml.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "pyproject.toml"
46+
Get-Content -Path "pyproject.toml.in" |
47+
% { $_ -Replace "@VERSION@","${PackageVersion}" } |
48+
Out-File -Encoding ascii "pyproject.toml"
2349
}
50+
$PackagePrefix = ${PackageName}.Substring(3)
2451

25-
If (Test-Path "${Prefix}.net")
52+
If (Test-Path "${PackagePrefix}.net")
2653
{
27-
Get-Content -Path "${Prefix}.net\${Prefix}.net.rc.in" | % { $_ -Replace "@VERSION@","${Version}" } | Out-File -Encoding ascii "${Prefix}.net\${Prefix}.net.rc"
54+
Get-Content -Path "${PackagePrefix}.net\${PackagePrefix}.net.rc.in" |
55+
% { $_ -Replace "@VERSION@","${PackageVersion}" } |
56+
Out-File -Encoding ascii "${PackagePrefix}.net\${PackagePrefix}.net.rc"
2857
}
29-
30-
$NamePrefix = ""
31-
32-
ForEach (${Library} in Get-ChildItem -Directory -Path "lib*")
58+
ForEach (${PackageName} in Get-ChildItem -Directory -Path "lib*")
3359
{
34-
ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.l")
60+
$NamePrefix = ""
61+
62+
ForEach (${DirectoryElement} in Get-ChildItem -Path "${PackageName}\*.l")
3563
{
3664
$OutputFile = ${DirectoryElement} -Replace ".l$",".c"
3765

3866
$NamePrefix = Split-Path -path ${DirectoryElement} -leaf
3967
$NamePrefix = ${NamePrefix} -Replace ".l$","_"
4068

41-
Write-Host "Running: ${WinFlex} -Cf ${DirectoryElement}"
69+
$WinFlexArguments = @(
70+
"-Cf",
71+
"${DirectoryElement}"
72+
)
73+
Write-Host "Running: ${WinFlex} $($WinFlexArguments -join ' ')"
4274

4375
# PowerShell will raise NativeCommandError if win_flex writes to stdout or stderr
4476
# therefore 2>&1 is added and the output is stored in a variable.
45-
$Output = Invoke-Expression -Command "& '${WinFlex}' -Cf ${DirectoryElement} 2>&1"
77+
$Output = Invoke-Expression -Command "& '${WinFlex}' $($WinFlexArguments -join ' ') 2>&1" | %{ "$_" }
4678
Write-Host ${Output}
4779

4880
# Moving manually since `win_flex -o filename' does not provide the expected behavior.
4981
Move-Item "lex.yy.c" ${OutputFile} -force
5082
}
51-
52-
ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.y")
83+
ForEach (${DirectoryElement} in Get-ChildItem -Path "${PackageName}\*.y")
5384
{
5485
$OutputFile = ${DirectoryElement} -Replace ".y$",".c"
5586

56-
Write-Host "Running: ${WinBison} -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement}"
87+
$WinBisonArguments = @(
88+
"-d"
89+
"-v"
90+
"-l"
91+
"-p", "${NamePrefix}"
92+
"-o", "${OutputFile}"
93+
"${DirectoryElement}"
94+
)
95+
Write-Host "Running: ${WinBison} $($WinBisonArguments -join ' ')"
5796

5897
# PowerShell will raise NativeCommandError if win_bison writes to stdout or stderr
5998
# therefore 2>&1 is added and the output is stored in a variable.
60-
$Output = Invoke-Expression -Command "& '${WinBison}' -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement} 2>&1"
99+
$Output = Invoke-Expression -Command "& '${WinBison}' $($WinBisonArguments -join ' ') 2>&1" | %{ "$_" }
61100
Write-Host ${Output}
62101
}
63102
}
64-

0 commit comments

Comments
 (0)