2023-11-01 00:25:21 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Script to rebuild a library and dependencies
|
|
|
|
# (with or without a sanitizer) and run the tests.
|
|
|
|
# Currently works only for top-level libs
|
|
|
|
# dependent on Foundation only.
|
|
|
|
#
|
|
|
|
# Usage: ./runLibTests.sh library [address | undefined | thread ]
|
|
|
|
#
|
|
|
|
|
|
|
|
library=$1
|
|
|
|
if [ -z "${library}" ]; then
|
|
|
|
echo "Library not specified"
|
|
|
|
echo "Usage: $0 library [address | undefined | thread ]"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
self="${BASH_SOURCE[0]}"
|
|
|
|
|
|
|
|
if [ -d "$self" ] ; then
|
|
|
|
basedir="$(cd "$self" || exit; pwd -P)"
|
|
|
|
else
|
|
|
|
basedir="$(cd "$(dirname "$self")" || exit; pwd -P)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# shellcheck disable=SC1091
|
|
|
|
. "$basedir"/poco_env.bash
|
|
|
|
|
|
|
|
flag=$2
|
|
|
|
|
|
|
|
make distclean -C CppUnit
|
|
|
|
make distclean -C Foundation
|
2023-11-01 19:21:20 +01:00
|
|
|
if [[ "$library" != "Foundation" ]]; then
|
|
|
|
make distclean -C "$library"
|
|
|
|
fi
|
2023-11-01 00:25:21 +01:00
|
|
|
make distclean -C "$library"/testsuite
|
|
|
|
|
|
|
|
if [ -n "${flag}" ]; then
|
|
|
|
make -s -j4 -C "$POCO_BASE"/CppUnit SANITIZEFLAGS+=-fsanitize="$flag"
|
|
|
|
make -s -j4 -C "$POCO_BASE"/Foundation SANITIZEFLAGS+=-fsanitize="$flag"
|
2023-11-01 19:21:20 +01:00
|
|
|
if [[ "$library" != "Foundation" ]]; then
|
|
|
|
make -s -j4 -C "$POCO_BASE"/"$library" SANITIZEFLAGS+=-fsanitize="$flag"
|
|
|
|
fi
|
2023-11-01 00:25:21 +01:00
|
|
|
make -s -j4 -C "$POCO_BASE"/"$library"/testsuite SANITIZEFLAGS+=-fsanitize="$flag"
|
|
|
|
else
|
|
|
|
make -s -j4 -C "$POCO_BASE"/CppUnit
|
|
|
|
make -s -j4 -C "$POCO_BASE"/Foundation
|
2023-11-01 19:21:20 +01:00
|
|
|
if [[ "$library" != "Foundation" ]]; then
|
|
|
|
make -s -j4 -C "$POCO_BASE"/"$library"
|
|
|
|
fi
|
2023-11-01 00:25:21 +01:00
|
|
|
make -s -j4 -C "$POCO_BASE"/"$library"/testsuite
|
|
|
|
fi
|
2023-11-01 19:21:20 +01:00
|
|
|
|
|
|
|
cd "$basedir"/"$library"/testsuite/bin/"$OSNAME"/"$OSARCH"/ || exit
|
2023-11-02 00:04:10 +01:00
|
|
|
./testrunner -all
|
|
|
|
./testrunnerd -all
|