1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
Commit Graph

297 Commits

Author SHA1 Message Date
Daniel Dunbar
91157ca2ce [lit] Extract TestFormat base class, for future use.
llvm-svn: 188945
2013-08-21 22:26:26 +00:00
Daniel Dunbar
9148692110 [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
b13a7b8362 [lit] Remove some done TODOs.
llvm-svn: 188502
2013-08-15 22:52:20 +00:00
Daniel Dunbar
c42a1a12f5 [lit] Add test coverage of gtest format.
llvm-svn: 188417
2013-08-14 22:21:11 +00:00
Daniel Dunbar
038eff59f7 [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
f362cc8910 [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
1a2916808e 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
2057e032f2 [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
72dd0252d9 [lit] Fix a relative import issue I missed earlier.
llvm-svn: 188360
2013-08-14 05:07:16 +00:00
Daniel Dunbar
2a30db9a35 [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
da8043318c [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
61398985bb [lit] Factor ShTest format script command parsing from other processing.
llvm-svn: 188357
2013-08-14 05:07:04 +00:00
Daniel Dunbar
bdf149e143 [lit] Move executeCommand() into lit.util.
llvm-svn: 188356
2013-08-14 05:07:01 +00:00
Daniel Dunbar
1377ab9362 [lit] Move formats into their own subpackage.
llvm-svn: 188355
2013-08-14 05:06:55 +00:00
NAKAMURA Takumi
e2881219b4 Lit: Introduce "%/[STpst] into parseIntegratedTestScript(), to normalize substitutions.
llvm-svn: 188348
2013-08-14 02:26:31 +00:00
Daniel Dunbar
a1f2b781ab [lit] Support use of setup.py from other directories.
llvm-svn: 188309
2013-08-13 19:08:48 +00:00
Daniel Dunbar
5a4d2b0583 [lit] Remove old ExamplesTests directory.
- The actual tests have better coverage than those, and they weren't useful
   anymore.

llvm-svn: 188110
2013-08-09 21:39:36 +00:00
Daniel Dunbar
7a71edafdb [lit] Move ManyTests examples to lit/examples/many-tests.
llvm-svn: 188109
2013-08-09 21:39:28 +00:00
Daniel Dunbar
a2f42119d5 [lit] Drop deprecated aliases for lit and old module names.
llvm-svn: 188108
2013-08-09 21:39:24 +00:00
Daniel Dunbar
118970db3a [lit] Update lit's own tests to use lit_config and lit package, as appropriate.
llvm-svn: 188107
2013-08-09 21:39:17 +00:00
Daniel Dunbar
57185707f2 [lit] Fix typo.
- Noticed by edward-san (IRC).

llvm-svn: 188096
2013-08-09 19:39:42 +00:00
Daniel Dunbar
8884fe65a5 [lit] Rename lit.{TestFormats,Util} to their aliased names {formats,util}.
- With compatibility hack in lit.__init__, so this hopefully shouldn't break
   anything.

llvm-svn: 188040
2013-08-09 00:37:15 +00:00
Daniel Dunbar
3be0993727 [lit] Inject the lit specific config object as 'lit_config' when loading config files.
- Injecting it as 'lit' is gross, since that name should be used to refer to
   the actual package. For now both are available so it is possibly to cleanup
   test config files incrementally.

llvm-svn: 188039
2013-08-09 00:37:05 +00:00
Daniel Dunbar
038271ce61 [lit] Split TestingConfig.frompath() into separate ctor and load methods.
llvm-svn: 188038
2013-08-09 00:36:58 +00:00
Daniel Dunbar
afc3dc05ad [lit] Eliminate mustExist parameter from TestingConfig.frompath().
llvm-svn: 188034
2013-08-09 00:09:02 +00:00
Daniel Dunbar
a5a0a4f18a [lit] Only create config copies when a local config file is present.
llvm-svn: 188033
2013-08-09 00:08:56 +00:00
Daniel Dunbar
b3b908fad3 [lit] Eliminate parent argument from TestingConfig.frompath(), which is effectively unused.
llvm-svn: 188032
2013-08-09 00:08:46 +00:00
Daniel Dunbar
f46311361c [lit] Change --show-{tests,suites} to exit after printing.
- This is a more sensible behavior than printing and also running tests.

llvm-svn: 188009
2013-08-08 20:59:25 +00:00
Daniel Dunbar
afca64a31c [lit] Remove --repeat option, which wasn't that useful.
llvm-svn: 188008
2013-08-08 20:59:20 +00:00
Daniel Dunbar
f5fcc2c5f4 [lit] Eliminate some nested imports.
llvm-svn: 188007
2013-08-08 20:59:16 +00:00
Daniel Dunbar
a172055173 [lit] Remove on_clone member, which is no longer used.
llvm-svn: 188006
2013-08-08 20:59:13 +00:00
Daniel Dunbar
c00fca31ba [lit] Remove unnecessary list copy.
llvm-svn: 187934
2013-08-07 23:10:20 +00:00
Daniel Dunbar
91b5aa5eb1 [lit] Always list individual UNRESOLVED tests.
llvm-svn: 187933
2013-08-07 23:10:05 +00:00
Daniel Dunbar
a81b869a40 [lit] Explicitly convert dict items() result to a list.
llvm-svn: 187932
2013-08-07 23:10:01 +00:00
Daniel Dunbar
a417c84423 [lit] Make string encoding issues explicit.
llvm-svn: 187931
2013-08-07 23:09:55 +00:00
Daniel Dunbar
c0857e132c [lit] Report the traceback when config import fails.
llvm-svn: 187920
2013-08-07 21:43:34 +00:00
Daniel Dunbar
ffb7ba128b [lit] Avoid comparisons with None.
llvm-svn: 187919
2013-08-07 21:43:23 +00:00
Daniel Dunbar
3c1d742e14 [lit] Use list comprehensions instead of map().
llvm-svn: 187918
2013-08-07 21:43:17 +00:00
Daniel Dunbar
fa196394e8 [lit] Avoid deprecated dict.has_key() method.
llvm-svn: 187917
2013-08-07 21:43:12 +00:00
NAKAMURA Takumi
38dd5e35e8 lit/LitConfig.py: Fixup for msys bash.
llvm-svn: 187896
2013-08-07 17:21:23 +00:00
NAKAMURA Takumi
78313cfb19 Lit: Fixup in r187886.
llvm-svn: 187887
2013-08-07 12:53:53 +00:00
NAKAMURA Takumi
babe518ee1 Lit: Resurrect --no-execute dropped in r187852.
For now, builders in bb.pgr.jp are using it.

llvm-svn: 187886
2013-08-07 12:44:29 +00:00
Daniel Dunbar
5a2d7118d8 [lit] Use py2&3 compatible exec() syntax.
llvm-svn: 187862
2013-08-07 03:25:28 +00:00
Daniel Dunbar
e3dc2d9d07 [lit] Use newer StringIO class.
llvm-svn: 187861
2013-08-07 03:24:20 +00:00
Daniel Dunbar
1e8b8bb858 [lit] Use modern absolute/relative import style.
llvm-svn: 187860
2013-08-07 03:23:12 +00:00
Daniel Dunbar
cf8cfa0363 [lit] Avoid __cmp__ and cmp().
llvm-svn: 187859
2013-08-07 03:22:02 +00:00
Daniel Dunbar
fc509b862e [lit] Avoid use of iterator .next() method.
llvm-svn: 187858
2013-08-07 03:20:54 +00:00
Daniel Dunbar
7564b3cf78 [lit] Use .write() methods instead of print statement.
llvm-svn: 187857
2013-08-07 03:19:45 +00:00
Daniel Dunbar
37517bad59 [lit] Use dual-compatible print() syntax where possible.
llvm-svn: 187856
2013-08-07 03:18:36 +00:00
Daniel Dunbar
80d4f31c0c [lit] Remove use of deprecated parameter tuple unpacking.
llvm-svn: 187855
2013-08-07 03:17:27 +00:00
Daniel Dunbar
34f64801d5 [lit] Remove uses of deprecated except syntax.
- Since we only have a few of these, use the cumbersome method of getting the
   exception object from 'sys' to retain the current pre-2.6 compatibility.

llvm-svn: 187854
2013-08-07 03:16:19 +00:00
Daniel Dunbar
44d0ad7767 [lit] Use more modern syntax for constructing exceptions.
llvm-svn: 187853
2013-08-07 03:15:10 +00:00
Daniel Dunbar
156c1522d4 [lit] Drop --no-execute, which isn't generally useful.
llvm-svn: 187852
2013-08-07 03:14:00 +00:00
Daniel Dunbar
203a7afc3e [lit] tests: Change discovery test to use --show-tests.
llvm-svn: 187851
2013-08-07 03:12:51 +00:00
Daniel Dunbar
25a6834c07 [lit] Add a --show-tests option.
llvm-svn: 187850
2013-08-07 03:11:42 +00:00
Daniel Dunbar
72b3c08693 [lit] Remove dead ignoreStdError argument.
llvm-svn: 187849
2013-08-07 03:08:46 +00:00
Rafael Espindola
7aa572b49e Move the default back to pipefail. I accidentally reverted it before.
llvm-svn: 187271
2013-07-26 23:22:43 +00:00
Rafael Espindola
095401ba0b Propagate pipefail when cloning.
llvm-svn: 187268
2013-07-26 23:17:38 +00:00
Rafael Espindola
2cf6d36f16 Use pipefail when available.
This change makes test with RUN lines like
RUN: opt ... | FileCheck

fail if opt fails, even if it prints what FileCheck wants. Enabling this
found some interesting cases of broken tests that were not being noticed
because opt (or some other tool) was crashing late.

Pipefail is used when the shell supports it or when using the internal
python based tester.

llvm-svn: 187261
2013-07-26 22:32:58 +00:00
Nico Rieck
62c285b6e1 lit: Support cancellation on Windows
The current machinery using KeyboardInterrupt for canceling doesn't work
with multiple threads on Windows as it just cancels the currently run tests
but the runners continue.

We install a handler for Ctrl-C which stops the provider from providing any
more tests to the runners. Together with aborting all currently running
tests, this brings lit to a halt.

llvm-svn: 186695
2013-07-19 17:08:08 +00:00
Galina Kistanova
1769d5a71b Fixed bug when tests in executable partially used absolute paths.
llvm-svn: 182910
2013-05-30 04:56:28 +00:00
Alexey Samsonov
bf54199f68 Revert r182715 and r182758
llvm-svn: 182761
2013-05-28 10:08:08 +00:00
Alexey Samsonov
6dea9bd10d Fixup for r182715: provide correct arg to --gtest-filter
llvm-svn: 182758
2013-05-28 09:40:42 +00:00
Galina Kistanova
ff1dc4afcc Fixed bug when tests in executable partially used absolute paths.
llvm-svn: 182715
2013-05-26 03:58:41 +00:00
Daniel Dunbar
992a59103b lit: Fix infinite recursion when an out-of-tree test root is located inside the source test root.
llvm-svn: 179402
2013-04-12 19:09:09 +00:00
Daniel Dunbar
ebb57e0ea4 lit: Add a test for discovery w/ test_exec_root (out-of-tree test root).
llvm-svn: 179401
2013-04-12 19:08:57 +00:00
Daniel Dunbar
2b76085497 lit: Don't descend into .git directories during test discovery.
llvm-svn: 179249
2013-04-11 00:31:35 +00:00
Daniel Dunbar
aeb45789dd lit: Shorten a metavar to make --help look nicer.
llvm-svn: 179248
2013-04-11 00:31:27 +00:00
Daniel Dunbar
35c0a36655 lit: Add a test for discovery when exact test names are given.
llvm-svn: 179247
2013-04-11 00:31:22 +00:00
Daniel Dunbar
0415c80e33 lit: Add a trivial test of the basic progress bar.
llvm-svn: 179243
2013-04-11 00:05:37 +00:00
Reid Kleckner
804b51ca54 [lit] Avoid CRLFs in bash scripts on Windows
Native Windows Python will do line ending translation by default, which
we don't want in bash scripts.  If we're not native Windows Python, then
'b' is ignored.

llvm-svn: 177602
2013-03-20 23:32:14 +00:00
NAKAMURA Takumi
7822c4abc1 lit.TestFormats.GoogleTest: Honor LitConfig.noExecute, or --no-execute were ignored.
llvm-svn: 176930
2013-03-13 06:16:33 +00:00
Daniel Dunbar
87a628ad87 [lit] Add a display function for lit.Test.TestResult.
llvm-svn: 174667
2013-02-07 21:34:34 +00:00
Daniel Dunbar
c1a371e4ba [lit] Add a test for internal shell execution behaviors.
llvm-svn: 174102
2013-01-31 22:15:20 +00:00
Daniel Dunbar
bc2e9247e5 [lit] Change to raise InternalShellError for all command execution issues.
llvm-svn: 174101
2013-01-31 22:15:15 +00:00
Daniel Dunbar
f0b8d0bee5 [lit] Fix bug where InternalShellError messages were discarded.
- Also, change the exit code to match 'sh'.

llvm-svn: 174089
2013-01-31 20:58:16 +00:00
Daniel Dunbar
9974bc4dd7 [lit] Fix a shell parsing bug with ';' not separated by whitespace.
- Testing finds bugs, who knew.

llvm-svn: 174087
2013-01-31 20:51:17 +00:00
Daniel Dunbar
b1cf0346bf [lit] Add a test for the various ShTest format features.
llvm-svn: 174072
2013-01-31 18:05:01 +00:00
Daniel Dunbar
6da49ae5e5 [lit] TestRunner: Eliminate failDueToStderr argument, which is now unused.
llvm-svn: 174071
2013-01-31 18:04:45 +00:00
Daniel Dunbar
68b35e0a6d [lit] Delete the now-unused SyntaxCheckTest format.
- Also, kill the pointless LitFormats module.

llvm-svn: 174070
2013-01-31 18:04:38 +00:00
Daniel Dunbar
6acef346f3 [lit] Move unittest adaptor code into discovery module.
- Also, add a test for it.

llvm-svn: 174019
2013-01-31 01:23:39 +00:00
Daniel Dunbar
29c19beaa9 [lit] Run the ShUtil tests as part of the test suite.
llvm-svn: 174018
2013-01-31 01:23:26 +00:00
Daniel Dunbar
78d1ba3a49 [lit] Set parallel mode for coverage tests.
llvm-svn: 174017
2013-01-31 01:23:18 +00:00
Daniel Dunbar
5bab9b90e8 [lit] Move discovery code into its own module.
llvm-svn: 174014
2013-01-31 01:14:01 +00:00
Daniel Dunbar
40874f9354 [lit] Add a MANIFEST file and a script for sanity checking the source dist.
llvm-svn: 174002
2013-01-31 00:21:59 +00:00
Daniel Dunbar
e013a12e40 [lit] Add a basic discovery test.
llvm-svn: 174001
2013-01-31 00:21:51 +00:00
Daniel Dunbar
dc2f271868 [lit] Add a script for checking test coverage.
llvm-svn: 174000
2013-01-31 00:21:44 +00:00
Daniel Dunbar
28d80bd222 [lit] Add a test suite for lit itself.
llvm-svn: 173999
2013-01-31 00:21:39 +00:00
Alexey Samsonov
981596c6d0 [lit] Make GoogleTest test runner correctly discover tests in the source root
llvm-svn: 173907
2013-01-30 07:27:45 +00:00
Daniel Dunbar
98b98e8186 [lit] Add some TODO notes to myself.
llvm-svn: 173857
2013-01-30 00:12:24 +00:00
NAKAMURA Takumi
c305122653 lit/ShUtil.py: Deprecate '!' in shell expression. It is not sh-compatible.
llvm-svn: 173421
2013-01-25 06:30:36 +00:00
Dmitri Gribenko
847200db76 Remove support for Tcl test format since nobody uses it
llvm-svn: 172794
2013-01-18 06:57:01 +00:00
Eli Bendersky
38abc56548 Fix comment typo
llvm-svn: 171113
2012-12-26 18:15:42 +00:00
Richard Smith
f3e386b4af PR10867: Analogue of r169441 for when using external 'sh'. And actually run the test!
llvm-svn: 169446
2012-12-05 23:15:33 +00:00
Richard Smith
27aef165bb PR10867. lit would interpret
RUN: a
  RUN: b || true

as "a && (b || true)" in Tcl mode, and as "(a && b) || true" in sh mode.
Everyone seems to (quite reasonably) write tests assuming the Tcl behavior,
so use that in sh mode too.

llvm-svn: 169441
2012-12-05 22:54:26 +00:00
Daniel Dunbar
4ca39306cc lit: Add a simple test suite for checking test runner parallelism.
llvm-svn: 169038
2012-11-30 21:34:04 +00:00
Daniel Dunbar
86d6f27a6f lit: Bump the version to .3.
llvm-svn: 168750
2012-11-28 00:06:11 +00:00
Eric Christopher
caf5a23d81 Remove the CellSPU port.
Approved by Chris Lattner.

llvm-svn: 167984
2012-11-14 22:09:20 +00:00
Alexander Kornienko
61396a2725 Added %(line), %(line+<number>), %(line-<number>) substitutions to lit
llvm-svn: 167971
2012-11-14 20:26:19 +00:00
Daniel Dunbar
7abcd13b24 lit: Rename the valgrind leaks feature to match what is currently used
(vg_leak).

llvm-svn: 166306
2012-10-19 20:29:30 +00:00