summaryrefslogtreecommitdiffstats
path: root/llvm/test/Unit
Commit message (Collapse)AuthorAgeFilesLines
* [test] Fix propagating HOME envvar to unittestsMichal Gorny2018-12-311-0/+5
| | | | | | | | | | | | | Propagate HOME environment variable to unittests. This is necessary to fix test failures resulting from pw_home pointing to a non-existing directory while being overriden with HOME. Apparently Gentoo users hit this sometimes when they override build directory for Portage. Original bug report: https://bugs.gentoo.org/674088 Differential Revision: https://reviews.llvm.org/D56162 llvm-svn: 350175
* [lit] Make lit support config files with .py extension.Zachary Turner2017-09-212-1/+1
| | | | | | | | | | | | | | | | | 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 llvm-svn: 313849
* Resubmit "[lit] Force site configs to run before source-tree configs"Zachary Turner2017-09-151-52/+3
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 313407
* Revert "[lit] Force site configs to run before source-tree configs"Zachary Turner2017-09-151-3/+52
| | | | | | | | 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. llvm-svn: 313335
* [lit] Force site configs to be run before source-tree configsZachary Turner2017-09-141-52/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 313270
* Change remaining references to lit.util.capture to use subprocess.check_output.David L. Jones2017-07-061-2/+3
| | | | | | | | | | | | | | 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 llvm-svn: 307320
* Revert "[lit] Clean output directories before running tests."Zachary Turner2017-06-301-5/+3
| | | | | | | | | This reverts commit da6318a92fba793e4f2447ec478b001392d57d43. This is causing failures on some build bots due to what appears to be some kind of lit ordering dependency. llvm-svn: 306833
* [lit] Clean output directories before running tests.Zachary Turner2017-06-301-3/+5
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 306832
* [Lit] Fix to prevent creation of "%SystemDrive%" directory on Windows.Andrew Ng2017-05-081-0/+4
| | | | | | | | | | | | | | 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 llvm-svn: 302409
* Replace hardcoded comment at 'lit.site.cfg.in'Alex Denisov2016-04-161-2/+2
| | | | | | | | | | | | 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. llvm-svn: 266515
* [lit] Hack lit to allow a test suite to request that it is run "early".Chandler Carruth2016-03-121-0/+3
| | | | | | | | | | | | | 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 llvm-svn: 263329
* Let test/Unit/lit.cfg add config.shlibdir to $PATH on DLL platforms like ↵NAKAMURA Takumi2014-07-041-0/+5
| | | | | | | | cygming. This makes unittests run with BUILD_SHARED_LIBS on DLL platforms. llvm-svn: 212316
* With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore.Rafael Espindola2014-02-282-9/+0
| | | | llvm-svn: 202510
* [tests] Update to use lit_config and lit package, as appropriate.Daniel Dunbar2013-08-092-11/+13
| | | | llvm-svn: 188076
* [tests] Avoid deprecated except syntax.Daniel Dunbar2013-08-071-1/+4
| | | | llvm-svn: 187928
* Propagate path to ASan/MSan symbolizer into test environment to produce ↵Alexey Samsonov2013-04-041-0/+5
| | | | | | useful reports on errors. llvm-svn: 178749
* Disable ASan/MSan symbolization of reports in tests.Evgeniy Stepanov2013-03-271-7/+0
| | | | | | It was using an instrumented symbolizer binary, which is a potential fork bomb. llvm-svn: 178139
* Fixup for r176933: more careful setup of path to llvm-symbolizerAlexey Samsonov2013-03-151-2/+4
| | | | llvm-svn: 177144
* Set symbolizer path in the test environment.Evgeniy Stepanov2013-03-131-0/+5
| | | | | | This is needed to get symbolized stack traces when running LLVM tests under (A|M)San. llvm-svn: 176933
* tests: Rip out a bunch of now unused test code relating to use of llvm-gcc ↵Daniel Dunbar2011-10-271-1/+0
| | | | | | in LLVM tests. llvm-svn: 143143
* test/Unit: Fix enable shared test to follow check that we have actually loadedDaniel Dunbar2011-06-221-8/+8
| | | | | | the site config. llvm-svn: 133641
* Test: Fix Support.Path and _all_ of the unittest death tests. GetTempPath ↵Michael J. Spencer2010-12-071-0/+7
| | | | | | | | defaults to \Windows\. If I typed anything else it would just decline into cursing. llvm-svn: 121095
* test: Use $SharedLibDir for loadable modules. On Cygming, loadable modules ↵NAKAMURA Takumi2010-11-292-3/+3
| | | | | | are not in lib/ but bin. llvm-svn: 120274
* CMake: lit(check.vcproj) can run with multiple configurations on Visual Studio.NAKAMURA Takumi2010-11-271-0/+9
| | | | | | | | Unittests need LLVM_BUILD_MODE to pick up each test. Confirmed on CentOS5, Mingw, MSYS, and with possible configurations on VS8 and VS10. llvm-svn: 120212
* Try r96559 for the third time. This time the shared library is only built ifJeffrey Yasskin2010-02-252-1/+10
| | | | | | --enable-shared is passed to configure. llvm-svn: 97119
* Roll back r96959 again.Jeffrey Yasskin2010-02-232-10/+1
| | | | llvm-svn: 96981
* Roll r96559 forward again, adding libLLVM-2.7svn.so to LLVM. This links 3 ofJeffrey Yasskin2010-02-232-1/+10
| | | | | | the examples shared to make sure the shared library keeps working. llvm-svn: 96959
* Roll back the shared library, r96559. It broke two darwins and arm, ↵Jeffrey Yasskin2010-02-182-10/+1
| | | | | | mysteriously. llvm-svn: 96569
* Add a shared library for LLVM, named libLLVM2.7svn.(so|dylib), and add anJeffrey Yasskin2010-02-182-1/+10
| | | | | | | | | | | | | | | | | | | | --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. llvm-svn: 96559
* CMake/lit: Add llvm_{unit_,}site_config parameters, and always pass them ↵Daniel Dunbar2009-12-081-0/+6
| | | | | | when running tests from the project files. llvm-svn: 90869
* Switch to using 'lit.site.cfg.in' for the site config template for Unit tests,Daniel Dunbar2009-11-082-2/+11
| | | | | | and generate it for CMake builds as well. llvm-svn: 86451
* Teach 'make check-lit' to run unittests.Daniel Dunbar2009-09-141-0/+65
llvm-svn: 81753
OpenPOWER on IntegriCloud