summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit
Commit message (Collapse)AuthorAgeFilesLines
...
* [lit] Pass CLANG env var to testing configurationVictor Leschuk2018-02-091-1/+1
| | | | | | | | Allow CLANG environment variable be copied into the testing configuration and proper support testing with a custom path to the clang executable. Signed-off-by: Vladimir Vereschaka <vvereschaka@accesssoftek.com> llvm-svn: 324706
* [lit] Implement "-r" option for builtin "diff" command + a test using that.Max Moroz2018-01-0911-12/+245
| | | | | | | | | | | | | | | | Summary: That would allow to recursively compare directories in tests using "diff -r" on Windows in a similar way as it can be done on Linux or Mac. Reviewers: zturner, morehouse, vsk Reviewed By: zturner Subscribers: kcc, llvm-commits Differential Revision: https://reviews.llvm.org/D41776 llvm-svn: 322102
* [lit] Bump version numberTom Stellard2018-01-031-1/+1
| | | | llvm-svn: 321735
* Disable detect_leaks in the ASanified build of LLVM when using Apple LLVM. ↵Kuba Mracek2017-12-051-1/+2
| | | | | | The released Apple LLVM versions don't support LSan. llvm-svn: 319738
* [NFC][lit] Use proper semantic versioning names for variablesJonas Devlieghere2017-12-041-2/+3
| | | | | | | | | The variable named `minor` was actually pointing to the patch part of the version. While I was changing this I also made the check for Apple clang more robust by checking both patch and minor rather than just minor. llvm-svn: 319656
* [lit] Don't enable LSan on Darwin for Apple clang 9.0.0Jonas Devlieghere2017-12-011-4/+5
| | | | | | | | | The latest clang that ships with Xcode (clang 900 or 9.0.0) does not support LSan. This fixes the lit configuration to reflect that. Differential revision: https://reviews.llvm.org/D40672 llvm-svn: 319530
* [lit] Implement non-pipelined ‘mkdir’, ‘diff’ and ‘rm’ commands ↵Ying Yi2017-12-0119-2/+456
| | | | | | | | | | | | | | | | | internally Summary: The internal shell already supports 'cd', ‘export’ and ‘echo’ commands. This patch adds implementation of non-pipelined ‘mkdir’, ‘diff’ and ‘rm’ commands as the internal shell builtins. Reviewed by: Zachary Turner, Reid Kleckner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39567 llvm-svn: 319528
* Make check-lit tests respect LLVM_LIT_TOOLS_DIRGreg Bedwell2017-11-293-5/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D40520 llvm-svn: 319329
* lit: Bring back -Dtool=xxx feature lost in r313928Matthias Braun2017-11-281-3/+8
| | | | llvm-svn: 319139
* Reverted rL318911 since it broke the sanitizer-windows.Ying Yi2017-11-2319-437/+2
| | | | llvm-svn: 318914
* [lit] Implement non-pipelined ‘mkdir’, ‘diff’ and ‘rm’ commands ↵Ying Yi2017-11-2319-2/+437
| | | | | | | | | | | | | | | | | internally Summary: The internal shell already supports 'cd', ‘export’ and ‘echo’ commands. This patch adds implementation of non-pipelined ‘mkdir’, ‘diff’ and ‘rm’ commands as the internal shell builtins. Reviewers: Zachary Turner, Reid Kleckner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39567 llvm-svn: 318911
* Re-revert "Refactor debuginfo-tests."Zachary Turner2017-11-211-6/+3
| | | | | | | | | | This is still breaking greendragon. At this point I give up until someone can fix the greendragon bots, and I will probably abandon this effort in favor of using a private github repository. llvm-svn: 318722
* Resubmit "Refactor debuginfo-tests" again.Zachary Turner2017-11-201-3/+6
| | | | | | | | | | | | This was reverted due to the tests being run twice on some build bots. Each run had a slightly different configuration due to the way in which it was being invoked. This fixes the problem (albeit in a somewhat hacky way). Hopefully in the future we can get rid of the workflow of running debuginfo-tests as part of clang, and then this hack can go away. llvm-svn: 318697
* [LIT] Fix testing out-of-tree Clang buildsEric Fiselier2017-11-191-4/+4
| | | | | | | | | | | | | | | | | Summary: Currently, LIT configures the LLVM binary path before the Clang binary path. However this breaks testing out-of-tree Clang builds (where the LLVM binary path includes a copy of Clang). This patch reverses the order of the paths when looking for Clang, putting the Clang binary directory first. Reviewers: zturner, beanz, chapuni, modocache, EricWF Reviewed By: EricWF Subscribers: mgorny, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D40217 llvm-svn: 318607
* [lit] Try to improve Ctrl-C behavior on WindowsReid Kleckner2017-11-171-10/+10
| | | | | | | This functionality was broken during a refactor a while back because 'pool' is no longer in scope. llvm-svn: 318572
* Fix an issue with llvm lit tool substitutions.Zachary Turner2017-11-171-1/+1
| | | | | | | When using an installed clang with an in-tree llvm, we were not searching in the right paths for the tools. llvm-svn: 318564
* Re-revert "Refactor debuginfo-tests"Zachary Turner2017-11-171-6/+3
| | | | | | | | | | | | | | | | | | | | | | This is still broken because it causes certain tests to be run twice with slightly different configurations, which is wrong in some cases. You can observe this by running: ninja -nv check-all | grep debuginfo-tests And seeing that it passes clang/test and clang/test/debuginfo-tests to lit, which causes it to run debuginfo-tests twice. The fix is going to involve either: a) figuring out that we're running in this "deprecated" configuration, and then deleting the clang/test/debuginfo-tests path, which should cause it to behave identically to before, or: b) make lit smart enough that it doesn't descend into a sub-suite if that sub-suite already has a lit.cfg file. llvm-svn: 318486
* Resubmit "Refactor debuginfo-tests"Zachary Turner2017-11-161-3/+6
| | | | | | | | | | This was reverted due to some failures on specific darwin buildbots, the issue being that the new lit configuration was not setting the SDKROOT environment variable. We've tested a fix locally and confirmed that it works, so this patch resubmits everything with the fix applied. llvm-svn: 318435
* Revert "Update test_debuginfo.pl script to point to new tree location."Zachary Turner2017-11-131-6/+3
| | | | | | | | This reverts the aforementioned patch and 2 subsequent follow-ups, as some buildbots are still failing 2 tests because of it. Investigation is ongoing into the cause of the failures. llvm-svn: 318112
* [debuginfo-tests] Make debuginfo-tests work in a standard configuration.Zachary Turner2017-11-101-3/+6
| | | | | | | | | | | | | | | | | | | Previously, debuginfo-tests was expected to be checked out into clang/test and then the tests would automatically run as part of check-clang. This is not a standard workflow for handling external projects, and it brings with it some serious drawbacks such as the inability to depend on things other than clang, which we will need going forward. The goal of this patch is to migrate towards a more standard workflow. To ease the transition for build bot maintainers, this patch tries not to break the existing workflow, but instead simply deprecate it to give maintainers a chance to update the build infrastructure. Differential Revision: https://reviews.llvm.org/D39605 llvm-svn: 317925
* Add system-linux to allow tests run with llvm-lit to restrict themselves to ↵Jake Ehrlich2017-11-011-2/+4
| | | | | | | | | | | | | | linux I need a test that only runs in a reasonable amount of time on systems that have sparse files. The broadest class of systems that support sparse files are linux systems. So restricting my test to linux systems should suffice. This change adds the system-linux feature to llvm-lit so that it can be required. Differential Revision: https://reviews.llvm.org/D39482 llvm-svn: 317055
* lit: Improve %: normalization.Peter Collingbourne2017-10-171-17/+16
| | | | | | | | | The new scheme should match the normalization of embedded paths in linkrepro tar files. Differential Revision: https://reviews.llvm.org/D39023 llvm-svn: 316044
* Revert "lit.py: Add new %{shared_output(LABEL)} substitution"Jordan Rose2017-10-147-38/+0
| | | | | | | This reverts r315697 and my ill-fated attempts to fix it on Windows. I'll try again when I get access to a Windows machine. llvm-svn: 315793
* lit.py: Give up and disable the new shared-output.py test on WindowsJordan Rose2017-10-141-0/+3
| | | | | | | | | | "No such file or directory: C:\\...\\tests\\Output\\shared-output.py.tmp/Output/Shared/SHARED.tmp" And yet other forward-slashes don't seem to be causing the same problem. I'll see if I can get ahold of a Windows machine to poke at this directly later. llvm-svn: 315792
* lit.py: Previous test fix was a red herring; backslashes are escapesJordan Rose2017-10-141-1/+1
| | | | | | | I don't have access to a Windows machine at the moment, so if this doesn't fix it I'll just revert for now. llvm-svn: 315782
* lit.py: Fix new test harder for systems that don't use / as os.path.sepJordan Rose2017-10-141-1/+1
| | | | | | | I didn't think about '%{inputs}' having the same problem. This one should be a fully Windows path name. llvm-svn: 315779
* lit.py: Fix new test for systems that don't use / as os.path.sepJordan Rose2017-10-131-1/+1
| | | | llvm-svn: 315773
* lit.py: Add new %{shared_output(LABEL)} substitutionJordan Rose2017-10-137-0/+35
| | | | | | | | | | | | This refers to a temporary path that can be shared across all tests, identified by a particular label. This can be used for things like caches. At the moment, the character set for the LABEL is limited to C identifier characters, plus '-', '+', '=', and '.'. This is the same set of characters currently allowed in REQUIRES clause identifiers. llvm-svn: 315697
* [lit] Raise the logic for enabling clang & lld substitutions to llvm.Zachary Turner2017-10-121-4/+171
| | | | | | | | | | This paves the way for other projects which might /use/ clang or lld but not necessarily need to the full set of functionality available to clang and lld tests to be able to have a basic set of substitutions that allow a project to run the clang or lld executables. llvm-svn: 315627
* [lit] Only enable LSan on darwin when clang supports itFrancis Ricci2017-10-101-1/+29
| | | | | | | | | | | | | | | | Summary: LSan on darwin doesn't exist on older versions of clang, causing non-boostrapped sanitized buildbots to fail Reviewers: kubamracek, qcolombet, sqlbyme, zturner, modocache Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38703 llvm-svn: 315333
* [lit] Improve tool substitution in lit.Zachary Turner2017-10-064-74/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses two sources of inconsistency in test configuration files. 1. Substitution boundaries. Previously you would specify a substitution, such as 'lli', and then additionally a set of characters that should fail to match before and after the tool. This was used, for example, so that matches that are parts of full paths would not be replaced. But not all tools did this, and those that did would often re-invent the set of characters themselves, leading to inconsistency. Now, every tool substitution defaults to using a sane set of reasonable defaults and you have to explicitly opt out of it. This actually fixed a few latent bugs that were never being surfaced, but only on accident. 2. There was no standard way for the system to decide how to locate a tool. Sometimes you have an explicit path, sometimes we would search for it and build up a path ourselves, and sometimes we would build up a full command line. Furthermore, there was no standardized way to handle missing tools. Do we warn, fail, ignore, etc? All of this is now encapsulated in the ToolSubst class. You either specify an exact command to run, or an instance of FindTool('<tool-name>') and everything else just works. Furthermore, you can specify an action to take if the tool cannot be resolved. Differential Revision: https://reviews.llvm.org/D38565 llvm-svn: 315085
* Run pyformat on lit code.Zachary Turner2017-10-062-82/+113
| | | | llvm-svn: 315084
* [test] Fix append_path in the empty caseFrancis Ricci2017-10-041-3/+7
| | | | | | | | | | | | | | | | Summary: normpath() was being called on an empty string and appended to the environment variable in the case where the environment variable was unset. This led to ":." being appended to the path, since normpath() of an empty string is '.', presumably to represent cwd. Reviewers: zturner, sqlbyme, modocache Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38542 llvm-svn: 314915
* [lit] Fix running lit tests in unconfigured source dirMichal Gorny2017-10-011-1/+1
| | | | | | | | | | | | | Fix llvm_tools_dir attribute access not to fail when the variable is not present. This directory is not really necessary to run lit tests, and the code already accounts for it being None. The reference was added in r313407, and it breaks the stand-alone lit package in Gentoo. Differential Revision: https://reviews.llvm.org/D38442 llvm-svn: 314620
* [test] Enable LeakSanitizer on 64-bit Darwin ASan llvm buildsFrancis Ricci2017-09-291-0/+3
| | | | | | | | | | | | | | Summary: Also disables leak checking on lto tests, due to many leaks reported in the system's ld64. Reviewers: kcc, pcc, bogner, kubamracek Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D37781 llvm-svn: 314535
* Resubmit "[lit] Refactor out some more common lit configuration code."Zachary Turner2017-09-213-13/+143
| | | | | | | | There were two issues, one Python 3 specific related to Unicode, and another which is that the tool substitution for lld no longer rejected matches where a / preceded the tool name. llvm-svn: 313928
* Revert "[lit] Refactor out some more common lit configuration code."Zachary Turner2017-09-213-141/+13
| | | | | | | | This is breaking several bots. I have enough information to investigate, so I'm reverting to green until I get it figured out. llvm-svn: 313922
* [lit] Refactor out some more common lit configuration code.Zachary Turner2017-09-213-13/+141
| | | | | | | | | | | | | | | | | | | | | debuginfo-tests has need to reuse a lot of common configuration from clang and lld, and in general it seems like all of the projects which are tightly coupled (e.g. lld, clang, llvm, lldb, etc) can benefit from knowing about one other. For example, lldb needs to know various things about how to run clang in its test suite. Since there's a lot of common substitutions and operations that need to be shared among projects, sinking this up into LLVM makes sense. In addition, this patch introduces a function add_tool_substitution which handles all the dirty intricacies of matching tool names which was previously copied around the various config files. This is now a simple straightforward interface which is hard to mess up. Differential Revision: https://reviews.llvm.org/D37944 llvm-svn: 313919
* [lit] Actually do normalize the case of files in the config map.Zachary Turner2017-09-213-2/+5
| | | | | | | | | | | | | | | This has gone back and forth, but it seems this is necessary after all. realpath is not sufficient because if you have a file named 'C:\foo.txt', then both realpath('c:\foo.txt') and realpath(C:\foo.txt') return the string that was passed to them exactly as is, meaning the case of the drive-letter won't match. The problem before was not that we were normalizing the case of items going into the config map, but rather that we were normalizing the case of something we needed to print. The value that is used to key on the config map should never be printed. llvm-svn: 313918
* [lit] Don't norm case when inserting into the config map.Zachary Turner2017-09-214-5/+3
| | | | | | | | This makes all paths lowercase on Windows, which seemed like a good idea at the time, but it means that tests can't properly use FileCheck to match expected path names. llvm-svn: 313889
* [lit] Add a test for the builtin config map.Zachary Turner2017-09-219-1/+58
| | | | | | | | | | | | | | | | | | | Config map is not exposed through the command line, so testing this is somewhat tricky. But basically we need a test that if a custom driver builds a config map and passes it to main, it gets respected. A config map allows config files in the source tree to be mapped to alternate config files in the build tree. This particular test works by having two config files in separate directories, and setting up a config map to have that redirects A/lit.site.cfg to B/altconfig. Then, we print a message in A/lit.site.cfg and B/altconfig and check that we do see the output from B but don't see the output from A. Additionally we test that the test suite specified by A's config map is properly discovered. Differential Revision: https://reviews.llvm.org/D38105 llvm-svn: 313887
* [lit/Win] Check if a path was found before attempting to use it.David L. Jones2017-09-211-1/+2
| | | | | | | | | | | | | | Summary: This appears to break some bots, when getToolsPath fails to find some or all of the tools (for example, an incomplete GnuWin32 installation). Reviewers: zturner, modocache Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D38115 llvm-svn: 313854
* [lit] Make lit support config files with .py extension.Zachary Turner2017-09-214-11/+50
| | | | | | | | | | | | | | | | | 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
* [lit] Undo the patch to stop writing pyc files.Zachary Turner2017-09-201-2/+0
| | | | | | | The problems on the bots appear to be resolved and this was determined to not be the culprit. Removing this. llvm-svn: 313807
* [lit] Reverse path list when updating environment vars.Zachary Turner2017-09-201-1/+4
| | | | | | | | Bug pointed out by EricWF. This would construct a path where items would be added in the wrong order, potentially leading to using the wrong tools for testing. llvm-svn: 313765
* Make lit stop writing pyc files.Zachary Turner2017-09-191-0/+3
| | | | | | | | | | | | Many svn-based buildbots seem to be getting stuck continually in tree conflicts due to the output of pyc files. I'm disabling these as a temporary measure in an attempt to get everything stable again. I'll try to remove this code once I understand the problem better. llvm-svn: 313698
* [lit] Use realpath when adding to the config map.Zachary Turner2017-09-181-0/+1
| | | | | | | | | | | | | Since the path a user specifies to the llvm-lit script might be different than the source tree they built from (since they could be behind different symlinks), we need to use realpath to make sure that path comparisons work as expected. Even better would be to use a custom dictionary comparison with actual file equivalence comparison semantics, but this is the least friction to unbreak things for now. llvm-svn: 313594
* Fix inverted regex search.Zachary Turner2017-09-181-4/+4
| | | | | | | I was using the pattern as the source string and vice versa causing strange regular expression errors. llvm-svn: 313590
* [lit] Fix a Python 3 compatibility issue.Zachary Turner2017-09-181-1/+1
| | | | llvm-svn: 313580
* [lit] Update clang and lld to use new config helpers.Zachary Turner2017-09-181-21/+63
| | | | | | | NFC intended here, this only updates clang and lld's lit configs to use some helper functionality in the lit.llvm submodule. llvm-svn: 313579
OpenPOWER on IntegriCloud