diff --git a/bin/mainutil.sh b/bin/mainutil.sh index 7079a02..17bb378 100644 --- a/bin/mainutil.sh +++ b/bin/mainutil.sh @@ -214,12 +214,13 @@ function printSuitesCases { # Checks for every case if there was a matching enty in cases array # $1 current suite index # $2 suite depth -# $3 Name of parent suites -# use caseToExecuteParent from parent +# $3 path of suites +# $4 list of parent suite indexes function checkCaseMatch { isDebug && printDebug "******* $FUNCNAME $*" local i j - local y + local y x + local allSuiteIndexes="$4 $1" local caseToExecuteHere='' for i in ${childCases[$1]}; do y="${3}::${casesName[$i]}" @@ -237,22 +238,22 @@ function checkCaseMatch { fi done done + if [[ -n $caseToExecuteHere ]]; then + for x in $allSuiteIndexes; do + isDebug && printDebug "execute suite $x ${suitesName[$x]}" + executeSuite[$x]='true' + done + fi local newDeth=$(($2+1)) - local x - local caseToExecuteInSuites='' for x in ${childSuites[$1]}; do - local spath="$3/${suitesName[$x]}" - local caseToExecuteParent='' - checkCaseMatch "$x" "$newDeth" "$spath" - if [[ -n $caseToExecuteParent ]]; then - caseToExecuteInSuites='true' + local spath="$3" + if [[ -z $spath ]]; then + spath="${suitesName[$x]}" + else + spath+="/${suitesName[$x]}" fi + checkCaseMatch "$x" "$newDeth" "$spath" "$allSuiteIndexes" done - if [[ ( -n $caseToExecuteHere ) || ( -n $caseToExecuteInSuites ) ]]; then - isDebug && printDebug "execute suite $1 ${suitesName[$1]}" - caseToExecuteParent='true' - executeSuite[$1]='true' - fi } # diff --git a/bin/runTTF b/bin/runTTF index 816cec2..8bb6f37 100755 --- a/bin/runTTF +++ b/bin/runTTF @@ -434,7 +434,7 @@ else declare -rx TTRO_skipIgnore="true" takeAllCases="" declare caseToExecuteParent='' - checkCaseMatch '0' '0' '' + checkCaseMatch '0' '0' '' '' if [[ -n $caseToExecuteParent ]]; then executeSuite[0]='true' fi @@ -624,8 +624,8 @@ for x in VARIANT SUCCESS SKIP FAILURE ERROR SUITE_VARIANT SUITE_ERROR; do fi done #put results to results file for information purose only -echo -e "VARIANT=$VARIANTCount\nSUCCESS=$SUCCESSCount\nSKIP=$SKIPCount\nFAILURE=$FAILURECount\nERROR=$ERRORCount" > "${TTRO_workDir}/RESULT" -echo -e "SUITE_VARIANT=$SUITE_VARIANTCount SUITE_ERROR=$SUITE_ERRORCount" +#echo -e "VARIANT=$VARIANTCount\nSUCCESS=$SUCCESSCount\nSKIP=$SKIPCount\nFAILURE=$FAILURECount\nERROR=$ERRORCount" > "${TTRO_workDir}/RESULT" +#echo -e "SUITE_VARIANT=$SUITE_VARIANTCount SUITE_ERROR=$SUITE_ERRORCount" #Print suite errors and collection if [[ $SUITE_ERRORCount -gt 0 ]]; then diff --git a/test/emptyCase/TestCollection.sh b/test/emptyCase/TestCollection.sh deleted file mode 100644 index e69de29..0000000 diff --git a/test/emptySuite/TestCollection.sh b/test/emptySuite/TestCollection.sh deleted file mode 100644 index e69de29..0000000 diff --git a/test/noSuite/TestCollection.sh b/test/noSuite/TestCollection.sh deleted file mode 100644 index e69de29..0000000 diff --git a/test/Selftest/Execution/TestSuite.sh b/test/selftest/Selftest/Execution/TestSuite.sh similarity index 100% rename from test/Selftest/Execution/TestSuite.sh rename to test/selftest/Selftest/Execution/TestSuite.sh diff --git a/test/Selftest/Execution/simpleCaseSucc/TestCase.sh b/test/selftest/Selftest/Execution/simpleCaseSucc/TestCase.sh similarity index 100% rename from test/Selftest/Execution/simpleCaseSucc/TestCase.sh rename to test/selftest/Selftest/Execution/simpleCaseSucc/TestCase.sh diff --git a/test/Selftest/Execution/simpleCaseSucc/testCollection/Suite/Case/TTestCase.sh b/test/selftest/Selftest/Execution/simpleCaseSucc/testCollection/Suite/Case/TTestCase.sh similarity index 100% rename from test/Selftest/Execution/simpleCaseSucc/testCollection/Suite/Case/TTestCase.sh rename to test/selftest/Selftest/Execution/simpleCaseSucc/testCollection/Suite/Case/TTestCase.sh diff --git a/test/Selftest/Execution/simpleCaseSucc/testCollection/Suite/TTestSuite.sh b/test/selftest/Selftest/Execution/simpleCaseSucc/testCollection/Suite/TTestSuite.sh similarity index 100% rename from test/Selftest/Execution/simpleCaseSucc/testCollection/Suite/TTestSuite.sh rename to test/selftest/Selftest/Execution/simpleCaseSucc/testCollection/Suite/TTestSuite.sh diff --git a/test/Selftest/Execution/simpleCaseSucc/testCollection/TTestCollection.sh b/test/selftest/Selftest/Execution/simpleCaseSucc/testCollection/TTestCollection.sh similarity index 100% rename from test/Selftest/Execution/simpleCaseSucc/testCollection/TTestCollection.sh rename to test/selftest/Selftest/Execution/simpleCaseSucc/testCollection/TTestCollection.sh diff --git a/test/Selftest/Invocation/HelpFunctions/TestCase.sh b/test/selftest/Selftest/Invocation/HelpFunctions/TestCase.sh similarity index 100% rename from test/Selftest/Invocation/HelpFunctions/TestCase.sh rename to test/selftest/Selftest/Invocation/HelpFunctions/TestCase.sh diff --git a/test/Selftest/Invocation/HelpFunctions/test/TestCollection.sh b/test/selftest/Selftest/Invocation/HelpFunctions/test/TestCollection.sh similarity index 100% rename from test/Selftest/Invocation/HelpFunctions/test/TestCollection.sh rename to test/selftest/Selftest/Invocation/HelpFunctions/test/TestCollection.sh diff --git a/test/Selftest/Invocation/InvokeError/TestCase.sh b/test/selftest/Selftest/Invocation/InvokeError/TestCase.sh similarity index 100% rename from test/Selftest/Invocation/InvokeError/TestCase.sh rename to test/selftest/Selftest/Invocation/InvokeError/TestCase.sh diff --git a/test/Selftest/Invocation/NoParams/TestCase.sh b/test/selftest/Selftest/Invocation/NoParams/TestCase.sh similarity index 100% rename from test/Selftest/Invocation/NoParams/TestCase.sh rename to test/selftest/Selftest/Invocation/NoParams/TestCase.sh diff --git a/test/Selftest/Invocation/TestSuite.sh b/test/selftest/Selftest/Invocation/TestSuite.sh similarity index 100% rename from test/Selftest/Invocation/TestSuite.sh rename to test/selftest/Selftest/Invocation/TestSuite.sh diff --git a/test/Selftest/SuitesAndCases/EmptyCase/TestCase.sh b/test/selftest/Selftest/SuitesAndCases/EmptyCase/TestCase.sh similarity index 100% rename from test/Selftest/SuitesAndCases/EmptyCase/TestCase.sh rename to test/selftest/Selftest/SuitesAndCases/EmptyCase/TestCase.sh diff --git a/test/Selftest/SuitesAndCases/EmptyCase/testCollection/Suite/Case/TTestCase.sh b/test/selftest/Selftest/SuitesAndCases/EmptyCase/testCollection/Suite/Case/TTestCase.sh similarity index 100% rename from test/Selftest/SuitesAndCases/EmptyCase/testCollection/Suite/Case/TTestCase.sh rename to test/selftest/Selftest/SuitesAndCases/EmptyCase/testCollection/Suite/Case/TTestCase.sh diff --git a/test/Selftest/SuitesAndCases/EmptyCase/testCollection/Suite/TTestSuite.sh b/test/selftest/Selftest/SuitesAndCases/EmptyCase/testCollection/Suite/TTestSuite.sh similarity index 100% rename from test/Selftest/SuitesAndCases/EmptyCase/testCollection/Suite/TTestSuite.sh rename to test/selftest/Selftest/SuitesAndCases/EmptyCase/testCollection/Suite/TTestSuite.sh diff --git a/test/Selftest/SuitesAndCases/EmptyCase/testCollection/TTestCollection.sh b/test/selftest/Selftest/SuitesAndCases/EmptyCase/testCollection/TTestCollection.sh similarity index 100% rename from test/Selftest/SuitesAndCases/EmptyCase/testCollection/TTestCollection.sh rename to test/selftest/Selftest/SuitesAndCases/EmptyCase/testCollection/TTestCollection.sh diff --git a/test/Selftest/SuitesAndCases/EmptyInputDir/TestCase.sh b/test/selftest/Selftest/SuitesAndCases/EmptyInputDir/TestCase.sh similarity index 100% rename from test/Selftest/SuitesAndCases/EmptyInputDir/TestCase.sh rename to test/selftest/Selftest/SuitesAndCases/EmptyInputDir/TestCase.sh diff --git a/test/Selftest/SuitesAndCases/EmptyInputDir/testCollection/.gitkeep b/test/selftest/Selftest/SuitesAndCases/EmptyInputDir/testCollection/.gitkeep similarity index 100% rename from test/Selftest/SuitesAndCases/EmptyInputDir/testCollection/.gitkeep rename to test/selftest/Selftest/SuitesAndCases/EmptyInputDir/testCollection/.gitkeep diff --git a/test/Selftest/SuitesAndCases/EmptySuite/TestCase.sh b/test/selftest/Selftest/SuitesAndCases/EmptySuite/TestCase.sh similarity index 100% rename from test/Selftest/SuitesAndCases/EmptySuite/TestCase.sh rename to test/selftest/Selftest/SuitesAndCases/EmptySuite/TestCase.sh diff --git a/test/Selftest/SuitesAndCases/EmptySuite/testCollection/Suite/TTestSuite.sh b/test/selftest/Selftest/SuitesAndCases/EmptySuite/testCollection/Suite/TTestSuite.sh similarity index 100% rename from test/Selftest/SuitesAndCases/EmptySuite/testCollection/Suite/TTestSuite.sh rename to test/selftest/Selftest/SuitesAndCases/EmptySuite/testCollection/Suite/TTestSuite.sh diff --git a/test/Selftest/SuitesAndCases/EmptySuite/testCollection/TTestCollection.sh b/test/selftest/Selftest/SuitesAndCases/EmptySuite/testCollection/TTestCollection.sh similarity index 100% rename from test/Selftest/SuitesAndCases/EmptySuite/testCollection/TTestCollection.sh rename to test/selftest/Selftest/SuitesAndCases/EmptySuite/testCollection/TTestCollection.sh diff --git a/test/Selftest/SuitesAndCases/NoSuite/TestCase.sh b/test/selftest/Selftest/SuitesAndCases/NoSuite/TestCase.sh similarity index 100% rename from test/Selftest/SuitesAndCases/NoSuite/TestCase.sh rename to test/selftest/Selftest/SuitesAndCases/NoSuite/TestCase.sh diff --git a/test/Selftest/SuitesAndCases/NoSuite/testCollection/TestCollection.sh b/test/selftest/Selftest/SuitesAndCases/NoSuite/testCollection/TestCollection.sh similarity index 100% rename from test/Selftest/SuitesAndCases/NoSuite/testCollection/TestCollection.sh rename to test/selftest/Selftest/SuitesAndCases/NoSuite/testCollection/TestCollection.sh diff --git a/test/Selftest/SuitesAndCases/TestSuite.sh b/test/selftest/Selftest/SuitesAndCases/TestSuite.sh similarity index 100% rename from test/Selftest/SuitesAndCases/TestSuite.sh rename to test/selftest/Selftest/SuitesAndCases/TestSuite.sh diff --git a/test/Selftest/TestCollection.sh b/test/selftest/Selftest/TestSuite.sh similarity index 91% rename from test/Selftest/TestCollection.sh rename to test/selftest/Selftest/TestSuite.sh index 2c20ae4..2c66b46 100644 --- a/test/Selftest/TestCollection.sh +++ b/test/selftest/Selftest/TestSuite.sh @@ -3,7 +3,7 @@ ################################### # register tool module -registerTool "$TTRO_inputDir/TestTools.sh" +registerTool "$TTRO_inputDirSuite/TestTools.sh" #Test collection preparation PREPS='modifyAll' @@ -16,7 +16,7 @@ function modifyPrefix { if [[ $1 == $2 ]]; then printErrorAndExit "$FUNCNAME: Origin and destination must be different file" $errRt fi - sed -e "s/TT_/TY_/g;s/TTRO_/TYRO_/g;s/TTP_/TYP_/g;s/TTPN_/TYPN_/g" "$1" > "$2" + sed -e "s/TT_/TY_/g;s/TTRO_/TYRO_/g;s/TTP_/TYP_/g;s/TTPN_/TYPN_/g;s/TTXX_/TYXX_/g" "$1" > "$2" } TTRO_help_modifyAll=' diff --git a/test/Selftest/TestTools.sh b/test/selftest/Selftest/TestTools.sh similarity index 95% rename from test/Selftest/TestTools.sh rename to test/selftest/Selftest/TestTools.sh index 08368ac..a711569 100644 --- a/test/Selftest/TestTools.sh +++ b/test/selftest/Selftest/TestTools.sh @@ -13,7 +13,7 @@ function copyAndModifyTestCollection { if [[ -d $destDir ]]; then cp -rp "$sourceDir" "$destDir" local x - for x in $TEST_PROPERTIES $TEST_COLLECTION_FILE $TEST_SUITE_FILE $TEST_CASE_FILE; do + for x in $TEST_PROPERTIES $TEST_SUITE_FILE $TEST_CASE_FILE; do renameInSubdirs "$destDir/testCollection" "T$x" "$x" done fi diff --git a/test/Selftest/TestProperties.sh b/test/selftest/TestProperties.sh similarity index 100% rename from test/Selftest/TestProperties.sh rename to test/selftest/TestProperties.sh