Message ID | 1537377552-37142-1-git-send-email-peng.hao2@zte.com.cn (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] kvm-unit-test: fix script output abnormal | expand |
On 19/09/2018 19:19, Peng Hao wrote: > ./run_tests.sh > )ASS apic-split (50 tests; > )ASS ioapic-split (19 tests; > )ASS apic (50 tests; > )ASS ioapic (19 tests; > )ASS smptest (1 tests; > )ASS smptest3 (1 tests; > > The problem come from commit 0f4f2acb2c880607518cb740a6aa06acafd05855 > (x86: io: force carriage return on \n put to serial port). It maybe output > well in real hardware, but it let outputs to file with '\r'. > > Changes v1 --> v2: > changes in scripts/runtime.bash can affect other arch. I think v1 is better, we can just catch the \r with an optional match: diff --git a/scripts/runtime.bash b/scripts/runtime.bash index a31ae91..3f5f3e2 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -8,7 +8,8 @@ FAIL() { echo -ne "\e[31mFAIL\e[0m"; } extract_summary() { - tail -3 | grep '^SUMMARY: ' | sed 's/^SUMMARY: /(/;s/$/)/' + local cr=$'\r' + tail -3 | grep '^SUMMARY: ' | sed 's/^SUMMARY: /(/;s/'"$cr"'\{0,1\}$/)/' } # We assume that QEMU is going to work if it tried to load the kernel (also added some portability stuff for non-GNU sed). Paolo
diff --git a/lib/x86/io.c b/lib/x86/io.c index edac5bc..3be55d7 100644 --- a/lib/x86/io.c +++ b/lib/x86/io.c @@ -6,6 +6,7 @@ #ifndef USE_SERIAL #define USE_SERIAL #endif +#undef USE_SERIAL_HARDWARE_OUTPUT static struct spinlock lock; static int serial_iobase = 0x3f8; @@ -24,9 +25,11 @@ static void serial_outb(char ch) static void serial_put(char ch) { +#ifdef USE_SERIAL_HARDWARE_OUTPUT /* Force carriage return to be performed on \n */ if (ch == '\n') serial_outb('\r'); +#endif serial_outb(ch); }
./run_tests.sh )ASS apic-split (50 tests; )ASS ioapic-split (19 tests; )ASS apic (50 tests; )ASS ioapic (19 tests; )ASS smptest (1 tests; )ASS smptest3 (1 tests; The problem come from commit 0f4f2acb2c880607518cb740a6aa06acafd05855 (x86: io: force carriage return on \n put to serial port). It maybe output well in real hardware, but it let outputs to file with '\r'. Changes v1 --> v2: changes in scripts/runtime.bash can affect other arch. Signed-off-by: Peng Hao <peng.hao2@zte.com.cn> --- lib/x86/io.c | 3 +++ 1 file changed, 3 insertions(+)