File: build-tests

package info (click to toggle)
log4cxx 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,996 kB
  • sloc: cpp: 42,860; xml: 847; makefile: 18; sh: 14
file content (39 lines) | stat: -rw-r--r-- 1,172 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

# testscript to run liblog4cxx unit tests.
# Part of the Debian package for liblog4cxx

# unstable tests, known to fail once in a while.
# upstream is working on those: LOGCXX-527, LOGCXX-532
FLAKY_TESTS='(timebasedrollingtest|multithreadtest)'

set -e

# We need to patch the sources so that the test suite runs against the
# packaged version of the library. So we need a copy...

WORKDIR=$(mktemp -d)
echo "this is our $WORKDIR"

trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM

# Copy the source tree to $AUTOPKGTEST_TMP before perparing it for the tests
cp -r . "$WORKDIR" ; cd "$WORKDIR"

# Patching the testsuite's CMakeList.txt to build the tests standalone.
patch -p1 <debian/tests/standalone-tests.patch

# Build it and run tests.
mkdir build ; cd build
cmake ../src/test/
cmake --build . -j $(nproc)

# Run non-flaky tests.
ctest --output-on-failure -E $FLAKY_TESTS -j $(nproc)

# Run remaining (flaky) tests
# They are known to fail randomly, so they are only considered as failed
# if they fail 3 times in a row.
ctest --output-on-failure -R $FLAKY_TESTS  ||
  ctest --rerun-failed --output-on-failure ||
  ctest --rerun-failed --output-on-failure