Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ jobs:
meson setup build ${{ matrix.buildtype && format('--buildtype={0}', matrix.buildtype) || '' }}
ninja -C build

- name: Run unit tests
if: matrix.run_tests
run: |
set -o pipefail
meson test -C build --suite unit --print-errorlogs -v | tee "$RUNNER_TEMP/unit-tests.log"
# meson exits 0 when no test matches the suite, so insist on a pass
grep -Eiq '^ok: +[1-9]' "$RUNNER_TEMP/unit-tests.log"

- name: Setup SSH
if: matrix.run_tests
run: |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ jobs:
path: build/sshfs
if-no-files-found: ignore

- name: Run unit tests
run: |
set -o pipefail
meson test -C build --suite unit --print-errorlogs -v | tee "$RUNNER_TEMP/unit-tests.log"
# meson exits 0 when no test matches the suite, so insist on a pass
grep -Eiq '^ok: +[1-9]' "$RUNNER_TEMP/unit-tests.log"

- name: Run tests
timeout-minutes: 20
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ jobs:
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer
run: |
mkdir -p "$RUNNER_TEMP/sanitizer"
set -o pipefail
meson test -C build --suite unit --print-errorlogs -v | tee "$RUNNER_TEMP/unit-tests.log"
# meson exits 0 when no test matches the suite, so insist on a pass
grep -Eiq '^ok: +[1-9]' "$RUNNER_TEMP/unit-tests.log"
cd build
python3 -m pytest test/ --timeout=180 --maxfail=99 --junitxml=test-results.xml
timeout-minutes: 20
Expand Down
11 changes: 11 additions & 0 deletions test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ custom_target('test_scripts', input: test_scripts,
command: ['cp', '-fPp',
'@INPUT@', meson.current_build_dir() ])

# Unit tests for cache.c. The test #includes cache.c itself, so it is built
# from its own source only. They need no mount and are in the 'unit' suite.
# Run them with 'meson test --suite unit': the wrong_cmd test below always
# fails, so a plain 'meson test' does too.
test_cache = executable('test_cache', 'test_cache.c',
include_directories: include_dirs,
dependencies: sshfs_deps,
c_args: ['-DFUSE_USE_VERSION=31'],
install: false)
test('cache', test_cache, suite: 'unit')

# Provide something helpful when running 'ninja test'
wrong_cmd = executable('wrong_command', 'wrong_command.c',
install: false)
Expand Down
Loading
Loading