renaming
This commit is contained in:
68
anduril/testing/anduril-test-component
Executable file
68
anduril/testing/anduril-test-component
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/bin/bash
|
||||
|
||||
function return_error {
|
||||
echo "$1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ -f "$HOME/Documents/anduril_environment.sh" ]
|
||||
then . "$HOME/Documents/anduril_environment.sh"
|
||||
echo Read HOME/Documents/anduril_environment.sh
|
||||
fi
|
||||
|
||||
[ -d "$ANDURIL_HOME" ] || return_error "ANDURIL_HOME is not set!"
|
||||
[ -d "$ANDURIL_BUNDLES" ] || return_error "ANDURIL_BUNDLES is not set! (folder of bundles, may also be same as ANDURIL_HOME)"
|
||||
|
||||
echo ANDURIL_HOME="$ANDURIL_HOME"
|
||||
echo ANDURIL_BUNDLES="$ANDURIL_BUNDLES"
|
||||
|
||||
echo -n "Looking for bundles: "
|
||||
b="$ANDURIL_HOME/builtin/bundle.xml"
|
||||
BUNDLESTRING=" -b $( readlink -f $( dirname ${b} ) )"
|
||||
bname=$( cat "$b" | tr -d [:cntrl:] | grep '<name>' | sed 's/.*<name>\(.*\)<\/name>.*/\1/' )
|
||||
echo -n "$bname "
|
||||
[ -d "$( dirname ${b} )/components" ] && \
|
||||
list=$( find $( dirname ${b} )/components -maxdepth 2 -mindepth 2 -name component.xml -printf '%P\\n' | sed 's,/component.xml,,g' )
|
||||
[ -d "$( dirname ${b} )/functions" ] && \
|
||||
list=${list}$( find $( dirname ${b} )/functions -maxdepth 2 -mindepth 2 -name component.xml -printf '%P\\n' | sed 's,/component.xml,,g' )
|
||||
|
||||
for b in $( find -L "$ANDURIL_BUNDLES" -maxdepth 2 -name bundle.xml | grep -v '/testsystem/|/techtest/' ); do
|
||||
bname=$( cat "$b" | tr -d [:cntrl:] | grep '<name>' | sed 's/.*<name>\(.*\)<\/name>.*/\1/' )
|
||||
echo -n "$bname "
|
||||
[ -d "$( dirname ${b} )/components" ] && \
|
||||
list=${list}$( find $( dirname ${b} )/components -maxdepth 2 -mindepth 2 -name component.xml -printf '%P\\n' | sed 's,/component.xml,,g' )
|
||||
[ -d "$( dirname ${b} )/functions" ] && \
|
||||
list=${list}$( find $( dirname ${b} )/functions -maxdepth 2 -mindepth 2 -name component.xml -printf '%P\\n' | sed 's,/component.xml,,g' )
|
||||
BUNDLESTRING=${BUNDLESTRING}" -b $( dirname ${b} )"
|
||||
done
|
||||
echo ""
|
||||
list=( $( echo -e $list | sort ))
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
for (( n=0; n < ${#list[@]} ; n++ ))
|
||||
do echo $n: ${list[$n]}
|
||||
done
|
||||
echo "all: ALL"
|
||||
echo "clean: delete log and exec folders"
|
||||
exit 0
|
||||
fi
|
||||
if [[ "$1" == ?([0-9]*) ]]
|
||||
then # is numeric
|
||||
echo test ${list[$1]}
|
||||
echo $ANDURIL_HOME/bin/anduril test ${list[$1]} --log log_component -d result_component ${BUNDLESTRING}
|
||||
$ANDURIL_HOME/bin/anduril test ${list[$1]} --log log_component -d result_component ${BUNDLESTRING}
|
||||
else # is not numeric
|
||||
if [ $1 = "all" ]
|
||||
then for (( n=0; n < ${#list[@]} ; n++ ))
|
||||
do echo running: ${list[$n]}
|
||||
$ANDURIL_HOME/bin/anduril test ${list[$n]} --log log_component -d result_component ${BUNDLESTRING}
|
||||
done
|
||||
elif [ $1 = "clean" ]
|
||||
then rm -vrf log_component result_component
|
||||
else
|
||||
echo test $1
|
||||
echo $ANDURIL_HOME/bin/anduril test $1 --log log_component -d result_component ${BUNDLESTRING}
|
||||
$ANDURIL_HOME/bin/anduril test $1 --log log_component -d result_component ${BUNDLESTRING}
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user