#!/bin/sh # $Id: javachdir32.in 66722 2013-06-21 19:16:33Z cxh $ # Read the arguments, change to a directory and invoke java. # This script is used by the Ant junit tests in $PTII/build.xml # This script reads its arguments and looks for an argument # "org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" and # the argument after that contains the class to be run, for example # "ptolemy.actor.lib.io.test.junit.JUnitTclTest" The script strips off # the "junit.JUnitTclTest" changes to the ptolemy.a.ctor.lib.io.test # directory and invokes java. echo "javachdir: pwd: `pwd`" echo "javachdir: args: $@" for argument in "$@" do if [ "$nextArgumentIsClass" = "true" ]; then nextArgumentIsClass=false directory=`echo $argument | awk -F . '{printf("%s", $1); for( i=2; i<(NF-1); i++) { printf("/%s", $i)} printf("\n")}'` if [ ! -d $directory ]; then directory="$ptolemyPtIIDir/$directory" fi if [ ! -d $directory ]; then directory=`echo $argument | awk -F / '{printf("%s", $1); for( i=2; i<(NF-1); i++) { printf("/%s", $i)} printf("\n")}'` fi echo "javachdir: directory = $directory" break fi case "$argument" in org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner) nextArgumentIsClass=true ;; -Dptolemy.ptII.dir=*) ptolemyPtIIDir=`echo $argument | sed 's@-Dptolemy.ptII.dir=@@'` #echo "javachdir: ptolemy.ptII.dir = $ptolemyPtIIDir" ;; esac done cd $directory echo "javachdir: `pwd`" echo $@ # PTJAVA32_DIR is set by configure. ptolemy/util/test/junit/javachdir32.in is read by configure and javachdir32 is created. /usr/lib/jvm/jdk1.8.0_25x86/bin/java -d32 $@