diff --git a/tests/scripts/faketime-all.sh b/tests/scripts/faketime-all.sh index 32727cea78..57de29034c 100755 --- a/tests/scripts/faketime-all.sh +++ b/tests/scripts/faketime-all.sh @@ -145,6 +145,7 @@ pre_initialize_variables () { : ${ARMC6_BIN_DIR:=/usr/bin} : ${ARM_NONE_EABI_GCC_PREFIX:=arm-none-eabi-} : ${ARM_LINUX_GNUEABI_GCC_PREFIX:=arm-linux-gnueabi-} + LIBFAKETIME= # if MAKEFLAGS is not set add the -j option to speed up invocations of make if [ -z "${MAKEFLAGS+set}" ]; then @@ -380,6 +381,22 @@ check_tools() done } +check_faketime() { + + for i in /usr/local/lib/faketime/libfaketime.so.1 \ + /usr/lib/aarch64-linux-gnu/faketime/libfaketime.so.1 \ + /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1 + do + if [ -f $i ]; then + LIBFAKETIME=$i + fi + done + if [ -z "$LIBFAKETIME" ]; then + err_msg "libfaketime not found!" + exit 1 + fi +} + pre_parse_command_line_for_dirs () { # Make an early pass through the options given, so we can set directories # for Arm compilers, before SUPPORTED_COMPONENTS is determined. @@ -751,6 +768,11 @@ pre_check_tools () { "$ARMC6_CC" "$ARMC6_AR" "$ARMC6_FROMELF";; esac + case " $RUN_COMPONENTS " in + *_faketime_*) + check_faketime;; + esac + # past this point, no call to check_tool, only printing output if [ $QUIET -eq 1 ]; then return