Skip to content

Commit 449e9af

Browse files
committed
Better deal with duration computation
1 parent 6c97931 commit 449e9af

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

scripts/test.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,19 @@ fi
7171
# Unit tests
7272
if [[ "$TEST_TYPE" == *"UNIT"* ]]; then
7373

74+
SECONDS=0
75+
7476
/bin/bash "$SCRIPT_DIR/unit-tests.sh" run unit "$BUILD_DIR" "$SRC_DIR" "$RESULTS_DIR" $VM_MAX_PARALLEL_TESTS
7577
/bin/bash "$SCRIPT_DIR/unit-tests.sh" print-summary unit "$BUILD_DIR" "$SRC_DIR" "$RESULTS_DIR" $VM_MAX_PARALLEL_TESTS
7678

79+
duration=$SECONDS
80+
7781
echo "tests_suites=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-test-suites unit $BUILD_DIR $SRC_DIR $RESULTS_DIR)" > $RESULTS_DIR/unit-tests/unit-tests_results.txt
7882
echo "tests_total=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-tests unit $BUILD_DIR $SRC_DIR $RESULTS_DIR)" >> $RESULTS_DIR/unit-tests/unit-tests_results.txt
7983
echo "tests_disabled=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-disabled unit $BUILD_DIR $SRC_DIR $RESULTS_DIR)" >> $RESULTS_DIR/unit-tests/unit-tests_results.txt
8084
echo "tests_failures=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-failures unit $BUILD_DIR $SRC_DIR $RESULTS_DIR)" >> $RESULTS_DIR/unit-tests/unit-tests_results.txt
8185
echo "tests_errors=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-errors unit $BUILD_DIR $SRC_DIR $RESULTS_DIR)" >> $RESULTS_DIR/unit-tests/unit-tests_results.txt
82-
echo "tests_duration=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-durations unit $BUILD_DIR $SRC_DIR $RESULTS_DIR)" >> $RESULTS_DIR/unit-tests/unit-tests_results.txt
86+
echo "tests_duration=$duration" >> $RESULTS_DIR/unit-tests/unit-tests_results.txt
8387

8488
python3 "$SCRIPT_DIR/exctractErrorFromXML.py" "$RESULTS_DIR/unit-tests/reports" "$RESULTS_DIR/unit-tests"
8589

@@ -90,14 +94,19 @@ fi
9094
#############
9195
# Scene tests
9296
if [[ "$TEST_TYPE" == *"SCENE"* ]]; then
97+
98+
SECONDS=0
99+
93100
/bin/bash "$SCRIPT_DIR/scene-tests.sh" run "$BUILD_DIR" "$SRC_DIR" "$RESULTS_DIR" $VM_MAX_PARALLEL_TESTS
94101
/bin/bash "$SCRIPT_DIR/scene-tests.sh" print-summary "$BUILD_DIR" "$SRC_DIR" "$RESULTS_DIR" $VM_MAX_PARALLEL_TESTS
95102

103+
duration=$SECONDS
104+
96105
echo "scenes_total=$(/bin/bash $SCRIPT_DIR/scene-tests.sh count-tested-scenes $BUILD_DIR $SRC_DIR $RESULTS_DIR)" > $RESULTS_DIR/scene-tests/scene-tests_results.txt
97106
echo "scenes_successes=$(/bin/bash "$SCRIPT_DIR/scene-tests.sh" count-successes $BUILD_DIR $SRC_DIR $RESULTS_DIR)" >> $RESULTS_DIR/scene-tests/scene-tests_results.txt
98107
echo "scenes_errors=$(/bin/bash "$SCRIPT_DIR/scene-tests.sh" count-errors $BUILD_DIR $SRC_DIR $RESULTS_DIR)" >> $RESULTS_DIR/scene-tests/scene-tests_results.txt
99108
echo "scenes_crashes=$(/bin/bash "$SCRIPT_DIR/scene-tests.sh" count-crashes $BUILD_DIR $SRC_DIR $RESULTS_DIR)" >> $RESULTS_DIR/scene-tests/scene-tests_results.txt
100-
echo "scenes_duration=$(/bin/bash "$SCRIPT_DIR/scene-tests.sh" count-durations $BUILD_DIR $SRC_DIR $RESULTS_DIR)" >> $RESULTS_DIR/scene-tests/scene-tests_results.txt
109+
echo "scenes_duration=$duration" >> $RESULTS_DIR/scene-tests/scene-tests_results.txt
101110

102111
if [[ -f "$RESULTS_DIR/scene-tests/reports/crashes.txt" && "$(cat "$RESULTS_DIR/scene-tests/reports/crashes.txt")" != "" ]]; then
103112
cp $RESULTS_DIR/scene-tests/reports/crashes.txt $RESULTS_DIR/scene-tests_crashes
@@ -112,15 +121,20 @@ fi
112121
##################
113122
# Regression tests
114123
if [[ "$TEST_TYPE" == *"REGRESSION"* ]]; then
124+
125+
SECONDS=0
126+
115127
/bin/bash "$SCRIPT_DIR/unit-tests.sh" run regression "$BUILD_DIR" "$SRC_DIR" "$RESULTS_DIR" $VM_MAX_PARALLEL_TESTS
116128
/bin/bash "$SCRIPT_DIR/unit-tests.sh" print-summary regression "$BUILD_DIR" "$SRC_DIR" "$RESULTS_DIR" $VM_MAX_PARALLEL_TESTS
117129

130+
duration=$SECONDS
131+
118132
echo "regressions_suites=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-test-suites regression $BUILD_DIR $SRC_DIR $RESULTS_DIR )" > $RESULTS_DIR/regression-tests/regression-tests_results.txt
119133
echo "regressions_total=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-tests regression $BUILD_DIR $SRC_DIR $RESULTS_DIR )" >> $RESULTS_DIR/regression-tests/regression-tests_results.txt
120134
echo "regressions_disabled=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-disabled regression $BUILD_DIR $SRC_DIR $RESULTS_DIR )" >> $RESULTS_DIR/regression-tests/regression-tests_results.txt
121135
echo "regressions_failures=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-failures regression $BUILD_DIR $SRC_DIR $RESULTS_DIR )" >> $RESULTS_DIR/regression-tests/regression-tests_results.txt
122136
echo "regressions_errors=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-errors regression $BUILD_DIR $SRC_DIR $RESULTS_DIR )" >> $RESULTS_DIR/regression-tests/regression-tests_results.txt
123-
echo "regressions_duration=$(/bin/bash "$SCRIPT_DIR/unit-tests.sh" count-durations regression $BUILD_DIR $SRC_DIR $RESULTS_DIR )" >> $RESULTS_DIR/regression-tests/regression-tests_results.txt
137+
echo "regressions_duration=$duration" >> $RESULTS_DIR/regression-tests/regression-tests_results.txt
124138

125139
python3 "$SCRIPT_DIR/exctractErrorFromXML.py" "$RESULTS_DIR/regression-tests/reports" "$RESULTS_DIR/regression-tests"
126140
fi

0 commit comments

Comments
 (0)