Skip to content

Commit

Permalink
Add tests with musl libc.
Browse files Browse the repository at this point in the history
  • Loading branch information
yugr committed Jan 26, 2025
1 parent 8b63535 commit 7004d5b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ jobs:
# - uses: actions/checkout@v3
# - name: Run tests
# run: scripts/travis.sh
musl:
runs-on: ubuntu-latest
env:
CC: musl-gcc
steps:
- uses: actions/checkout@v3
- name: Install deps
run: sudo apt-get update && sudo apt-get install musl-tools
- name: Run tests
run: scripts/travis.sh
# TODO: test on llvm-libc when it supports dlfcn
x86:
runs-on: ubuntu-latest
env:
Expand Down
12 changes: 8 additions & 4 deletions scripts/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tests/basic/run.sh $ARCH
tests/exceptions/run.sh $ARCH
tests/data-warnings/run.sh $ARCH
tests/vtables/run.sh $ARCH
if test -z "$ARCH"; then
if test -z "$ARCH" && ! echo "${CC:-}" | grep -q musl-gcc; then
# TODO: enable for other targets
tests/ld/run.sh
fi
Expand All @@ -34,9 +34,11 @@ fi
tests/hidden/run.sh $ARCH
tests/verbose/run.sh $ARCH
tests/no_dlopen/run.sh $ARCH
tests/multiple-dlopens/run.sh $ARCH
tests/multiple-dlopens-2/run.sh $ARCH
tests/multiple-dlopens-3/run.sh $ARCH
if ! echo "${CC:-}" | grep -q musl-gcc; then # Musl does not implement dlclose
tests/multiple-dlopens/run.sh $ARCH
tests/multiple-dlopens-2/run.sh $ARCH
tests/multiple-dlopens-3/run.sh $ARCH
fi
if ! echo "$ARCH" | grep -q powerpc; then
tests/many-functions/run.sh $ARCH
fi
Expand All @@ -47,3 +49,5 @@ if ! echo "$ARCH" | grep -q 'powerpc\|mips\|riscv'; then
fi
tests/thread/run.sh $ARCH
tests/thread-2/run.sh $ARCH

echo 'All tests passed'
8 changes: 8 additions & 0 deletions tests/common.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Copyright 2019-2025 Yury Gribov
#
# The MIT License (MIT)
#
# Use of this source code is governed by MIT license that can be
# found in the LICENSE.txt file.

if test -n "${TRAVIS:-}"; then
set -x
fi
Expand Down Expand Up @@ -94,6 +101,7 @@ fi

# Do not bother with non-native targets
if test -z "$INTERP" \
&& ! echo "$CC" | grep -q musl-gcc \
&& uname | grep -q Linux \
&& echo 'int main() {}' | $CC $CFLAGS -fsanitize=thread -x c - -o /dev/null 2> /dev/null; then
TSAN_AVAILABLE=1
Expand Down

0 comments on commit 7004d5b

Please sign in to comment.