summaryrefslogtreecommitdiff
path: root/test/Unit
AgeCommit message (Collapse)Author
2017-09-21[lit] Make lit support config files with .py extension.Zachary Turner
Many editors and Python-related diagnostics tools such as debuggers break or fail in mysterious ways when python files don't end in .py. This is especially true on Windows, but still exists on other platforms. I don't want to be too heavy handed in changing everything across the board, but I do want to at least *allow* lit configs to have .py extensions. This patch makes the discovery process first look for a config file with a .py extension, and if one is not found, then looks for a config file using the old method. So for existing users, there should be no functional change. Differential Revision: https://reviews.llvm.org/D37838 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15Resubmit "[lit] Force site configs to run before source-tree configs"Zachary Turner
This is a resubmission of r313270. It broke standalone builds of compiler-rt because we were not correctly generating the llvm-lit script in the standalone build directory. The fixes incorporated here attempt to find llvm/utils/llvm-lit from the source tree returned by llvm-config. If present, it will generate llvm-lit into the output directory. Regardless, the user can specify -DLLVM_EXTERNAL_LIT to point to a specific lit.py on their file system. This supports the use case of someone installing lit via a package manager. If it cannot find a source tree, and -DLLVM_EXTERNAL_LIT is either unspecified or invalid, then we print a warning that tests will not be able to run. Differential Revision: https://reviews.llvm.org/D37756 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15Revert "[lit] Force site configs to run before source-tree configs"Zachary Turner
This patch is still breaking several multi-stage compiler-rt bots. I already know what the fix is, but I want to get the bots green for now and then try re-applying in the morning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313335 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[lit] Force site configs to be run before source-tree configsZachary Turner
This patch simplifies LLVM's lit infrastructure by enforcing an ordering that a site config is always run before a source-tree config. A significant amount of the complexity from lit config files arises from the fact that inside of a source-tree config file, we don't yet know if the site config has been run. However it is *always* required to run a site config first, because it passes various variables down through CMake that the main config depends on. As a result, every config file has to do a bunch of magic to try to reverse-engineer the location of the site config file if they detect (heuristically) that the site config file has not yet been run. This patch solves the problem by emitting a mapping from source tree config file to binary tree site config file in llvm-lit.py. Then, during discovery when we find a config file, we check to see if we have a target mapping for it, and if so we use that instead. This mechanism is generic enough that it does not affect external users of lit. They will just not have a config mapping defined, and everything will work as normal. On the other hand, for us it allows us to make many simplifications: * We are guaranteed that a site config will be executed first * Inside of a main config, we no longer have to assume that attributes might not be present and use getattr everywhere. * We no longer have to pass parameters such as --param llvm_site_config=<path> on the command line. * It is future-proof, meaning you don't have to edit llvm-lit.in to add support for new projects. * All of the duplicated logic of trying various fallback mechanisms of finding a site config from the main config are now gone. One potentially noteworthy thing that was required to implement this change is that whereas the ninja check targets previously used the first method to spawn lit, they now use the second. In particular, you can no longer run lit.py against the source tree while specifying the various `foo_site_config=<path>` parameters. Instead, you need to run llvm-lit.py. Differential Revision: https://reviews.llvm.org/D37756 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313270 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06Change remaining references to lit.util.capture to use subprocess.check_output.David L. Jones
Summary: The capture() function was removed in r306625. This should fix PGO breakages reported by Michael Zolotukhin. Reviewers: mzolotukhin Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D35088 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307320 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30Revert "[lit] Clean output directories before running tests."Zachary Turner
This reverts commit da6318a92fba793e4f2447ec478b001392d57d43. This is causing failures on some build bots due to what appears to be some kind of lit ordering dependency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30[lit] Clean output directories before running tests.Zachary Turner
Presently lit leaks files in the tests' output directories. Specifically, if a test creates output files, lit makes no effort to remove them prior to the next test run. This is problematic because it leads to false positives whenever a test passes because stale files were present. In general it is a source of flakiness that should be removed. This patch addresses this by building the list of all test directories that are part of the current run set, and then deleting those directories and recreating them anew. This gives each test a clean baseline to start from. Differential Revision: https://reviews.llvm.org/D34732 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306832 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08[Lit] Fix to prevent creation of "%SystemDrive%" directory on Windows.Andrew Ng
This patch propogates the environment variable SYSTEMDRIVE on Windows when running the unit tests. This prevents the creation of a directory named "%SystemDrive%" when running the unit tests from FileSystemTest that use the function llvm::sys::fs::remove_directories which in turn uses SHFileOperationW. It is within SHFileOperationW that this environment variable may be used and if undefined causes the creation of a "%SystemDrive%" directory in the current directory. Differential Revision: https://reviews.llvm.org/D32910 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-16Replace hardcoded comment at 'lit.site.cfg.in'Alex Denisov
At the moment almost every lit.site.cfg.in contains two lines comment: ## Autogenerated by LLVM/Clang configuration. # Do not edit! The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from configure_lit_site_cfg with the note and some useful information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266515 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12[lit] Hack lit to allow a test suite to request that it is run "early".Chandler Carruth
This lets us for example start running the unit test suite early. For 'check-llvm' on my machine, this drops the tim e from 44s to 32s!!!!! It's pretty ugly. I barely know how to write Python, so feel free to just tell me how I should write it instead. =D Thanks to Filipe and others for help. Differential Revision: http://reviews.llvm.org/D18089 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263329 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-04Let test/Unit/lit.cfg add config.shlibdir to $PATH on DLL platforms like ↵NAKAMURA Takumi
cygming. This makes unittests run with BUILD_SHARED_LIBS on DLL platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212316 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-28With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202510 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09[tests] Update to use lit_config and lit package, as appropriate.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188076 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07[tests] Avoid deprecated except syntax.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187928 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04Propagate path to ASan/MSan symbolizer into test environment to produce ↵Alexey Samsonov
useful reports on errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178749 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27Disable ASan/MSan symbolization of reports in tests.Evgeniy Stepanov
It was using an instrumented symbolizer binary, which is a potential fork bomb. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178139 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15Fixup for r176933: more careful setup of path to llvm-symbolizerAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177144 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13Set symbolizer path in the test environment.Evgeniy Stepanov
This is needed to get symbolized stack traces when running LLVM tests under (A|M)San. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176933 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27tests: Rip out a bunch of now unused test code relating to use of llvm-gcc ↵Daniel Dunbar
in LLVM tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143143 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22test/Unit: Fix enable shared test to follow check that we have actually loadedDaniel Dunbar
the site config. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133641 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07Test: Fix Support.Path and _all_ of the unittest death tests. GetTempPath ↵Michael J. Spencer
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-11-29test: Use $SharedLibDir for loadable modules. On Cygming, loadable modules ↵NAKAMURA Takumi
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-27CMake: lit(check.vcproj) can run with multiple configurations on Visual Studio.NAKAMURA Takumi
Unittests need LLVM_BUILD_MODE to pick up each test. Confirmed on CentOS5, Mingw, MSYS, and with possible configurations on VS8 and VS10. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120212 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25Try r96559 for the third time. This time the shared library is only built ifJeffrey Yasskin
--enable-shared is passed to configure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23Roll back r96959 again.Jeffrey Yasskin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23Roll r96559 forward again, adding libLLVM-2.7svn.so to LLVM. This links 3 ofJeffrey Yasskin
the examples shared to make sure the shared library keeps working. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18Roll back the shared library, r96559. It broke two darwins and arm, ↵Jeffrey Yasskin
mysteriously. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96569 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18Add a shared library for LLVM, named libLLVM2.7svn.(so|dylib), and add anJeffrey Yasskin
--enable-shared configure flag to have the tools linked shared. (2.7svn is just $(LLVMVersion) so it'll change to "2.7" in the release.) Always link the example programs shared to test that the shared library keeps working. On my mac laptop, Debug libLLVM2.7svn.dylib is 39MB, and opt (for example) is 16M static vs 440K shared. Two things are less than ideal here: 1) The library doesn't include any version information. Since we expect to break the ABI with every release, this shouldn't be much of a problem. If we do release a compatible 2.7.1, we may be able to hack its library to work with binaries compiled against 2.7.0, or we can just ask them to recompile. I'm hoping to get a real packaging expert to look at this for the 2.8 release. 2) llvm-config doesn't yet have an option to print link options for the shared library. I'll add this as a subsequent patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96559 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08CMake/lit: Add llvm_{unit_,}site_config parameters, and always pass them ↵Daniel Dunbar
when running tests from the project files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90869 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08Switch to using 'lit.site.cfg.in' for the site config template for Unit tests,Daniel Dunbar
and generate it for CMake builds as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14Teach 'make check-lit' to run unittests.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81753 91177308-0d34-0410-b5e6-96231b3b80d8