#!/bin/bash
###SHELLPACK preamble libmicro-regular-bench 1

###SHELLPACK parseargBegin
###SHELLPACK parseargInstall
###SHELLPACK parseargEnd
###SHELLPACK monitor_hooks

###SHELLPACK check_install_required libmicro-regular-${VERSION}
###SHELLPACK init_complete

cd $SHELLPACK_SOURCES/libmicro-regular-${VERSION}-installed || die "Failed to cd to libmicro directory"

COMMON="-E -C 0 -D 30000 -B 10000 -L -S -W"

while read A B C; do
	monitor_pre_hook $LOGDIR_RESULTS $A-$B
	if [ -f bin/$A ]; then
		eval bin/$A $COMMON -N "$B" $C 2>&1 > $LOGDIR_RESULTS/$B.log
	fi
	monitor_post_hook $LOGDIR_RESULTS $A-$B
done <<EOT
getpid	getpid
getenv	getenv	-s 100
getenv	getenvT2	-s 100   -T 2
gettimeofday	gettimeofday
log	log
exp	exp
lrand48	lrand48
isatty	isatty_yes
strtol	strtol
longjmp	longjmp
siglongjmp	siglongjmp
getrusage	getrusage
times	times
time	time
localtime_r	localtime_r
strftime	strftime
mktime	mktime
mktime	mktimeT2	-T 2
EOT

exit $SHELLPACK_SUCCESS
