Commit Graph

102 Commits

Author SHA1 Message Date
NAKAMURA Takumi
214c920818 lit/TestingConfig.py: Add the environment variable PRINTF_EXPONENT_DIGITS as workaround [PR6745] for mingw's tests. Danil Malyshev suggested this.
FIXME: It does not improve MSVC's issue.

[Danil Malyshev] Defining PRINTF_EXPONENT_DIGITS env is the suggested way to make MinGW ANSI/POSIX compatible. This is not only about the case we are discussing, but in general, I'd like to have explicitly defined compatibility mode for all the tests running on MinGW.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125725 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 05:56:41 +00:00
NAKAMURA Takumi
7805cdcab5 lit/TestFormats.py: Unittests may be found with suffix .exe also on Cygwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125273 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 09:11:57 +00:00
NAKAMURA Takumi
f5201bcd3b lit/Util.py: On Cygwin, 'PATHEXT' may exist but it should not be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 09:11:48 +00:00
NAKAMURA Takumi
302b169323 lit/LitConfig.py: Add the new method getToolsPath(dir,paths,tools).
It seeks tools(eg. [cmp, grep, sed]) in same directory, to be sane.

It seeks "bash" only in the directory found at last time. Or bash would be insane (against other tools).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125175 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:19:15 +00:00
NAKAMURA Takumi
df944f1f83 lit/Util.py: Add two functions, checkToolsPath(dir,tools) and whichTools(tools,paths).
checkToolsPath(dir,tools):
return True if "dir" contains all "tools".

whichTools(tools,paths):
return a directory that contains all "tools" in "paths".
Or return None when all "tools" were not met.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125174 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:19:06 +00:00
Francois Pichet
7a0be17c08 On Windows, replace each occurrence of '\' by '\\' on the replacement string. This is necessary to prevent re.sub from replacing escape sequences occurring in path.
For example:

llvm\tools\clang\test
was replaced by
llvm <tab> ools\clang <tab> est


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123070 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 18:09:48 +00:00
Francois Pichet
ba69d3f6d4 Disable r122754 on Windows: was causing all lit tests to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122808 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-04 10:23:42 +00:00
David Greene
18d4987753 Reapply 122341 to fix PR8199 now that clang changes are in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122754 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 17:30:25 +00:00
David Greene
234da6832f Revert 122341. It breaks some darwin tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122346 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 17:25:43 +00:00
David Greene
4d75d80d62 Fix PR 8199. This patch prepends the build tool dir to LLVM programs
being tested.  This ensures that we test the tools just built and not
some random tools that might happen to be in the user's PATH.  This
makes LLVM testing much more stable and predictable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 16:55:53 +00:00
NAKAMURA Takumi
280423558d utils/lit/lit/TestFormats.py: [PR8438] unittests: Seek *Tests (not BUILD_MODE/*Tests) under whole unittests/ if BUILD_MODE == '.'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 07:41:32 +00:00
NAKAMURA Takumi
fb4d9816e7 lit.GoogleTest: On case-insensitive filesystem, matching should be case-insensitive when directory name is checked with test_sub_dir.
On MSVS8, ${CMAKE_CFG_INTDIR}, aka $(OutDir), has capitalized name(eg. Debug), although $(OutDir) is made with lower case(eg. debug).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 03:19:26 +00:00
Daniel Dunbar
69c4cbe9e8 lit: Fix a subtle resource usage bug when executing tests using the internal
shell runner.

We would inadvertently end up holding on to handles to the temporary files
longer than we should have been. On Win32, where open handles lock some file
operations, this caused problems in tests which would try to move temporary
files around (as Clang does by default now).

Many thanks to Francois Pichet for the excellent detective work on this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 15:59:37 +00:00
Michael J. Spencer
18fac3c0d2 Test unittests built with CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 09:01:22 +00:00
Michael J. Spencer
c8417d7165 Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 09:00:56 +00:00
Daniel Dunbar
3f42dba88f lit: Bump version to 0.2.0dev, for no apparent reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 02:28:15 +00:00
Daniel Dunbar
bd26ba0b53 lit: Tweak setup.py.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114261 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 02:28:12 +00:00
Daniel Dunbar
3f32b444ed lit: These TODOs are done(ish).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114260 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 02:28:09 +00:00
Duncan Sands
7201c9f1f1 Some of the tests build an executable with llvm-gcc. For this to work, llvm-gcc
needs to find some libraries, which may require searching the directories given
by LIBRARY_PATH on curiously configured systems.  So pass on LIBRARY_PATH.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 17:05:27 +00:00
Daniel Dunbar
c2be84fd49 lit: Expose FileBasedTest object and Test module via 'lit' object that gets
exposed to config files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113923 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 03:52:38 +00:00
Daniel Dunbar
ff2dcd3ce9 lit: Rename main lit module to main.py, lit/lit/lit.py was a bit too, err,
alliterate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113922 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 03:52:31 +00:00
Daniel Dunbar
1ca8559de5 lit/GoogleTest: Add .exe to the suffix when looking for tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111487 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 00:22:45 +00:00
Dan Gohman
bd2499a0b1 Expand uses of python 2.6's "A if B else C" syntax into regular
if-else statements, to hopefully support older pythons (PR7850).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 01:03:34 +00:00
Dan Gohman
34f68fc040 Print a message when a test failure is due to stderr output
alone, rather than just an exit code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110208 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 16:42:38 +00:00
Dan Gohman
e1e5746476 Change the logic which interprets output on stderr as an error so that
it doesn't modify the exit code or the stdout contents, and so that it
doesn't clutter the output with "Command has output on stderr!".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 00:12:31 +00:00
Dan Gohman
8a7ffe651f Don't print "Command output (stdout):" when the command has no output,
and same for stderr, to avoid clutter in the output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110169 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 00:05:16 +00:00
Dan Gohman
e1390c40a6 Use the regular conditional operator syntax instead of a clever hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110168 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 00:00:13 +00:00
Daniel Dunbar
6647033565 lit: Allow clients to define predefined parameters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 00:39:38 +00:00
Daniel Dunbar
2d4590d6fb lit: Add some example tests for previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109071 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 00:40:19 +00:00
Daniel Dunbar
b937549e51 lit: Add support for 'REQUIRES: feature-one, feature-two, ...' in the
integrated-test formats (sh and tcl style). The particular features which get
recognized are up to the test suite itself to define.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 23:39:57 +00:00
Daniel Dunbar
1befb9b2df lit: Replace /dev/null in scripts with temporary files on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-12 16:00:10 +00:00
Daniel Dunbar
771d90ff43 lit: Add a forgotten default argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 23:47:36 +00:00
Daniel Dunbar
f32a41a7e6 lit: When running Tcl style tests on Windows, substitute slashes to avoid Tcl
quoting problems. Not particularly ideal, but should work ok. Based on a patch by
Michael Spencer!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105855 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 23:27:45 +00:00
Daniel Dunbar
b0ac8677fd lit: Add another place to look for bash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-19 23:56:09 +00:00
Daniel Dunbar
bd4fa2efd3 lit: Fix a sh lexing bug which caused annotate-token.m to fail when run with the
internal shell parser; we weren't lexing the quotes in a command like::

  clang -DFOO='hello'

correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103652 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-12 21:47:58 +00:00
Daniel Dunbar
473a09d80a lit: Fix OneCommandPerFileTest format when tests are specified directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103626 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-12 17:56:44 +00:00
Daniel Dunbar
b14c699fe0 lit: Add support for 'lit ... @foo', which reads a list of tests to run from
foo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103625 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-12 17:56:42 +00:00
Daniel Dunbar
e4eae84f76 lit: Allow test_format to be None.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 17:22:35 +00:00
Daniel Dunbar
2381379d1d lit: Add support to OneCommandPerFileTest format to take input directory from input path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 02:15:10 +00:00
Chris Lattner
e3a601b648 add newlines at end of files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100706 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 22:54:55 +00:00
Daniel Dunbar
e09ccab0ce Add a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 19:14:05 +00:00
Daniel Dunbar
c3681d334a lit: Make sure to close any files we open as part of redirection.
PR6753.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 18:48:43 +00:00
Daniel Dunbar
f104f5b17a lit: Add LitTestCase and lit.load_test_suite, for adapting lit based suites for
use with Python's unittest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 07:10:01 +00:00
Jeffrey Yasskin
982873cdfb When we don't pass --vg-leak to lit, pass --leak-check=no to valgrind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99112 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-21 01:47:33 +00:00
Jeffrey Yasskin
32989deb96 Add support for XFAILing valgrind runs with memory leak checking independently
of runs without leak checking.  We add -vg to the triple for non-checked runs,
or -vg_leak for checked runs.  Also use this to XFAIL the TableGen tests, since
tablegen leaks like a sieve.  This includes some valgrindArgs refactoring.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 23:08:45 +00:00
Ben Holt
bcb4d81755 Test commit (removed extra blank line)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 21:12:29 +00:00
Torok Edwin
2f36fe4380 Set numThreads to 1 by default when Python is older than 2.5.2.
Python 2.4 always hits this bug: http://bugs.python.org/issue1731717
when running check-lit on multi-core systems.
Setting numThreads to 1 makes it slower, but at least the results reported are
correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 17:54:21 +00:00
Daniel Dunbar
1814cf0f10 lit: Tweak example tests config.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98859 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 20:06:05 +00:00
Jeffrey Yasskin
fd4943087e Avoid a problem in libc_freeres() seen on a linux-i686 buildbot when running
under valgrind:

==19577== Invalid free() / delete / delete[]
==19577==    at 0x4C9C866: free (vg_replace_malloc.c:325)
==19577==    by 0x5121104: ??? (in /lib/libc-2.10.2.so)
==19577==    by 0x4C97412: _vgnU_freeres (vg_preloaded.c:62)
==19577==    by 0x5041486: __run_exit_handlers (exit.c:93)
==19577==    by 0x50414FE: exit (exit.c:100)
==19577==    by 0x5028B5C: (below main) (libc-start.c:254)
==19577==  Address 0xffffffff is not stack'd, malloc'd or (recently) free'd
==19577== 

Apparently this happens under certain versions of glibc, so valgrind provides
the --run-libc-freeres=no option to avoid calling freeres().  This may increase
the number of "still reachable" blocks valgrind reports, but we don't care
about those, while this error breaks the buildbots.

There are upstream bugs about this at
http://sourceware.org/bugzilla/show_bug.cgi?id=10610 and
http://bugs.kde.org/show_bug.cgi?id=167483, but they don't look likely to be
fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98813 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 07:00:12 +00:00
Jeffrey Yasskin
b5e9770aef Make lit pay attention to --vg for tcl tests too, which makes it work on LLVM's
non-unit tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 17:04:56 +00:00