Skip to content

Commit

Permalink
wrong line ordering in test execution
Browse files Browse the repository at this point in the history
  • Loading branch information
jandrlik committed Feb 27, 2024
1 parent 6175b7a commit 8004269
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions testHeadlessComponents.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,6 @@ function run_swing_component_test_fake {
run_java_with_headless $TEST_BOOL $TEST_ARGUMENT
}

function processResults {

if [ $1 -eq 0 ]; then
let "PASSED+=1"
TEST=$(printXmlTest "thc" "$2" "0")
BODY+="$TEST"
echo "$2 PASSED\n"
else
let "FAILED+=1"
TEST=$(printXmlTest "thc" "$2" "0" "$LOGFILE" "$LOGFILE")
BODY+="$TEST"
echo "$2 FAILED\n"
fi

}
set -e
FAILED=0
PASSED=0
Expand Down Expand Up @@ -216,21 +201,21 @@ for testOption in compatible incompatible; do
for headless in true false; do
if [[ "$JREJDK" == "jre" || "$JREJDK" == "jdk" && (("${testOption}${headless}" == "compatibletrue") || ("${testOption}${headless}" == "incompatiblefalse")) ]] ; then
run_swing_component_test_unset ${testOption} ${headless} > $CURRENT_LOG 2>&1
cat $CURRENT_LOG >> $LOGFILE
processTestResultIntoBodyLine "jre_headless_${testOption}_${headless}_display_unset" "$?" "$CURRENT_LOG"
cat $CURRENT_LOG >> $LOGFILE
fi

if [[ "x$XDISPLAY" == "x" ]] ; then
echo "skipping tests with display set, as the default display was not defined"
else
run_swing_component_test_set ${testOption} ${headless} > $CURRENT_LOG 2>&1
cat $CURRENT_LOG >> $LOGFILE
processTestResultIntoBodyLine "jre_headless_${testOption}_${headless}_display_set" "$?" "$CURRENT_LOG"
cat $CURRENT_LOG >> $LOGFILE
fi
if [[ "$JREJDK" == "jre" || "$JREJDK" == "jdk" && (("${testOption}${headless}" == "compatibletrue") || ("${testOption}${headless}" == "incompatiblefalse")) ]] ; then
run_swing_component_test_fake ${testOption} ${headless} > $CURRENT_LOG 2>&1
cat $CURRENT_LOG >> $LOGFILE
processTestResultIntoBodyLine "jre_headless_${testOption}_${headless}_display_fake" "$?" "$CURRENT_LOG"
cat $CURRENT_LOG >> $LOGFILE
fi
done
done
Expand All @@ -245,6 +230,7 @@ let "TESTS = $FAILED + $PASSED + $IGNORED"

XMLREPORT=$TMPRESULTS/testHeadlessComponent.jtr.xml
printXmlHeader $PASSED $FAILED $TESTS $IGNORED "testHeadlessComponent" > $XMLREPORT

while IFS= read -r LINE; do
printf "%s\n" "$LINE" >> "$XMLREPORT"
done < $BODY_FILE
Expand Down

0 comments on commit 8004269

Please sign in to comment.