Print each output line with one command in test runners

When running multiple test suites in parallel -- e.g., as it
happens on the CI --, the names of the executed commands and the
results of the executions can/do get printed far from each other,
interrupted by other prints. This can make the reading of the
output hard. This patch prints each line with one echo command,
which makes the interruption of the line less likely.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2016-05-23 11:52:30 +02:00
parent 76ae2001a1
commit e4b0d81fbf
2 changed files with 9 additions and 14 deletions
+6 -10
View File
@@ -112,35 +112,31 @@ do
if [ "$IS_SNAPSHOT" == true ] if [ "$IS_SNAPSHOT" == true ]
then then
# Testing snapshot # Testing snapshot
SNAPSHOT_TEMP=`mktemp snapshot-out.XXXXXXXXXX` SNAPSHOT_TEMP=`mktemp snapshot-out.XXXXXXXXXX`
echo -n "[$tested/$total] ${ENGINE#$ROOT_DIR} $ENGINE_ARGS " cmd_line="${ENGINE#$ROOT_DIR} $ENGINE_ARGS --save-snapshot-for-global $SNAPSHOT_TEMP ${full_test#$ROOT_DIR}"
echo -n "--save-snapshot-for-global $SNAPSHOT_TEMP ${full_test#$ROOT_DIR}: "
( ulimit -t $TIMEOUT; $ENGINE $ENGINE_ARGS --save-snapshot-for-global $SNAPSHOT_TEMP $full_test &> $ENGINE_TEMP ) ( ulimit -t $TIMEOUT; $ENGINE $ENGINE_ARGS --save-snapshot-for-global $SNAPSHOT_TEMP $full_test &> $ENGINE_TEMP )
status_code=$? status_code=$?
if [ $status_code -eq 0 ] if [ $status_code -eq 0 ]
then then
echo "$PASS" echo "[$tested/$total] $cmd_line: PASS"
echo -n "[$tested/$total] ${ENGINE#$ROOT_DIR} $ENGINE_ARGS --exec-snapshot $SNAPSHOT_TEMP: "
cmd_line="${ENGINE#$ROOT_DIR} $ENGINE_ARGS --exec-snapshot $SNAPSHOT_TEMP"
( ulimit -t $TIMEOUT; $ENGINE $ENGINE_ARGS --exec-snapshot $SNAPSHOT_TEMP &> $ENGINE_TEMP ) ( ulimit -t $TIMEOUT; $ENGINE $ENGINE_ARGS --exec-snapshot $SNAPSHOT_TEMP &> $ENGINE_TEMP )
status_code=$? status_code=$?
fi fi
rm -f $SNAPSHOT_TEMP rm -f $SNAPSHOT_TEMP
else else
echo -n "[$tested/$total] ${ENGINE#$ROOT_DIR} $ENGINE_ARGS ${full_test#$ROOT_DIR}: " cmd_line="${ENGINE#$ROOT_DIR} $ENGINE_ARGS ${full_test#$ROOT_DIR}"
( ulimit -t $TIMEOUT; $ENGINE $ENGINE_ARGS $full_test &> $ENGINE_TEMP ) ( ulimit -t $TIMEOUT; $ENGINE $ENGINE_ARGS $full_test &> $ENGINE_TEMP )
status_code=$? status_code=$?
fi fi
if [ $status_code -ne $error_code ] if [ $status_code -ne $error_code ]
then then
echo "FAIL ($status_code)" echo "[$tested/$total] $cmd_line: FAIL ($status_code)"
cat $ENGINE_TEMP cat $ENGINE_TEMP
echo "$status_code: $test" >> $TEST_FAILED echo "$status_code: $test" >> $TEST_FAILED
@@ -152,7 +148,7 @@ do
failed=$((failed+1)) failed=$((failed+1))
else else
echo "$PASS" echo "[$tested/$total] $cmd_line: $PASS"
echo "$test" >> $TEST_PASSED echo "$test" >> $TEST_PASSED
+3 -4
View File
@@ -59,14 +59,13 @@ UNITTEST_TEMP=`mktemp unittest-out.XXXXXXXXXX`
for unit_test in $UNITTESTS for unit_test in $UNITTESTS
do do
echo -n "[$tested/$total] ${unit_test#$ROOT_DIR}: " cmd_line="${unit_test#$ROOT_DIR}"
$unit_test &>$UNITTEST_TEMP $unit_test &>$UNITTEST_TEMP
status_code=$? status_code=$?
if [ $status_code -ne 0 ] if [ $status_code -ne 0 ]
then then
echo "FAIL ($status_code)" echo "[$tested/$total] $cmd_line: FAIL ($status_code)"
cat $UNITTEST_TEMP cat $UNITTEST_TEMP
echo "$status_code: $unit_test" >> $UNITTEST_ERROR echo "$status_code: $unit_test" >> $UNITTEST_ERROR
@@ -78,7 +77,7 @@ do
failed=$((failed+1)) failed=$((failed+1))
else else
echo "PASS" echo "[$tested/$total] $cmd_line: PASS"
echo "$unit_test" >> $UNITTEST_OK echo "$unit_test" >> $UNITTEST_OK