Commit Graph

56 Commits

Author SHA1 Message Date
NAKAMURA Takumi
95643d0832 llvm/test/lit.cfg: Retweak for Win32 to fix testing.
- execute_external should be;
    - Not on Win32.
    - Using bash.
    In reverse, "execute_internal" shoud be (Win32 && !bash).

  - lit.getBashPath() behaves differently before and after tweaking $PATH.

I will add a few explanations there later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159641 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 03:59:34 +00:00
Chandler Carruth
4177e6fff5 Convert all tests using TCL-style quoting to use shell-style quoting.
This was done through the aid of a terrible Perl creation. I will not
paste any of the horrors here. Suffice to say, it require multiple
staged rounds of replacements, state carried between, and a few
nested-construct-parsing hacks that I'm not proud of. It happens, by
luck, to be able to deal with all the TCL-quoting patterns in evidence
in the LLVM test suite.

If anyone is maintaining large out-of-tree test trees, feel free to poke
me and I'll send you the steps I used to convert things, as well as
answer any painful questions etc. IRC works best for this type of thing
I find.

Once converted, switch the LLVM lit config to use ShTests the same as
Clang. In addition to being able to delete large amounts of Python code
from 'lit', this will also simplify the entire test suite and some of
lit's architecture.

Finally, the test suite runs 33% faster on Linux now. ;]
For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159525 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 12:47:22 +00:00
Chandler Carruth
7e621f3242 Switch a bunch of Linker tests from using elaborate echo productions to
just provide and reference separate input files from an Inputs
subdirectory. This pattern works very well in the Clang tree and is
easier to understand in my opinion. It also has fewer limitations and
will remove one particularly annoying use of TCL-style {} quoting from
the testsuite.

Also teach the LLVM lit configuration to avoid recursing into 'Inputs'
subdirectories. This wasn't required for the previous 'Inputs'
subdirectories used due to fortuitous suffix patterns.

This is the first step to completely removing support for TCL-style tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159520 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 10:18:06 +00:00
Chandler Carruth
96f41a1b0f Remove 'site.exp' building from both CMake and configure+make.
This is another vestige of the DejaGNU roots. There were FIXMEs in the
lit setup to add a 'lit.site.cfg', which has been around for quite some
time now, so I've properly switched the handling of the 4 things
actually used in site.exp to go through lit.site.cfg now. No more
parsing of the .exp file, one fewer configure-style generated file,
etc., etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159313 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-28 00:16:51 +00:00
Michael J. Spencer
75338097c7 Remove llvm-ld and llvm-stub (which is only used by llvm-ld).
llvm-ld is no longer useful and causes confusion and so it is being removed.

* Does not work very well on Windows because it must call a gcc like driver to
  assemble and link.
* Has lots of hard coded paths which are wrong on many systems.
* Does not understand most of ld's options.
* Can be partially replaced by llvm-link | opt | {llc | as, llc -filetype=obj} |
  ld, or fully replaced by Clang.

I know of no production use of llvm-ld, and hacking use should be
replaced by Clang's driver.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155147 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 19:27:54 +00:00
Sylvestre Ledru
e92077f11e Catch the Python exception when subprocess.Popen is failing.
For example, if llc cannot be found, the full python stacktrace is displayed
and no interesting information are provided.
+ fail the process when an exception occurs



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154665 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 11:22:18 +00:00
Eli Bendersky
cc85160672 Continue cleanup of LIT, getting rid of the remaining artifacts from dejagnu
* Removed test/lib/llvm.exp - it is no longer needed 
* Deleted the dg.exp reading code from test/lit.cfg. There are no dg.exp files
  left in the test suite so this code is no longer required. test/lit.cfg is
  now much shorter and clearer 
* Removed a lot of duplicate code in lit.local.cfg files that need access to
  the root configuration, by adding a "root" attribute to the TestingConfig
  object. This attribute is dynamically computed to provide the same
  information as was previously provided by the custom getRoot functions. 
* Documented the config.root attribute in docs/CommandGuide/lit.pod





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153408 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-25 09:02:19 +00:00
Eli Bendersky
0f0c411079 Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed.
Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150664 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 06:28:33 +00:00
Eli Bendersky
a66a18505e Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches.
Patch developed by Andy Kaylor and Daniel Malea. Reviewed on llvm-commits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148231 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-16 08:56:09 +00:00
NAKAMURA Takumi
f86186ee24 test/lit.cfg: Enable the feature 'asserts' to check output of llc -version.
llc knows whether he is compiled with -DNDEBUG.
|  Optimized build with assertions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145230 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-28 05:09:15 +00:00
Benjamin Kramer
7494a12a65 Update lit's list of tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 16:20:52 +00:00
Daniel Dunbar
dd4667f909 tests: Rip out a bunch of now unused test code relating to use of llvm-gcc in LLVM tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143143 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27 20:59:26 +00:00
Peter Collingbourne
5d5c0624d0 s/tblgen/llvm-tblgen/g in a few missed places, including the tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141294 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-06 13:39:59 +00:00
David Dean
8a567f1fb9 Fix PR9833/PR11054 (patch provided by Patrik Hägglund)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141092 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04 16:26:41 +00:00
Eric Christopher
eeef9e8180 Remove llvm-gcc and various compiler handling from llvm. It's not needed
here anymore and has been migrated to the test-suite project.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140216 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 23:58:15 +00:00
Andrew Trick
7c12837916 Lit option for ignoring stderr output.
This is useful for testing a build a temporarily hand instrumented
build.
Patch by arrowdodger!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138804 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-30 17:42:33 +00:00
Andrew Trick
f2a58425cd lit support for REQUIRES: asserts.
Take #2. Don't piggyback on the existing config.build_mode. Instead,
define a new lit feature for each build feature we need (currently
just "asserts"). Teach both autoconf'd and cmake'd Makefiles to define
this feature within test/lit.site.cfg. This doesn't require any lit
harness changes and should be more robust across build systems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133664 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 23:23:19 +00:00
NAKAMURA Takumi
027f98cd3b test/lit.cfg: Add PATHEXT to 'substitution', to recognize tools on Windows hosts. Thanks to Danil Malyshev!
Some tests on Windows use the "not" utility and fail with an error "program not executable". The reason for this error is that the name of the executable file sended to the "not" without the extension.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126383 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 12:34:34 +00:00
Sean Callanan
41dfd2b61b Fixed lit.cfg to no longer recognize the old
edis name as needing expansion.  This tool was
been replaced by llvm-mc long ago.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126180 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 02:05:53 +00:00
NAKAMURA Takumi
c37b429484 test/lit.cfg: Seek sane tools(and bash) in directories and set to $PATH.
LitConfig.getBashPath() will not seek in $PATH after LitConfig.getToolsPath() was executed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125176 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:19:21 +00:00
Frits van Bommel
c95ff3c422 Fix lit for people whose LLVM path contains 'opt', which is a common directory name on Unix-like systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122873 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-05 15:10:24 +00:00
Tobias Grosser
ee38f85104 Include llvm-gcc dir before llvm_tools_dir
This ensures that always the recently compiled tools are picked for testing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122810 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-04 16:01:17 +00:00
David Greene
70ecc97550 Don't pattern match "/clang" so we don't mangle directory names. Some
tests use absolute paths to clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122796 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-04 01:05:30 +00:00
David Greene
fd1ed5f4c4 Don't pattern match "clang-" as it may be part of a tool name with a
triple suffix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122779 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 21:55:08 +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
e7331eea2d test: Add the feature 'shell' on LLVM_ON_UNIX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 02:43:51 +00:00
Michael J. Spencer
44d392a6af Test: Fix Support.Path and _all_ of the unittest death tests. GetTempPath defaults to \Windows\.
If I typed anything else it would just decline into cursing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:49 +00:00
NAKAMURA Takumi
38d439fb13 test: Use $SharedLibDir for loadable modules. On Cygming, loadable modules are not in lib/ but bin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120274 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 00:20:21 +00:00
NAKAMURA Takumi
b3ccc12831 test: Add the new feature 'loadable_module'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120273 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 00:20:09 +00:00
Duncan Sands
48f296dada Use LLVMCC_EMITIR_FLAG rather than hard-coding "-emit-llvm".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120156 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-25 21:19:52 +00:00
Duncan Sands
51a645520a Spelling fixes in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 13:32:22 +00:00
Michael J. Spencer
06b7f58522 Test: Fix LLVMC tests on CMake.
The CMake build didn't define TEST_COMPILE_CXX_CMD. The tests assumed gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 14:49:00 +00:00
Bob Wilson
8d854a4f7e The %ocamlopt setting has embedded quotes. Copy the entire value instead
of stopping at the first embedded quote.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 14:19:38 +00:00
Daniel Dunbar
2e5ec111b9 tests: Haste makes waste.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111525 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 16:47:54 +00:00
Daniel Dunbar
62b4d71d7f tests: Ignore whitespace in llvm_supports_binding() and llvm_gcc_supports().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111524 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 16:46:52 +00:00
Daniel Dunbar
1321fec0a6 tests: Don't error out if HOME isn't present in t the environment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110711 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 19:36:25 +00:00
Daniel Dunbar
238e73f901 tests: Tweak lit.cfg to fix breakage with out-of-dir lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-23 18:06:16 +00:00
Daniel Dunbar
9b2cb695b3 tests: Propogate LLVM_SRC_ROOT and PYTHON_EXECUTABLE environment variables to tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105890 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-12 16:21:19 +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
Daniel Dunbar
a56a810be4 tests: Mangle '-vg' onto the end of the triple when running under valgrind, so
we can use the standard XFAIL and XTARGET to conditional tests based on
valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99088 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 21:12:48 +00:00
John McCall
197d009e6b Revert r97726 and r97728 at ddunbar's request; we want to solve this
some other way when it comes to be necessary.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 20:02:05 +00:00
John McCall
7b7b90769a Teach lit to honor conditional directives. The syntax is:
IF(condition(value)):
If the value satisfies the condition, the line is processed by lit;  otherwise
it is skipped.  A test with no unignored directives is resolved as Unsupported.

The test suite is responsible for defining conditions;  conditions are unary
functions over strings.  I've defined two conditions in the LLVM test suite,
TARGET (with values like those in TARGETS_TO_BUILD) and BINDING (with values
like those in llvm_bindings).  So for example you can write:
  IF(BINDING(ocaml)): RUN: %blah %s -o -
and the RUN line will only execute if LLVM was configured with the ocaml
bindings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 09:36:50 +00:00
Daniel Dunbar
55983f1ca5 tests: Propogate the HOME environment variable through to tests. I'm ambivalent
about this, but it can be useful for users who use ccache, since the LLVMC tests
are fond of calling gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 22:09:09 +00:00
Daniel Dunbar
3d4cea31d5 tests: Don't make a missing llvm-gcc dir a fatal error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 11:34:12 +00:00
Daniel Dunbar
a04942b196 Fix a thinko in the lit.cfg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96931 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 09:28:48 +00:00
Benjamin Kramer
66c439af28 Get the LLVMC tests working with clang++ by removing the problematic CXXFLAG in lit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95318 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 18:40:11 +00:00
Daniel Dunbar
197f1f0246 MCAssembler/Darwin: Add a test (on Darwin) that we assemble a bunch of
instructions exactly like 'as', and produce equivalent .o files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 22:00:15 +00:00
Daniel Dunbar
89a9c91247 Fix llvm_supports_binding for lit, problem noticed by Bob!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93591 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 00:00:20 +00:00