Source

mana-core-testtools / share / post.sh

#!/bin/sh
test=$1
if [ -z "$status" ]
    then
    echo "Warning: athena exit status is not available"
else 
    # check exit status
    joblog=${test}.log
    if [ "$status" = 0 ]
	then 
	echo " OK: ${test} exited normally. Output is in $joblog "
	reflog=../share/${test}.ref
	if [ -r $reflog ]
	    then
	    echo "Now comparing output with reference"
	    diff -a -b -B -I " 0x" -I "package version" -I "\$Id: post.sh,v 1.1.1.1 2003-04-02 17:09:42 calaf Exp $joblog $reflog 
	    diffStatus=$?
	    if [ $diffStatus != 0 ] 
		then
		echo " ERROR: $joblog and $reflog differ "
		exit $diffStatus
	    else
		echo " OK: $joblog and $reflog identical "
	    fi
	else
	    tail $joblog
	    echo " WARNING: reference output $reflog not available "
	    echo  "Please check ${PWD}/$joblog"
	fi
    else
	tail $joblog
	echo  " ERROR: Athena exited abnormally! Exit code: $status "
	echo  "Please check ${PWD}/$joblog"
    fi
fi
exit $status