cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lorinb...@apache.org
Subject [2/2] spec commit: [CB-2913] toetag script toetag iterates through the default directory, gives test sane names, should handle adding tests sanely slow, too much grep
Date Fri, 05 Apr 2013 22:56:04 GMT
[CB-2913] toetag script
toetag iterates through the default directory,
gives test sane names, should handle adding tests sanely
slow, too much grep


Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/b0e1455e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/b0e1455e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/b0e1455e

Branch: refs/heads/toetagger
Commit: b0e1455e65e02965c6279f1f5a8f2fd54693956b
Parents: 5e1763e
Author: Md Monirul Islam <lorin@adobe.com>
Authored: Fri Apr 5 15:49:55 2013 -0700
Committer: Md Monirul Islam <lorin@adobe.com>
Committed: Fri Apr 5 15:49:55 2013 -0700

----------------------------------------------------------------------
 bin/toetag |   55 +++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 39 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/b0e1455e/bin/toetag
----------------------------------------------------------------------
diff --git a/bin/toetag b/bin/toetag
index 678f278..6a8ff27 100755
--- a/bin/toetag
+++ b/bin/toetag
@@ -34,30 +34,51 @@ defaultpath="../autotest/tests/"
 # regex for id'ing a spec
 specreg="it(\".*"
 # regex for id'ing a tagged spec
-tagged="SPEC-1234"
-
+tagged="spec.[0-9]{1,}?"
+# default suite name
 suitename="SUITE"
 
-#greptests=$(grep  --include=*.js $specreg ../autotest/tests/device.tests.js)
-
-#$grepuntagged=$(grep -o $tagged $greptests)
-
-#totag=$(grep  --include=*.js $specreg ../autotest/tests/device.tests.js | grep -v $tagged)
#|  sed -i "" s/it(\".*/it(\"SUITE-SPEC.*/
-#echo $totag | sed s/it\(\"/it\(\"SUITE-SPEC\ / ../autotest/tests/device.tests.js
-
-
-# read all entries in default_path
-read -a targets <<< $(ls $defaultpath)
-
 toetagtargets() {
     for file in ${targets[@]}
     do
         echo toetagging $file
         suitename $file
         echo Suite Name: $suitename
-        #found=$(grep -c $specreg $defaultpath$file)
-        #echo found $found specs to toetag
-        #totag=$(
+        found=$(grep -c $specreg $defaultpath$file)
+        foundtagged=$(grep -c $tagged $defaultpath$file)
+        echo found $found specs to toetag
+        echo found $foundtagged specs already tagged
+        tagcode=0
+        declare -i tagcode
+#        totag=$(grep --include=*.js $specreg ../autotest/tests/device.tests.js | grep -v
$tagged)
+#        cat $file | sed s/it\(\"/it\(\"$suitename.spec.$tagcode\ / $defaultpath$file 
+        temp=$IFS
+        IFS="
+"
+        for line in $(cat $defaultpath$file)
+        do
+#            if [[ "$(grep -c $tagged $line)" -eq "1" ]]
+#            then
+#               echo aosehusaehou 
+#            fi
+            #echo $line
+            isTag=$(echo $line | grep -c $tagged)
+            canTag=$(echo $line | grep -c $specreg)
+
+            if [[ $canTag -eq '1' && $isTagged -ne '1' ]]
+            then
+                tagcode=$tagcode+1
+                echo $line | sed s/it\(\"/it\(\"$suitename.spec.$tagcode\ /
+            fi
+
+            # guy=$(grep -c $tagged $line)
+            #echo $tagcode
+            #echo $line | sed s/it\(\"/it\(\"$suitename.spec.$tagcode\ /
+        done
+        echo 
+        IFS=$temp
+        echo 
+	    echo
     done
 }
 
@@ -68,6 +89,8 @@ suitename() {
     IFS=$temp
 }
 
+# read all entries in default_path
+read -a targets <<< $(ls $defaultpath)
 
 toetagtargets
 #echo ${#targets[*]}


Mime
View raw message