TREE_FILE=psim_tree.${LOGNAME} case $0 in *4.8*) rtemsTarget=powerpc-rtems4.8 ;; *4.9*) rtemsTarget=powerpc-rtems4.9 ;; *4.10*) rtemsTarget=powerpc-rtems4.10 ;; *) ;; esac ### Generate the PSIM device tree based upon the type of application being run gen_device_tree() { enable_sysv_ipc="yes" if [ ${use_sysv_ipc} = "yes" ] ; then enable_sysv_ipc="yes" value=-1 # for now assume we are slave in this mode else case ${1} in *node*) enable_sysv_devices="yes" case ${1} in *node1*) value=1 ;; *) value=-1 ;; esac ;; *) enable_sysv_devices="no" ;; esac fi if [ ${enable_sysv_devices} = "yes" ] ; then if [ X${RTEMS_SHM_SEMAPHORE_KEY} = X -o X${RTEMS_SHM_KEY} = X ] ; then fatal RTEMS_SHM_SEMAPHORE_KEY and/or RTEMS_SHM_KEY not set fi fi cat <${log} 2>&1 & pid=$! # Make sure it won't run forever... time_run=0 while [ $time_run -lt $max_run_time ] do # sleep 1s at a time waiting for job to finish or timer to expire # if job has exited, then we exit, too. sleep 1 kill -0 $pid 2> /dev/null running=$? if [ $running -eq 0 ] ; then time_run=$((time_run + 5)) if [ $time_run -ge $max_run_time ]; then kill -9 $pid 2> /dev/null ran_too_long="yes" echo "${testname} killed after running ${max_run_time} seconds" fi grep "Suspending faulting task" ${log} >/dev/null 2>&1 Fault=$? grep "assertion failed" ${log} >/dev/null 2>&1 Assert=$? if [ $Fault -eq 0 -o $Assert -eq 0 ] ; then kill -9 $pid 2> /dev/null echo "${testname} failed after ${max_run_time} seconds" ran_too_long="no" break fi else ran_too_long="no" break fi done cat ${log} rm -f ${log} fi }