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 v2 1/8] A virtual terminal for the test suite


>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> I took a look through the whole series and it all looks good.  I did
Andrew> have one observation, see below...

>> +Term::command "list main"
>> +set text [Term::get_all_lines]
>> +gdb_assert {[regexp "21 *return 0" $text]} "list main"

Andrew> This pattern of 'Term::get_all_lines' followed by a regexp check crops
Andrew> up a lot throughout the series.  I wonder if there's any merit in
Andrew> providing a wrapper, something like:

Andrew>   Term::command "list main"
Andrew>   gdb_assert {[Term::regexp "21 *return 0"]} "list main"

Andrew> Just an idea.

Good idea.  Actually I think I will shorten it even further to something
like

Term::check_contents $regexp $testname

If this works out adequately, I plan to push it in.

thanks,
Tom


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