mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
49 lines
1.3 KiB
Bash
49 lines
1.3 KiB
Bash
|
#!/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
|
||
|
make distclean -C "$library"
|
||
|
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"
|
||
|
make -s -j4 -C "$POCO_BASE"/"$library" SANITIZEFLAGS+=-fsanitize="$flag"
|
||
|
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
|
||
|
make -s -j4 -C "$POCO_BASE"/"$library"
|
||
|
make -s -j4 -C "$POCO_BASE"/"$library"/testsuite
|
||
|
fi
|
||
|
"$library"/testsuite/bin/"$OSNAME"/"$OSARCH"/testrunner -all
|
||
|
"$library"/testsuite/bin/"$OSNAME"/"$OSARCH"/testrunnerd -all
|