diff options
author | Sven Gothel <[email protected]> | 2022-05-27 03:13:56 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-05-27 03:13:56 +0200 |
commit | 371910ff76184e56da2a51ad0440533ef6f5bd4d (patch) | |
tree | 9705f9a407e41b478d83118a0ce60cb3ef7ab518 /scripts | |
parent | 7dde04477b3e5455d1db93a7000ece08aac00ed7 (diff) |
Add script/run_native_test.sh
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/run_native_test.sh | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/scripts/run_native_test.sh b/scripts/run_native_test.sh new file mode 100755 index 0000000..c514389 --- /dev/null +++ b/scripts/run_native_test.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +export elevator_debug=true +export elevator_verbose=true + +script_args="$@" +sdir=`dirname $(readlink -f $0)` +rootdir=`dirname $sdir` +bname=`basename $0 .sh` + +. $sdir/setup-machine-arch.sh + +build_dir=${rootdir}/build-${archabi} + +if [ "$1" = "-log" ] ; then + logfile=$2 + shift 2 +else + logfile= +fi + +test_exe=${build_dir}/test/elevator/test_01_cipherpack +if [ ! -z "$1" ] ; then + test_exe=$1 + shift 1 +fi +test_basename=`basename ${test_exe}` + +if [ -z "${logfile}" ] ; then + logfile=~/${bname}-${test_basename}-${archabi}.log +fi +rm -f $logfile +logbasename=`basename ${logfile} .log` + +# run as root 'dpkg-reconfigure locales' enable 'en_US.UTF-8' +# perhaps run as root 'update-locale LC_MEASUREMENT=en_US.UTF-8 LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8' +export LC_MEASUREMENT=en_US.UTF-8 +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +do_test() { + echo "script invocation: $0 ${script_args}" + echo elevator_debug $elevator_debug + echo elevator_verbose $elevator_verbose + echo logfile $logfile + + cd `dirname $test_exe` + + ulimit -c unlimited + $EXE_WRAPPER ${test_exe} ${*@Q} + exit $? +} + +do_test "$@" 2>&1 | tee $logfile + |