Commit Graph

281 Commits

Author SHA1 Message Date
Alp Toker
188545867d 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193516 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-28 10:26:13 +00:00
Alp Toker
bbe8f3b0e1 Clarify the comment about BSD versions in r193465
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193508 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-27 20:49:19 +00:00
Joerg Sonnenberger
0435c5dbec 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-26 13:25:45 +00:00
Alp Toker
a685c13918 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193465 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-26 09:29:58 +00:00
Alp Toker
8d93aa0de3 Fix a referenced before assignment in r193463
Some versions of Python on the builders seem strict about this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193464 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-26 08:46:05 +00:00
Alp Toker
a4e71dea48 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193463 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-26 08:22:44 +00:00
Alp Toker
59b8e0419c 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193457 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-26 02:43:08 +00:00
Rafael Espindola
b94be5f21e Try to fix the openbsd bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193413 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-25 15:07:59 +00:00
Rafael Espindola
d80961c91f Actually switch the default to use multiprocessing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 22:32:53 +00:00
Daniel Dunbar
279a89ebdb [lit] Stop hacking the GIL check interval.
- This was never a big win, and is irrelevant now that we commonly use
   multiprocessing based parallelism.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193280 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 22:19:32 +00:00
Daniel Dunbar
a0d3bcfd8c [lit] Use multiprocessing based parallelism by default, on Unix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193279 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 22:19:07 +00:00
NAKAMURA Takumi
651ffc703e Lit: LIT_PRESERVES_TMP should be aware of TMPDIR, too.
TMPDIR is preferred in Unix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192891 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-17 13:11:13 +00:00
NAKAMURA Takumi
9f64a56aba 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192887 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-17 12:10:12 +00:00
Daniel Dunbar
2849503ab2 [lit] Add an --output option, for writing results in a machine readable form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190738 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-14 01:19:17 +00:00
Daniel Dunbar
ff058f0a70 [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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190535 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 17:45:11 +00:00
Daniel Dunbar
4b3e5f24ec [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189885 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 23:32:55 +00:00
Daniel Dunbar
e0ff96c112 [lit] [tests] Add missing test input file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189561 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 03:02:34 +00:00
Daniel Dunbar
cb4bfb3409 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189559 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 02:52:10 +00:00
Daniel Dunbar
4ac723b53f [lit] Add support for multiprocessing, under --use-processes for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189556 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 00:54:23 +00:00
Daniel Dunbar
df44de6d91 [lit] Implement --max-time support by using provider cancel method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189555 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 00:54:19 +00:00
Daniel Dunbar
07f0f16bfd [lit] Refactor test execution logic into lit.run.Run.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189554 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 00:54:15 +00:00
Daniel Dunbar
b11b690d3f [lit] Put display lock inside the ThreadResultsConsumer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189553 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 00:54:09 +00:00
Daniel Dunbar
ec8e059254 [lit] Factor out a results consumer interface for test execution.
- Also, change TestProvider interface to operate on test indices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189552 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 00:54:02 +00:00
Daniel Dunbar
8c59003cc3 [lit] Move top-level execute code into Run object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189551 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 00:48:55 +00:00
Daniel Dunbar
5b2efc28fd [lit] Factor out Run class to capture configuration + discovered tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189550 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 00:48:45 +00:00
Daniel Dunbar
8253cc047d [lit] Change lit.Test.ResultCode to be unique across pickling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189549 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 00:48:39 +00:00
Daniel Dunbar
6f25e872e4 [lit] Add a TODO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189546 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 00:41:15 +00:00
Daniel Dunbar
501cba385c [lit] Update shtest format to return lit.Test.Result objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189545 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 00:41:09 +00:00
Daniel Dunbar
8a1d9b207a [lit] Update LitTestCase to support lit.Test.Result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189544 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 00:40:59 +00:00
Daniel Dunbar
4db169d31e [lit] Fix a couple lingering Py3 compat issues in ProgressBar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188951 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 22:26:47 +00:00
Daniel Dunbar
f72bc79226 [lit] Lift XFAIL handling to core infrastructure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188949 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 22:26:42 +00:00
Daniel Dunbar
d3bf8a2c0a [lit] Allow formats to return lit.Test.Result instances directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188948 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 22:26:40 +00:00
Daniel Dunbar
ccd21b26dd [lit] Factor out a separate Test.Result() object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188947 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 22:26:37 +00:00
Daniel Dunbar
0dd41a99e3 [lit] Simplify --time-tests code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188946 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 22:26:34 +00:00
Daniel Dunbar
7b0cdf7bf4 [lit] Extract TestFormat base class, for future use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188945 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 22:26:26 +00:00
Daniel Dunbar
70360e6762 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188590 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-16 23:30:23 +00:00
Daniel Dunbar
23114d0da7 [lit] Remove some done TODOs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188502 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 22:52:20 +00:00
Daniel Dunbar
4fa5939268 [lit] Add test coverage of gtest format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188417 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 22:21:11 +00:00
Daniel Dunbar
80a06baec2 [lit] Ensure test output is converted to strings where possible.
- This cleans up the text output of failing tests when run under PY3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188416 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 22:21:01 +00:00
Daniel Dunbar
35d5e9044c [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 18:22:41 +00:00
Daniel Dunbar
14a5c695a9 Revert r188376, "[lit] Support parsing scripts with inconsistent or invalid encodings.", this doesn't work yet for bots using the internal shell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188379 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 15:55:25 +00:00
Daniel Dunbar
47e7c040f4 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188376 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 15:24:58 +00:00
Daniel Dunbar
af5a9e3f1e [lit] Fix a relative import issue I missed earlier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188360 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 05:07:16 +00:00
Daniel Dunbar
213ab86ee6 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188359 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 05:07:13 +00:00
Daniel Dunbar
6b78ef3762 [lit] Fix tests to execute lit with same python as invoked with.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188358 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 05:07:09 +00:00
Daniel Dunbar
5403214852 [lit] Factor ShTest format script command parsing from other processing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188357 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 05:07:04 +00:00
Daniel Dunbar
493e8d4bf5 [lit] Move executeCommand() into lit.util.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188356 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 05:07:01 +00:00
Daniel Dunbar
f76c664f6b [lit] Move formats into their own subpackage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188355 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 05:06:55 +00:00
NAKAMURA Takumi
e908486f5b Lit: Introduce "%/[STpst] into parseIntegratedTestScript(), to normalize substitutions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188348 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 02:26:31 +00:00
Daniel Dunbar
13e26da155 [lit] Support use of setup.py from other directories.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188309 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 19:08:48 +00:00