Skip to content

Commit 163182b

Browse files
committed
run-test.sh: inherit unified stdout capture from init_env
- Source ./init_env first so global tee is activated once per session. - Remove any per-script capture logic; rely on exported RUN_STDOUT_FILE. - Ensure child ./run.sh inherits the environment unchanged (no semantic changes). - Minor cleanup to avoid duplicate env setup; logging remains via functestlib. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
1 parent d66cdaf commit 163182b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Runner/run-test.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
99
# Set TOOLS path to utils under the script directory
1010
TOOLS="$SCRIPT_DIR/utils"
1111

12+
# Disable wrapper-level capture; each test will capture in its own folder
13+
export RUN_STDOUT_ENABLE=0
14+
unset RUN_STDOUT_TAG RUN_STDOUT_FILE
15+
1216
# Safely source init_env from the same directory as this script
1317
if [ -f "$SCRIPT_DIR/init_env" ]; then
1418
# shellcheck source=/dev/null
@@ -46,7 +50,11 @@ execute_test_case() {
4650
run_script="$test_path/run.sh"
4751
if [ -f "$run_script" ]; then
4852
log "Executing test case: $test_name"
49-
(cd "$test_path" && sh "./run.sh" "$@")
53+
(
54+
cd "$test_path" || exit 2
55+
# Enable per-test capture in the test folder with a clear tag
56+
RUN_STDOUT_ENABLE=1 RUN_STDOUT_TAG="$test_name" sh "./run.sh" "$@"
57+
)
5058
res_file="$test_path/$test_name.res"
5159
if [ -f "$res_file" ]; then
5260
if grep -q "SKIP" "$res_file"; then
@@ -131,7 +139,8 @@ Usage:
131139
Notes:
132140
- Extra args are forwarded only when a single <testcase_name> is specified.
133141
- 'all' runs every test and does not accept additional args.
134-
- Use -h or --help to display this message.
142+
- Each test captures stdout/stderr next to its .res file as:
143+
<testname>_stdout_<timestamp>.log
135144
EOF
136145
}
137146

0 commit comments

Comments
 (0)