[pisa-src] r2546 - trunk/tools/testbed/scripts/pisa-testbed

  • From: Samuel Richter <samuel.richter@xxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Tue, 19 Apr 2011 17:36:08 +0200

Author: richter
Date: Tue Apr 19 17:36:08 2011
New Revision: 2546

Log:
update of main testbed script
now its possible to exclude nodes by preceding them with '-'.
also the handling of extern classes has improved slightly.

Modified:
   trunk/tools/testbed/scripts/pisa-testbed

Modified: trunk/tools/testbed/scripts/pisa-testbed
==============================================================================
--- trunk/tools/testbed/scripts/pisa-testbed    Tue Apr 19 17:33:18 2011        
(r2545)
+++ trunk/tools/testbed/scripts/pisa-testbed    Tue Apr 19 17:36:08 2011        
(r2546)
@@ -75,7 +75,14 @@
     if [ "$1" = all ]; then
         TARGETS=$(tail -q -n1 $BUILD_PATH/*_classes)
     else
-        TARGETS=$(echo "${TARGETS:+$TARGETS\n}$(grep -l "$1" 
$BUILD_PATH/*_classes | xargs tail -q -n1)" | sort | uniq)
+        if echo "$1" | grep -q '^-'; then
+            NO_TARGETS=$(grep -l "${1#-}" $BUILD_PATH/*_classes | xargs tail 
-q -n1)
+            for NO_TARGET in $NO_TARGETS; do
+                TARGETS=$(echo "$TARGETS" | grep -v -i -F "$NO_TARGET")
+            done
+        else
+            TARGETS=$(echo "${TARGETS:+$TARGETS\n}$(grep -l "$1" 
$BUILD_PATH/*_classes | xargs tail -q -n1)" | sort | uniq)
+        fi
     fi
     shift
 done
@@ -84,14 +91,13 @@
 [ -d "$PLUGIN_PATH/actions/$ACTION" ] || (echo "action \"${ACTION}\" not 
found"; usage; exit 1)
 ARGUMENTS=$*
 
-cat "$BUILD_PATH"/*_classes | sort | uniq | while read -r CLASS; do
+for NODE in $TARGETS; do cat "$BUILD_PATH/$NODE"_classes; done | sort | uniq | 
while read -r CLASS; do
    CLASS_PATH="$TESTBED_PATH/plugins/extern/$CLASS"
    if [ -d "$CLASS_PATH" ]; then
        [ -f "$CLASS_PATH/$ACTION" ] && . "$CLASS_PATH/$ACTION" && 
"${ACTION}_$CLASS"
    fi
 done
 
-
 [ -f "$PLUGIN_PATH/actions/$ACTION/pre_hook" ] && . 
"$PLUGIN_PATH/actions/$ACTION/pre_hook"
 
 if [ -f "$PLUGIN_PATH/actions/$ACTION/node_hook" ]; then
-- 
This is the pisa developer mailing list. Please also subscribe to the main pisa 
list at:
//www.freelists.org/list/pisa

Other related posts:

  • » [pisa-src] r2546 - trunk/tools/testbed/scripts/pisa-testbed - Samuel Richter