Skip to contentSkip to conversation

kselftests: add per_test_log support

PATCH In review Hangbin Liu 1 participant 3 messages Nov 2, 2023 – Dec 11, 2023 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kselftests: add per_test_log support

By default, all the test output will be printed to stdout or output.log if -s supplied. The kselftest/runner.sh also supports per test log if the variable per_test_logging is set. So add new option -p to set this veriable. Note the -p option is conflict with -s option.

---
 tools/testing/selftests/run_kselftest.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/testing/selftests/run_kselftest.sh +5 -1
index 92743980e553..965220a314ce 100755
@@ -20,7 +20,8 @@ usage()
 {
 	cat <<EOF
 Usage: $0 [OPTIONS]
-  -s | --summary		Print summary with detailed log in output.log
+  -s | --summary		Print summary with detailed log in output.log (conflict with -p)
+  -p | --per_test_log		Print test log in /tmp with each test name (conflict with -s)
   -t | --test COLLECTION:TEST	Run TEST from COLLECTION
   -c | --collection COLLECTION	Run all tests from COLLECTION
   -l | --list			List the available collection:test entries
@@ -41,6 +42,9 @@ while true; do
 			logfile="$BASE_DIR"/output.log
 			cat /dev/null > $logfile
 			shift ;;
+		-p | --per_test_log)
+			per_test_logging=1
+			shift ;;
 		-t | --test)
 			TESTS="$TESTS $2"
 			shift 2 ;;
Signature · 1 line
2.41.0
#1 lore raw

Hi Shuah,

Any comments for this?

Thanks
Hangbin

Quoted 37 lines · Hangbin Liu

By default, all the test output will be printed to stdout or output.log if -s supplied. The kselftest/runner.sh also supports per test log if the variable per_test_logging is set. So add new option -p to set this veriable. Note the -p option is conflict with -s option.

---
 tools/testing/selftests/run_kselftest.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/testing/selftests/run_kselftest.sh +5 -1
index 92743980e553..965220a314ce 100755
@@ -20,7 +20,8 @@ usage()
 {
 	cat <<EOF
 Usage: $0 [OPTIONS]
-  -s | --summary		Print summary with detailed log in output.log
+  -s | --summary		Print summary with detailed log in output.log (conflict with -p)
+  -p | --per_test_log		Print test log in /tmp with each test name (conflict with -s)
   -t | --test COLLECTION:TEST	Run TEST from COLLECTION
   -c | --collection COLLECTION	Run all tests from COLLECTION
   -l | --list			List the available collection:test entries
@@ -41,6 +42,9 @@ while true; do
 			logfile="$BASE_DIR"/output.log
 			cat /dev/null > $logfile
 			shift ;;
+		-p | --per_test_log)
+			per_test_logging=1
+			shift ;;
 		-t | --test)
 			TESTS="$TESTS $2"
 			shift 2 ;;
Signature · 1 line
2.41.0
#2 lore raw

Ping Shuah. Is there any update I need?

Thanks
Hangbin

Quoted 44 lines · Hangbin Liu

Hi Shuah,

Any comments for this?

Thanks
Hangbin

Quoted 37 lines · Hangbin Liu

By default, all the test output will be printed to stdout or output.log if -s supplied. The kselftest/runner.sh also supports per test log if the variable per_test_logging is set. So add new option -p to set this veriable. Note the -p option is conflict with -s option.

---
 tools/testing/selftests/run_kselftest.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/testing/selftests/run_kselftest.sh +5 -1
index 92743980e553..965220a314ce 100755
@@ -20,7 +20,8 @@ usage()
 {
 	cat <<EOF
 Usage: $0 [OPTIONS]
-  -s | --summary		Print summary with detailed log in output.log
+  -s | --summary		Print summary with detailed log in output.log (conflict with -p)
+  -p | --per_test_log		Print test log in /tmp with each test name (conflict with -s)
   -t | --test COLLECTION:TEST	Run TEST from COLLECTION
   -c | --collection COLLECTION	Run all tests from COLLECTION
   -l | --list			List the available collection:test entries
@@ -41,6 +42,9 @@ while true; do
 			logfile="$BASE_DIR"/output.log
 			cat /dev/null > $logfile
 			shift ;;
+		-p | --per_test_log)
+			per_test_logging=1
+			shift ;;
 		-t | --test)
 			TESTS="$TESTS $2"
 			shift 2 ;;
Signature · 1 line
2.41.0