Skip to content

Commit d5278fd

Browse files
authored
Merge pull request #4361 from tgross35/absorb-ctest
Merge the `ctest2` repository into `libc`
2 parents 7b2c2f4 + 4c7fd2d commit d5278fd

32 files changed

+4608
-1
lines changed

ci/style.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ done < "$tmpfile"
6060
rm "$tmpfile"
6161

6262
if shellcheck --version ; then
63-
find . -name '*.sh' -print0 | xargs -0 shellcheck
63+
# FIXME(ctest): update ctest scripts so we don't need to exclude them
64+
find . -name '*.sh' -not -path './ctest/*' -print0 | xargs -0 shellcheck
6465
else
6566
echo "shellcheck not found"
6667
exit 1

ctest/.github/workflows/linux.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI (Linux)
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build_and_test:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
version:
15+
- 1.63.0 # MSRV
16+
- stable
17+
- beta
18+
- nightly
19+
target:
20+
- x86_64-unknown-linux-gnu
21+
22+
name: ${{ matrix.version }} - ${{ matrix.target }}
23+
runs-on: ubuntu-24.04
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Install ${{ matrix.version }}
29+
run: TOOLCHAIN=${{ matrix.version }} TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
30+
31+
- name: Check MSRV
32+
if: matrix.version == '1.63.0'
33+
run: cargo check
34+
35+
# FIXME: Some symbols cause multiple definitions error on the same line:
36+
# /usr/bin/ld: /home/runner/work/ctest2/ctest2/target/debug/deps/libtestcrate-a072d428f9532abb.rlib(t1gen.o):
37+
# /home/runner/work/ctest2/ctest2/testcrate/src/t1.h:65: multiple definition of `T1_static_mut_u8';
38+
# /home/runner/work/ctest2/ctest2/target/debug/deps/libtestcrate-a072d428f9532abb.rlib(t1.o):
39+
# /home/runner/work/ctest2/ctest2/testcrate/src/t1.h:65: first defined here
40+
# - name: Run tests
41+
# if: matrix.version != '1.63.0'
42+
# run: cargo test --all -- --nocapture
43+
44+
- name: Run libc tests
45+
if: matrix.version != '1.63.0'
46+
run: sh ./ci/run-docker.sh ${{ matrix.target }}

ctest/.github/workflows/macos.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI (macOS)
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build_and_test:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
version:
15+
- stable
16+
- beta
17+
- nightly
18+
target:
19+
- x86_64-apple-darwin
20+
21+
name: ${{ matrix.version }} - ${{ matrix.target }}
22+
runs-on: macos-14
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Install ${{ matrix.version }}
28+
run: TOOLCHAIN=${{ matrix.version }} TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
29+
30+
- name: Run tests
31+
run: cargo test --all -- --nocapture
32+
33+
- name: Run libc tests
34+
env:
35+
TARGET: ${{ matrix.target }}
36+
run: sh ./ci/run.sh ${{ matrix.target }}

ctest/.github/workflows/windows.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI (Windows)
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build_and_test:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
version:
15+
- nightly
16+
target:
17+
#- x86_64-pc-windows-gnu
18+
- x86_64-pc-windows-msvc
19+
#- i686-pc-windows-gnu
20+
- i686-pc-windows-msvc
21+
include:
22+
#- target: x86_64-pc-windows-gnu
23+
# arch: x86_64
24+
- target: x86_64-pc-windows-msvc
25+
arch: x86_64
26+
#- target: i686-pc-windows-gnu
27+
# arch: i686
28+
- target: i686-pc-windows-msvc
29+
arch: i686
30+
31+
name: ${{ matrix.version }} - ${{ matrix.target }}
32+
runs-on: windows-2022
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Install MinGW (i686)
38+
if: matrix.arch == 'i686'
39+
run: |
40+
choco install mingw --x86 --force
41+
42+
- name: Find GCC libraries
43+
run: |
44+
set -ex
45+
gcc -print-search-dirs
46+
find "C:\ProgramData\Chocolatey" -name "crt2*"
47+
find "C:\ProgramData\Chocolatey" -name "dllcrt2*"
48+
find "C:\ProgramData\Chocolatey" -name "libmsvcrt*"
49+
shell: bash
50+
51+
- name: Fix MinGW
52+
run: |
53+
set -ex
54+
if [[ -n ${ARCH_BITS} ]]; then
55+
for i in crt2.o dllcrt2.o libmingwex.a libmsvcrt.a ; do
56+
cp -f "/C/ProgramData/Chocolatey/lib/mingw/tools/install/mingw${ARCH_BITS}/${ARCH}-w64-mingw32/lib/$i" "`rustc --print sysroot`/lib/rustlib/${TARGET}/lib"
57+
done
58+
fi
59+
shell: bash
60+
61+
- name: Install ${{ matrix.version }}
62+
run: TOOLCHAIN=${{ matrix.version }} TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
63+
shell: bash
64+
65+
- name: Run tests
66+
run: cargo test --all -- --nocapture

ctest/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
Cargo.lock

0 commit comments

Comments
 (0)