Commit Graph

293 Commits

Author SHA1 Message Date
Joerg Sonnenberger c1e13e2fe5 Fix test syntax to work with non-bash /bin/sh.
llvm-svn: 206119
2014-04-12 21:13:41 +00:00
Daniel Dunbar 3db2acb71a [lit] Fix non-function style print statement.
llvm-svn: 203573
2014-03-11 14:05:49 +00:00
Daniel Dunbar aa344d4f92 [lit] Bump dev version number.
llvm-svn: 203498
2014-03-10 21:58:16 +00:00
Daniel Dunbar 91b4298309 [lit] Add a README.txt.
- Also, update MANIFEST.in and utils/check-sdist.

llvm-svn: 203497
2014-03-10 21:58:12 +00:00
Daniel Dunbar b8a82c295d [lit] Add --version option.
llvm-svn: 203496
2014-03-10 21:57:48 +00:00
Alp Toker 749971901a lit: Provide source locations in cfg files with older Python versions
This commit prospectively brings the benefits of r198766 to older supported
Python versions (2.5+).

Tested with Python 2.6, 2.7, 3.1 and 3.3 (!)

llvm-svn: 199009
2014-01-11 14:34:18 +00:00
Alp Toker f0a245944e lit: execfile() isn't present in Python 3.3
On the other hand, exec(compile()) doesn't work in older Python versions in the
2.x series.

This commit introduces exec(compile()) with a fallback to plain exec(). That'll
hopefully hit the sweet spot in terms of version support.

Followup to r198766 which added enhanced source locations for lit cfg parsing.

llvm-svn: 199006
2014-01-11 13:27:28 +00:00
Alp Toker 9e628916f6 lit: Provide file location in cfg error messages
Python doesn't do a good job at diagnosing string exec() so use execfile()
where available.

This should be a timesaver when trying to get to the bottom of build bot
failures.

Before:

    File "llvm/utils/lit/lit/TestingConfig.py", line 93, in load_from_path
      exec("exec data in cfg_globals")
    File "<string>", line 1, in <module>
    File "<string>", line 194, in <module>
  NameError: name 'typo' is not defined

After:

    File "llvm/utils/lit/lit/TestingConfig.py", line 95, in load_from_path
    execfile(path, cfg_globals)
    File "clang/test/lit.cfg", line 194, in <module>
      typo
      ^~~~
  NameError: name 'typo' is not defined

llvm-svn: 198766
2014-01-08 14:20:59 +00:00
Alp Toker e395023eab Python compatibility fix for r198150
Remove the stat call error reporting for now.

It wasn't essential so silent fallback should be fine here.

llvm-svn: 198155
2013-12-29 06:51:10 +00:00
Alp Toker 0324ee0a33 Prospective Python 3 fix for r198150
llvm-svn: 198152
2013-12-29 05:51:07 +00:00
Alp Toker fdef0e0d94 lit: Incremental test scheduling
Add option -i to prioritize test runs by source file modification time and
previous failure state.

This optimal scheduling reduces typical test-and-fix iteration times to a
matter of seconds by rapidly answering the questions:

  1) Did my recent change fix tests that were previously failing?
  2) Do the tests I just wrote / modified still work?

The current implementation requires write permissions to the source tree
because it uses mtimes to track failures.

llvm-svn: 198150
2013-12-29 05:09:05 +00:00
NAKAMURA Takumi b7bf04c02e Tweak lit/TestingConfig.py Py3-compatible. has_key is dead.
llvm-svn: 197462
2013-12-17 04:14:50 +00:00
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