Commit Graph

281 Commits

Author SHA1 Message Date
Alp Toker d0cdc67caa lit: multiprocessing platform fix attempt
The error raised by Python varies by platform(!), so let's just catch any
exception and fall back.

Thanks to Sylvestre Ledru for noticing this on a Debian / Python 2.7 system
running code coverage.

llvm-svn: 193516
2013-10-28 10:26:13 +00:00
Alp Toker 31bd72fb22 Clarify the comment about BSD versions in r193465
llvm-svn: 193508
2013-10-27 20:49:19 +00:00
Joerg Sonnenberger 853b460e4f self.path may be empty or otherwise miss the normal system directories,
so try PATH next. Assume it is sane enough to cover the usual system
bash locations too, but the old list is not good enough for NetBSD.

llvm-svn: 193471
2013-10-26 13:25:45 +00:00
Alp Toker 54d210b205 lit: Issue a note when multiprocessing fails to load
If multiprocessing was requested, detected as available and subsequently failed
to initialize it's worth letting the user know about it before falling back to
threads.

This condition can arise in certain OpenBSD / FreeBSD Python versions.

llvm-svn: 193465
2013-10-26 09:29:58 +00:00
Alp Toker 6c5dbd7a0a Fix a referenced before assignment in r193463
Some versions of Python on the builders seem strict about this.

llvm-svn: 193464
2013-10-26 08:46:05 +00:00
Alp Toker 9ade45482a lit: handle late multiprocessing errors gracefully
This should be a better fix for lit multiprocessing failures, replacing the
OpenBSD and FreeBSD workarounds in r193413 and r193457.

Reference: http://bugs.python.org/issue3770
llvm-svn: 193463
2013-10-26 08:22:44 +00:00
Alp Toker 5853534b03 Attempt to fix the FreeBSD build, disable multiprocessing
Speculative quick fix based on clang-X86_64-freebsd output:

  File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line 33, in <module>
    " function, see issue 3770.")
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.

llvm-svn: 193457
2013-10-26 02:43:08 +00:00
Rafael Espindola 5e82540d11 Try to fix the openbsd bot.
llvm-svn: 193413
2013-10-25 15:07:59 +00:00
Rafael Espindola f059064d95 Actually switch the default to use multiprocessing
llvm-svn: 193282
2013-10-23 22:32:53 +00:00
Daniel Dunbar cdca362e65 [lit] Stop hacking the GIL check interval.
- This was never a big win, and is irrelevant now that we commonly use
   multiprocessing based parallelism.

llvm-svn: 193280
2013-10-23 22:19:32 +00:00
Daniel Dunbar 1fc709cd3e [lit] Use multiprocessing based parallelism by default, on Unix.
llvm-svn: 193279
2013-10-23 22:19:07 +00:00
NAKAMURA Takumi 1c19a0f4a8 Lit: LIT_PRESERVES_TMP should be aware of TMPDIR, too.
TMPDIR is preferred in Unix.

llvm-svn: 192891
2013-10-17 13:11:13 +00:00
NAKAMURA Takumi 199f138a07 Lit: Introduce an environment variable, $LIT_PRESERVES_TMP, to preserve TMP (and TEMP).
This is intended to check how many temporary files would be generated in automated builders.

llvm-svn: 192887
2013-10-17 12:10:12 +00:00
Daniel Dunbar cd625f4e54 [lit] Add an --output option, for writing results in a machine readable form.
llvm-svn: 190738
2013-09-14 01:19:17 +00:00
Daniel Dunbar 9aeba4963a [lit] Add support for attach arbitrary metrics to test results.
- This is a work-in-progress and all details are subject to change, but I am
   trying to build up support for allowing lit to be used as a driver for
   performance tests (or other tests which might want to record information
   beyond simple PASS/FAIL).

llvm-svn: 190535
2013-09-11 17:45:11 +00:00
Daniel Dunbar dac381a323 [lit] Allow config files to pass arbitrary values to child configs.
- This aligns with how existing test suites end up wanting to use the local
   config files, conceptually it makes sense to consider them to be inherited.

llvm-svn: 189885
2013-09-03 23:32:55 +00:00
Daniel Dunbar 9d8271b351 [lit] [tests] Add missing test input file.
llvm-svn: 189561
2013-08-29 03:02:34 +00:00
Daniel Dunbar b8da61fd1b [lit] Fix internal shell's argv[0] handling.
- At least on OS X, it is important for correct behavior of /bin/[ that argv[0]
   is passed as written, and not as the full executable path.

llvm-svn: 189559
2013-08-29 02:52:10 +00:00
Daniel Dunbar 9a83a76b1b [lit] Add support for multiprocessing, under --use-processes for now.
llvm-svn: 189556
2013-08-29 00:54:23 +00:00
Daniel Dunbar b3954fa889 [lit] Implement --max-time support by using provider cancel method.
llvm-svn: 189555
2013-08-29 00:54:19 +00:00
Daniel Dunbar 57ab2df070 [lit] Refactor test execution logic into lit.run.Run.
llvm-svn: 189554
2013-08-29 00:54:15 +00:00
Daniel Dunbar eecb1c1d25 [lit] Put display lock inside the ThreadResultsConsumer.
llvm-svn: 189553
2013-08-29 00:54:09 +00:00
Daniel Dunbar 516dc8b9be [lit] Factor out a results consumer interface for test execution.
- Also, change TestProvider interface to operate on test indices.

llvm-svn: 189552
2013-08-29 00:54:02 +00:00
Daniel Dunbar 562b83a64c [lit] Move top-level execute code into Run object.
llvm-svn: 189551
2013-08-29 00:48:55 +00:00
Daniel Dunbar a1b1ca7a38 [lit] Factor out Run class to capture configuration + discovered tests.
llvm-svn: 189550
2013-08-29 00:48:45 +00:00
Daniel Dunbar d73eaabc8f [lit] Change lit.Test.ResultCode to be unique across pickling.
llvm-svn: 189549
2013-08-29 00:48:39 +00:00
Daniel Dunbar 89d0321774 [lit] Add a TODO.
llvm-svn: 189546
2013-08-29 00:41:15 +00:00
Daniel Dunbar bef5955e22 [lit] Update shtest format to return lit.Test.Result objects.
llvm-svn: 189545
2013-08-29 00:41:09 +00:00
Daniel Dunbar 71c06c0cc2 [lit] Update LitTestCase to support lit.Test.Result.
llvm-svn: 189544
2013-08-29 00:40:59 +00:00
Daniel Dunbar 39be0b4b4c [lit] Fix a couple lingering Py3 compat issues in ProgressBar.
llvm-svn: 188951
2013-08-21 22:26:47 +00:00
Daniel Dunbar 898d0d34a9 [lit] Lift XFAIL handling to core infrastructure.
llvm-svn: 188949
2013-08-21 22:26:42 +00:00
Daniel Dunbar 02ae385cac [lit] Allow formats to return lit.Test.Result instances directly.
llvm-svn: 188948
2013-08-21 22:26:40 +00:00
Daniel Dunbar 61821065a2 [lit] Factor out a separate Test.Result() object.
llvm-svn: 188947
2013-08-21 22:26:37 +00:00
Daniel Dunbar cf5599cc11 [lit] Simplify --time-tests code.
llvm-svn: 188946
2013-08-21 22:26:34 +00:00
Daniel Dunbar dd003d3332 [lit] Extract TestFormat base class, for future use.
llvm-svn: 188945
2013-08-21 22:26:26 +00:00
Daniel Dunbar 3f0ec8045c [lit] Rewrite TODO list, and elaborate on some things.
- If anyone is interested in lit's feature set, I'd appreciate any comments on
   the elaborated items.

llvm-svn: 188590
2013-08-16 23:30:23 +00:00
Daniel Dunbar 730dee40ca [lit] Remove some done TODOs.
llvm-svn: 188502
2013-08-15 22:52:20 +00:00
Daniel Dunbar 301d387929 [lit] Add test coverage of gtest format.
llvm-svn: 188417
2013-08-14 22:21:11 +00:00
Daniel Dunbar 54d613b97f [lit] Ensure test output is converted to strings where possible.
- This cleans up the text output of failing tests when run under PY3.

llvm-svn: 188416
2013-08-14 22:21:01 +00:00
Daniel Dunbar e469b981f3 [lit] Support parsing scripts with inconsistent or invalid encodings.
- For whatever reason, we have a lot of test files with bogus unicode
   characters. This patch allows those scripts to still be parsed on Python3 by
   changing the parsing logic to work on binary files, and only require the
   actual script commands to be convertible to ascii.

 - This patch has been tweaked to now ensure that the command strings are not of
   unicode type on Python 2.6-7.

llvm-svn: 188398
2013-08-14 18:22:41 +00:00
Daniel Dunbar 16b934d624 Revert r188376, "[lit] Support parsing scripts with inconsistent or invalid encodings.", this doesn't work yet for bots using the internal shell.
llvm-svn: 188379
2013-08-14 15:55:25 +00:00
Daniel Dunbar cf0702601a [lit] Support parsing scripts with inconsistent or invalid encodings.
- For whatever reason, we have a lot of test files with bogus unicode
   characters. This patch allows those scripts to still be parsed on Python3 by
   changing the parsing logic to work on binary files, and only require the
   actual script commands to be convertible to ascii.

llvm-svn: 188376
2013-08-14 15:24:58 +00:00
Daniel Dunbar b7b4c11c6a [lit] Fix a relative import issue I missed earlier.
llvm-svn: 188360
2013-08-14 05:07:16 +00:00
Daniel Dunbar abb0695237 [lit] Avoid StringIO.
- We barely used it, and it is very hard to use in a 2.5-3 compatible
   way because of changing expectations for its input types.

llvm-svn: 188359
2013-08-14 05:07:13 +00:00
Daniel Dunbar 6d0ed4cd16 [lit] Fix tests to execute lit with same python as invoked with.
llvm-svn: 188358
2013-08-14 05:07:09 +00:00
Daniel Dunbar 1ba25a1e56 [lit] Factor ShTest format script command parsing from other processing.
llvm-svn: 188357
2013-08-14 05:07:04 +00:00
Daniel Dunbar 0a4a23ebac [lit] Move executeCommand() into lit.util.
llvm-svn: 188356
2013-08-14 05:07:01 +00:00
Daniel Dunbar 962fdef115 [lit] Move formats into their own subpackage.
llvm-svn: 188355
2013-08-14 05:06:55 +00:00
NAKAMURA Takumi 8a3357d252 Lit: Introduce "%/[STpst] into parseIntegratedTestScript(), to normalize substitutions.
llvm-svn: 188348
2013-08-14 02:26:31 +00:00
Daniel Dunbar 1be0c73a94 [lit] Support use of setup.py from other directories.
llvm-svn: 188309
2013-08-13 19:08:48 +00:00