diff mbox series

selftests: cpufreq: Write test output to stdout as well

Message ID 20220114232126.92043-1-nfraprado@collabora.com (mailing list archive)
State Accepted
Headers show
Series selftests: cpufreq: Write test output to stdout as well | expand

Commit Message

Nícolas F. R. A. Prado Jan. 14, 2022, 11:21 p.m. UTC
Use 'tee' to send the test output to stdout in addition to the current
output file. This makes the output easier to handle in automated test
systems and is superior to only later dumping the output file contents
to stdout, since this way the test output can be interleaved with other
log messages, like from the kernel, so that chronology is preserved,
making it easier to detect issues.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
 tools/testing/selftests/cpufreq/main.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Viresh Kumar Jan. 17, 2022, 6:41 a.m. UTC | #1
On 14-01-22, 18:21, Nícolas F. R. A. Prado wrote:
> Use 'tee' to send the test output to stdout in addition to the current
> output file. This makes the output easier to handle in automated test
> systems and is superior to only later dumping the output file contents
> to stdout, since this way the test output can be interleaved with other
> log messages, like from the kernel, so that chronology is preserved,
> making it easier to detect issues.
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> ---
>  tools/testing/selftests/cpufreq/main.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/cpufreq/main.sh b/tools/testing/selftests/cpufreq/main.sh
> index 31f8c9a76c5f..60ce18ed0666 100755
> --- a/tools/testing/selftests/cpufreq/main.sh
> +++ b/tools/testing/selftests/cpufreq/main.sh
> @@ -194,5 +194,5 @@ prerequisite
>  
>  # Run requested functions
>  clear_dumps $OUTFILE
> -do_test >> $OUTFILE.txt
> +do_test | tee -a $OUTFILE.txt
>  dmesg_dumps $OUTFILE

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Shuah Khan Jan. 25, 2022, 8:51 p.m. UTC | #2
On 1/16/22 11:41 PM, Viresh Kumar wrote:
> On 14-01-22, 18:21, Nícolas F. R. A. Prado wrote:
>> Use 'tee' to send the test output to stdout in addition to the current
>> output file. This makes the output easier to handle in automated test
>> systems and is superior to only later dumping the output file contents
>> to stdout, since this way the test output can be interleaved with other
>> log messages, like from the kernel, so that chronology is preserved,
>> making it easier to detect issues.
>>
>> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
>> ---
>>   tools/testing/selftests/cpufreq/main.sh | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/cpufreq/main.sh b/tools/testing/selftests/cpufreq/main.sh
>> index 31f8c9a76c5f..60ce18ed0666 100755
>> --- a/tools/testing/selftests/cpufreq/main.sh
>> +++ b/tools/testing/selftests/cpufreq/main.sh
>> @@ -194,5 +194,5 @@ prerequisite
>>   
>>   # Run requested functions
>>   clear_dumps $OUTFILE
>> -do_test >> $OUTFILE.txt
>> +do_test | tee -a $OUTFILE.txt
>>   dmesg_dumps $OUTFILE
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> 

Thank you. Applied to linux-kselftest fixes for rc2/3

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/testing/selftests/cpufreq/main.sh b/tools/testing/selftests/cpufreq/main.sh
index 31f8c9a76c5f..60ce18ed0666 100755
--- a/tools/testing/selftests/cpufreq/main.sh
+++ b/tools/testing/selftests/cpufreq/main.sh
@@ -194,5 +194,5 @@  prerequisite
 
 # Run requested functions
 clear_dumps $OUTFILE
-do_test >> $OUTFILE.txt
+do_test | tee -a $OUTFILE.txt
 dmesg_dumps $OUTFILE