This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Logging for MI


Hi Stan,
Some cents on test case.

On Monday, June 25, 2012 12:08:14 AM Stan Shebs wrote:
> +pass "Log file has '$logcontent'"
> +

This is not needed, and cause test summary quite long.

> +set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+"
> +
> +if [regexp
> "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"al
> l\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\
> ]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_
> log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt
> " $logcontent] { +    pass "Log file contents"
> +} else {
> +    fail "Log file contents"
> +}
> +
> +# Now try the redirect, which writes into the file only.
> +
> +mi_gdb_test "-gdb-set logging redirect on" ".*" "redirect logging on"
> +
> +# Since all output will be going into the file, just keep sending commands
> +# and don't expect anything to appear until logging is turned off.
> +
> +send_gdb "1001-gdb-set logging on\n"
> +send_gdb "1002-exec-step\n"
> +send_gdb "1003-exec-next\n"
> +
> +mi_gdb_test "1004-gdb-set logging off" ".*" "redirect logging off"
> +
> +set chan [open $milogfile]
> +set logcontent [read $chan]
> +close $chan
> +
> +pass "Log file has '$logcontent'"
> +

Likewise.

> +if [regexp
> "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thre
> ad-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\"
> ,.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"al
> l\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\
> ]+$mi_log_prompt" $logcontent] { +    pass "Redirect log file contents"
> +} else {
> +    fail "Redirect log file contents"
> +}
> +
> +mi_gdb_exit

Add "remote_file host delete ${milogfile}" here?

-- 
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]