Commit Graph

16 Commits

Author SHA1 Message Date
Zachary Turner 58968ac83f Make uses of unicode literals portable.
Six provides six.u() which resolves to either u"" or "" depending on
Python version, and and six.unichr() which resolves to either unichr()
or chr() depending on Python version.  Use these functions anywhere
where we were relying on u"" or unichr().

llvm-svn: 251139
2015-10-23 19:52:36 +00:00
Zachary Turner 35d017f0fc Add from __future__ import print_function everywhere.
Apparently there were tons of instances I missed last time, I
guess I accidentally ran 2to3 non-recursively.  This should be
every occurrence of a print statement fixed to use a print function
as well as from __future__ import print_function being added to
every file.

After this patch print statements will stop working everywhere in
the test suite, and the print function should be used instead.

llvm-svn: 251121
2015-10-23 17:04:29 +00:00
Zachary Turner 814236d694 Use six to portably handle module renames in Python 2 and 3
llvm-svn: 250915
2015-10-21 17:48:52 +00:00
Todd Fiala ea73624e5f Cleaned up results formatter options hand-off.
* --results-formatter-options renamed to --results-formatter-option,
  with short version of -O

* Multiple --results-formatter-option=OPTION can be specified.  The
  comma-separating mechanism has been removed.

* XunitFormatter options modified: -n and -r are now short forms of
  --ignore-skip-name and --ignore-skip-reason.  Those long option
  names were tweaked lightly.  They also can be specified multiple
  times on the command line.  The comma-separating, multiple-pattern-
  per-option mechanism has been removed.

One can now specify:

  dotest.py --results-file stdout -O-ndsym -O-nlldb-mi

for example, to ignore reporting skips for dsym-related or lldb-mi-related
tests in the xUnit report.

llvm-svn: 248384
2015-09-23 15:21:28 +00:00
Todd Fiala 132c2c4bc7 xUnit test formatter: add options for ignoring skipped tests
Skipped tests can be dropped from xUnit reports if either
the name or the skip reason matches one of a given set of
regular expression patterns (via re.search(), not re.match()).
New formatter option for the xunit formatter:
--ignore-skip-matching-reason and
--ignore-skip-matching-name

Both are results-formatter options.

llvm-svn: 248247
2015-09-22 06:32:50 +00:00
Greg Clayton 87349248d4 Split the curses stuff out into a separate file so that we can import curses and lldbcurses at the module level.
Added key press handling and a first responder system and the ability for windows that can be first responders to be selected and have key presses routed to the first resonder, delegates and also travel up the parent chain.

Remove the temp file that was being created.

llvm-svn: 248232
2015-09-22 00:35:20 +00:00
Todd Fiala de9a44e3e9 test framework: parallel test runner sends terminate to formatter before printing to stdout
The parallel test runner now sends the terminate event to the formatter
(if there is one) after the parallel test runs but before dumping anything
to stdout/stderr at the end of the run.  This allows the existing
stdout/stderr summary reporting to co-exist nicely with a formatter like
the test_results.Curses that otherwise clobbers the screen.

llvm-svn: 248228
2015-09-22 00:15:50 +00:00
Greg Clayton b0d148e9f3 Fixed up the curses test results formatter to:
- rename "Failures" window to "Completed Tests"
- Remove the extra lock that I incorrectly added to the ResultsFormatter as it already had one
- Init the curses GUI with the right number of jobs when handling the "intialize" event
- tear down the curses GUI when tests complete

llvm-svn: 248179
2015-09-21 17:25:01 +00:00
Greg Clayton 1827fc25ab Added a curses based way to see the test suite running. Works only where curses is implemented. Try it out with:
./dotest.py --results-formatter=test_results.Curses --results-file=/dev/stdout

llvm-svn: 248072
2015-09-19 00:39:09 +00:00
Todd Fiala f77f8ae450 test events: add test_filename to all test-related events.
The test_filename is the full path to the TestCase class's
implementation file.

llvm-svn: 248060
2015-09-18 22:57:04 +00:00
Todd Fiala e83f140833 test events: announce worker count in new initialize event
See the following for details:
http://reviews.llvm.org/D12987

llvm-svn: 248059
2015-09-18 22:45:31 +00:00
Todd Fiala 33896a9872 Adds parallel work queue index to test events, stdout/stderr results support.
See http://reviews.llvm.org/D12983 for details.

llvm-svn: 248036
2015-09-18 21:01:13 +00:00
Todd Fiala 8effde40ce xUnit test output: implemented proper xml escaping
Now does proper Unicode code region scanning for invalid XML
characters.  Strips out XML-invalid characters.

Does this for:
failure result: message, backtrace
error result: message, backtrace
skipped test: skip reason

pexpect timeouts were still generating characters that would break
XML readers (correctly so).

llvm-svn: 247998
2015-09-18 16:00:52 +00:00
Todd Fiala e7e911f06b xunit output: add backtraces; limit attribute
When pexpect errors occurred, the <error>/<failure> element's
message attribute could get too long and contain
invalid characters for xml attributes, even when quoted.
Particularly for pexpect failures.

Now <error> and <failure> entries truncate the message
attribute to contain the first line of the message.

<error> and <failure> blocks now contain both the
complete message and the backtrace (finally!) in the
text body of the error/failure element.

llvm-svn: 247973
2015-09-18 07:08:09 +00:00
Todd Fiala 038bf833c4 Fixed test runner output for Jenkins xUnit publish
The Jenkins JUnit publisher handled our output, but
the Jenkins xUnit plugin's JUnit support did not like
that we didn't have a <testsuites> element wrapping
everything.  They both work with this fix.

llvm-svn: 247962
2015-09-18 01:43:08 +00:00
Todd Fiala 68615ce606 Add JUnit/XUnit-formatted output to the lldb test run system
Also introduces the test event system into our test runner framework.
See the following for details:
http://reviews.llvm.org/D12831

llvm-svn: 247722
2015-09-15 21:38:04 +00:00