#!/bin/sh

testsdir="/usr/libexec/rocm/librocthrust-tests"

# If autopkgtest called us, pass some extra options if not set
if [ -n "$AUTOPKGTEST_ARTIFACTS" ]; then
    # Save output as XML to artifacts, for download
    [ -n "${GTEST_OUTPUT:-}" ] || export GTEST_OUTPUT="xml:${AUTOPKGTEST_ARTIFACTS}/"
fi

# Pass on all arguments to this script to the test binary
# Any individual failure is overall failure
EXITCODE=0
for TESTNAME in "$testsdir"/*
do
	$TESTNAME "$@" || EXITCODE=1
done
exit $EXITCODE
