1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

326 Commits

Author SHA1 Message Date
Sylvestre Ledru
21e7f50a74 Fix some bashims. More information on https://wiki.ubuntu.com/DashAsBinSh. Reported initially on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772302 & https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772301
llvm-svn: 227744
2015-02-01 14:55:43 +00:00
Eric Fiselier
b07310b743 [lit] Format JSONMetricValue strings better.
llvm-svn: 226672
2015-01-21 16:38:31 +00:00
Rafael Espindola
0241b53c72 Don't set LD_PRELOAD to ''. It doesn't work on OpenBSD.
Patch by Brad Smith.

llvm-svn: 225890
2015-01-14 00:39:56 +00:00
Eric Fiselier
609a90af6c [LIT] Remove string decoding in gtest discovery code. lit.util.capture now does decoding.
llvm-svn: 225693
2015-01-12 20:43:34 +00:00
Eric Fiselier
f8b56c6dac [LIT] Decode string result in lit.util.capture
Summary: I think this is probably a bug, but I'm putting this up for review just to be sure. I think that `lit.util.capture` should decode the resulting string in the same way `lit.util.executeCommand` does.

Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6769

llvm-svn: 225681
2015-01-12 20:09:34 +00:00
Rafael Espindola
b47e702061 Pass LSAN_OPTIONS down so that it is possible to add suppressions.
llvm-svn: 224777
2014-12-23 18:39:02 +00:00
Eric Fiselier
91f01064d8 Split executeShTest into two parts so that it can be better leveraged by libc++
llvm-svn: 224672
2014-12-20 03:23:53 +00:00
Eric Fiselier
6dd39e2bd7 [LIT] Add JSONMetricValue type to wrap types supported by the json encoder.
Summary:
The following types can be encoded and decoded by the json library:
`dict`, `list`, `tuple`, `str`, `unicode`, `int`, `long`, `float`, `bool`, `NoneType`. 

`JSONMetricValue` can be constructed with any of these types, and used as part of Test.Result.
This patch also adds a toMetricValue function that converts a value into a MetricValue.




Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, llvm-commits

Differential Revision: http://reviews.llvm.org/D6576

llvm-svn: 224628
2014-12-19 22:29:12 +00:00
Rafael Espindola
7f81bff1d5 Now that we require a newer python, use the new exception syntax.
llvm-svn: 224130
2014-12-12 15:32:23 +00:00
Rafael Espindola
ee596e4631 Require python 2.7.
We were already requiring 2.5, which meant that people on old linux distros
had to upgrade anyway.

Requiring python 2.6 will make supporting 3.X easier as we can use the 3.X
exception syntax.

According to the discussion on llvmdev, there is not much value is requiring
just 2.6, we may as well just require 2.7.

llvm-svn: 224129
2014-12-12 15:29:31 +00:00
Eric Fiselier
0a9aaf40ed [LIT] Add support for UNSUPPORTED tag to TestRunner.parseIntegratedTestScript
Summary:
This patch gives me just enough to leverage the existing functionality in `TestRunner` for use in `libc++` and `libc++abi` .

It does the following:
* Adds the `UNSUPPORTED` tag to `TestRunner.parseIntegratedTestScript`.
* Allows `parseIntegratedTestScript` to return an empty script if a script is not required by the caller.



Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, llvm-commits

Differential Revision: http://reviews.llvm.org/D6589

llvm-svn: 223915
2014-12-10 03:42:09 +00:00
David Majnemer
97d6a1e3a0 lit: Don't use python 2.6 features
LLVM supports python 2.5, this fixes a (somewhat) recent regression.

llvm-svn: 223626
2014-12-08 08:33:30 +00:00
Chris Matthews
f31f782923 Fix for xunit output to work around issue in Jenkins when tests are at the root level
llvm-svn: 223562
2014-12-06 01:13:49 +00:00
Chris Matthews
c31e772612 Fix corner cases in lit xunit for paths with dots
llvm-svn: 223549
2014-12-06 00:21:08 +00:00
Chris Matthews
d632e02f75 Add a test-case for lit xunit output
llvm-svn: 223307
2014-12-03 23:01:35 +00:00
Chris Matthews
a69dea97e6 Don't allow test-suite names with . in them in xml output
llvm-svn: 223305
2014-12-03 22:59:15 +00:00
Chris Matthews
e15245ded8 Give lit a --xunit-xml-output option for saving results in xunit format
--xunit-xml-output saves test results to disk in JUnit's xml format. This will allow Jenkins to report the details of a lit run.
  
  Based on a patch by David Chisnall.

llvm-svn: 223163
2014-12-02 22:19:21 +00:00
Rafael Espindola
00a6342814 Handle ASAN_OPTIONS and UBSAN_OPTIONS in TestingConfig.py
Currently they are passed to tests of llvm itself, but not, for example, lld.

With this patch the options are visible in every test.

llvm-svn: 221198
2014-11-03 23:04:56 +00:00
Rafael Espindola
6214a8c737 refactor duplicated code. NFC.
llvm-svn: 221191
2014-11-03 22:17:49 +00:00
Rafael Espindola
48899041bd [lit] Forward LD_PRELOAD to tests.
With this patch I can use asan to test the gold plugin without having
to build gold itself with asan.

llvm-svn: 221183
2014-11-03 21:24:43 +00:00
Daniel Dunbar
0e45326cc9 [lit] Fix Python-3 compatibility, patch by Dan Liew.
llvm-svn: 220357
2014-10-22 01:26:06 +00:00
Daniel Dunbar
ab9d73a70e [lit] Bump version number.
llvm-svn: 220355
2014-10-22 00:48:23 +00:00
Daniel Dunbar
685b3765e0 Fix ShTest parsing error when a keyword line doesn't end with a newline.
llvm-svn: 220354
2014-10-22 00:34:31 +00:00
Dan Liew
802c28f78d Teach Lit to catch OSError exceptions when creating a process during the
execution of a shell command. This can happen for example if the
``RUN:`` line calls a python script which can work correctly under
Linux/OSX but will not work under Windows. A more useful error message
is now shown rather than an unhelpful backtrace.

llvm-svn: 220227
2014-10-20 20:14:28 +00:00
Peter Collingbourne
22590da2c9 Initial version of Go bindings.
This code is based on the existing LLVM Go bindings project hosted at:
https://github.com/go-llvm/llvm

Note that all contributors to the gollvm project have agreed to relicense
their changes under the LLVM license and submit them to the LLVM project.

Differential Revision: http://reviews.llvm.org/D5684

llvm-svn: 219976
2014-10-16 22:48:02 +00:00
Jordan Rose
6655e823e0 [lit] Parse all strings as UTF-8 rather than ASCII.
As far as I can tell UTF-8 has been supported since the beginning of Python's
codec support, and it's the de facto standard for text these days, at least
for primarily-English text. This allows us to put Unicode into lit RUN lines.

rdar://problem/18311663

llvm-svn: 217688
2014-09-12 16:46:05 +00:00
Eric Fiselier
d12eebd3f8 [LIT] Move display of unsupported and xfail tests to summary.
Summary:
This patch changes the way xfail and unsupported tests are displayed. 
This output is only displayed when the --show-unsupported/--show-xfail flags are passed to lit.

Currently xfail/unsupported tests are printed during the run of the test-suite. I think its better to display this information during the summary instead.
This patch removes the printing of these tests from when they are run to the summary.


Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D4842

llvm-svn: 215809
2014-08-16 02:16:25 +00:00
Eric Fiselier
644e75522f [lit] Add --show-xfail flag to LIT.
Summary:
This patch add a --show-xfail flag. If this flag is specified then each xfail test will be printed to output.
When it is not given xfail tests are ignored. Ignoring xfail tests is the current behavior.

This flag is meant to mirror the --show-unsupported flag that was recently added.

Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D4750

llvm-svn: 214609
2014-08-02 01:29:52 +00:00
Eric Fiselier
95d51f6cee [lit] Add --show-unsupported flag to LIT
llvm-svn: 213227
2014-07-17 05:53:00 +00:00
Hans Wennborg
f27451b3a7 lit: simplify population of the actual_inputs array
Add all inputs to the array, except those starting with @, which
are treated as response files and expanded.

llvm-svn: 211119
2014-06-17 18:17:46 +00:00
Hans Wennborg
bde907d28e Revert "lit: warn when passed invalid pathname" (r210597)
It was pointed out that this breaks the "virtual test discovery"
mechanism, which allows for narming tests in the test exec root.

Reverting until I can figure out how to fix this.

llvm-svn: 211048
2014-06-16 20:18:41 +00:00
Hans Wennborg
6393126f22 lit: warn when passed invalid pathname
It would previously say things like

  warning: input 'test/Frontend/foo.c' contained no tests

and have the user pull their hair trying to figure out what's wrong with that
file. This patch changes the message to the much clearer:

  warning: no such file or directory: 'test/Frontend/foo.c'

Differential Revision: http://reviews.llvm.org/D4097

llvm-svn: 210597
2014-06-10 22:51:58 +00:00
Alexander Potapenko
d7c37af8b4 Add detection of OS X relocatable SDK to compiler-rt as a lit.util function
Clang's lit cfg already detects the currently selected SDK via
"xcrun --show-sdk-path". The same thing should be done for compiler-rt tests,
to make them work on recent OS X versions. Instead of duplicating the detection
code, this patch extracts the detection function into a lit.util method.

Patch by Kuba Brecka (kuba.brecka@gmail.com),
reviewed at http://reviews.llvm.org/D4072

llvm-svn: 210534
2014-06-10 14:22:00 +00:00
Joerg Sonnenberger
87dad97b52 Fix test syntax to work with non-bash /bin/sh.
llvm-svn: 206119
2014-04-12 21:13:41 +00:00
Daniel Dunbar
dcb65e4744 [lit] Fix non-function style print statement.
llvm-svn: 203573
2014-03-11 14:05:49 +00:00
Daniel Dunbar
c1356cbd3a [lit] Bump dev version number.
llvm-svn: 203498
2014-03-10 21:58:16 +00:00
Daniel Dunbar
97b49237d9 [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
1a6b374918 [lit] Add --version option.
llvm-svn: 203496
2014-03-10 21:57:48 +00:00
Alp Toker
b9c4c9d6f5 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
a9c0934bea 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
7638179115 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
8f683c6ba3 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
0897b6644d Prospective Python 3 fix for r198150
llvm-svn: 198152
2013-12-29 05:51:07 +00:00
Alp Toker
87af14279d 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
ffce6d533a Tweak lit/TestingConfig.py Py3-compatible. has_key is dead.
llvm-svn: 197462
2013-12-17 04:14:50 +00:00
Alp Toker
7f0b2395d8 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
faa5d33982 Clarify the comment about BSD versions in r193465
llvm-svn: 193508
2013-10-27 20:49:19 +00:00
Joerg Sonnenberger
c928f5557a 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
212cd2ef39 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
ea94466ed9 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