summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit
Commit message (Collapse)AuthorAgeFilesLines
...
* [lit] Remove unnecessary tracking of test_indexJulian Lettner2019-10-182-17/+11
| | | | llvm-svn: 375263
* [lit] Only send back test result from worker processJulian Lettner2019-10-183-16/+15
| | | | | | | Avoid sending back the whole run.Test object (which needs to be pickled) from the worker process when we are only interested in the test result. llvm-svn: 375262
* [lit] Move resolving of XFAIL result codes out of Test.setResultJulian Lettner2019-10-182-12/+21
| | | | | | | This will allow us to serialize just the result object instead of the whole lit.Test object back from the worker to the main lit process. llvm-svn: 375195
* [lit] worker.py: Improve code for executing a single testJulian Lettner2019-10-181-12/+21
| | | | llvm-svn: 375194
* [lit] Move computation of deadline up into base classJulian Lettner2019-10-171-18/+18
| | | | llvm-svn: 375171
* Reland "[lit] Synthesize artificial deadline"Julian Lettner2019-10-171-13/+7
| | | | | | | | | | | | | | We always want to use a deadline when calling `result.await`. Let's synthesize an artificial deadline (now plus one year) to simplify code and do less busy waiting. Thanks to Reid Kleckner for diagnosing that a deadline for of "positive infinity" does not work with Python 3 anymore. See commit: 4ff1e34b606d9a9fcfd8b8b5449a558315af94e5 I tested this patch with Python 2 and Python 3. llvm-svn: 375165
* Revert [lit] Synthesize artificial deadlineReid Kleckner2019-10-171-19/+28
| | | | | | | | | | | | Python on Windows raises this OverflowError: gotit = waiter.acquire(True, timeout) OverflowError: timestamp too large to convert to C _PyTime_t So it seems this API behave the same way on every OS. Also reverts the dependent commit a660dc590a5e8dafa1ba6ed56447ede151d17bd9. llvm-svn: 375143
* [lit] Move computation of deadline up into base classJulian Lettner2019-10-171-16/+15
| | | | llvm-svn: 375130
* [lit] Synthesize artificial deadlineJulian Lettner2019-10-171-13/+5
| | | | | | | | We always want to use a deadline when calling `result.await`. Let's synthesize an artificial deadline (positive infinity) to simplify code and do less busy waiting. llvm-svn: 375129
* [lit] Create derived classes for serial/parallel test runsJulian Lettner2019-10-172-43/+51
| | | | | | | The hope is that with a little OO we can nicely factor out the differences. llvm-svn: 375128
* Revert r375114: "[lit] Make internal diff work in pipelines"Joel E. Denny2019-10-179-304/+271
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 375121
* Revert r375116: "[lit] Extend internal diff to support `-` argument"Joel E. Denny2019-10-177-146/+5
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 375120
* [lit] Extend internal diff to support `-` argumentJoel E. Denny2019-10-177-5/+146
| | | | | | | | | | | | | | | | | | | | | | When using lit's internal shell, RUN lines like the following accidentally execute an external `diff` instead of lit's internal `diff`: ``` # RUN: program | diff file - ``` Such cases exist now, in `clang/test/Analysis` for example. We are preparing patches to ensure lit's internal `diff` is called in such cases, which will then fail because lit's internal `diff` doesn't recognize `-` as a command-line option. This patch adds support for `-` to mean stdin. Reviewed By: probinson, rnk Differential Revision: https://reviews.llvm.org/D67643 llvm-svn: 375116
* [lit] Make internal diff work in pipelinesJoel E. Denny2019-10-179-271/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | When using lit's internal shell, RUN lines like the following accidentally execute an external `diff` instead of lit's internal `diff`: ``` # RUN: program | diff file - # RUN: not diff file1 file2 | FileCheck %s ``` Such cases exist now, in `clang/test/Analysis` for example. We are preparing patches to ensure lit's internal `diff` is called in such cases, which will then fail because lit's internal `diff` cannot currently be used in pipelines and doesn't recognize `-` as a command-line option. To enable pipelines, this patch moves lit's `diff` implementation into an out-of-process script, similar to lit's `cat` implementation. A follow-up patch will implement `-` to mean stdin. Reviewed By: probinson, stella.stamenova Differential Revision: https://reviews.llvm.org/D66574 llvm-svn: 375114
* [lit] Improve lit.Run classJulian Lettner2019-10-172-31/+37
| | | | | | | | * Push timing of overall test time into run module * Make lit.Run a proper class * Add a few TODO comments llvm-svn: 375065
* [lit] Remove unnecessary usage of lit.RunJulian Lettner2019-10-162-5/+3
| | | | llvm-svn: 375056
* [lit] Do not create semaphores when we do not need themJulian Lettner2019-10-161-7/+6
| | | | | | | Parallelism groups and semaphores are only required for parallel execution. llvm-svn: 375055
* [lit] Factor out separate methods for parallel and serial executionJulian Lettner2019-10-161-43/+47
| | | | llvm-svn: 375054
* [lit] Print warning if we fail to delete temp directoryJulian Lettner2019-10-161-3/+3
| | | | llvm-svn: 375049
* [lit] Skip creation of tmp dir if we don't actually run any testsJulian Lettner2019-10-161-32/+35
| | | | llvm-svn: 375048
* [lit] Remove return value from print_summary functionJulian Lettner2019-10-161-9/+5
| | | | llvm-svn: 375047
* [lit] Small refactoring and cleanups in main.pyJulian Lettner2019-10-161-69/+55
| | | | | | | | | | | | | * Remove outdated precautions for Python versions < 2.7 * Remove dead code related to `maxIndividualTestTime` option * Move printing of test and result summary out of main into its own function Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68847 llvm-svn: 375046
* [lit] Fix internal diff's --strip-trailing-cr and use itJoel E. Denny2019-10-166-3/+73
| | | | | | | | | | | | | | | | | | | | | | | | | Using GNU diff, `--strip-trailing-cr` removes a `\r` appearing before a `\n` at the end of a line. Without this patch, lit's internal diff only removes `\r` if it appears as the last character. That seems useless. This patch fixes that. This patch also adds `--strip-trailing-cr` to some tests that fail on Windows bots when D68664 is applied. Based on what I see in the bot logs, I think the following is happening. In each test there, lit diff is comparing a file with `\r\n` line endings to a file with `\n` line endings. Without D68664, lit diff reads those files in text mode, which in Windows causes `\r\n` to be replaced with `\n`. However, with D68664, lit diff reads the files in binary mode instead and thus reports that every line is different, just as GNU diff does (at least under Ubuntu). Adding `--strip-trailing-cr` to those tests restores the previous behavior while permitting the behavior of lit diff to be more like GNU diff. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68839 llvm-svn: 375020
* [lit] Clean up internal diff's encoding handlingJoel E. Denny2019-10-167-35/+88
| | | | | | | | | | | | | | | | | | | | | As suggested by rnk at D67643#1673043, instead of reading files multiple times until an appropriate encoding is found, read them once as binary, and then try to decode what was read. For Python >= 3.5, don't fail when attempting to decode the `diff_bytes` output in order to print it. Avoid failures for Python 2.7 used on some Windows bots by transforming diff output with `lit.util.to_string` before writing it to stdout. Finally, add some tests for encoding handling. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68664 llvm-svn: 375018
* [lit] Add back LitTestCaseJulian Lettner2019-10-155-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This essentially reverts a commit [1] that removed the adaptor for Python unittests. The code has been slightly refactored to make it more additive: all code is contained in LitTestCase.py. Usage sites will require a small adaption: ``` [old] import lit.discovery ... test_suite = lit.discovery.load_test_suite(...) [new] import lit.LitTestCase ... test_suite = lit.LitTestCase.load_test_suite(...) ``` This was put back on request by Daniel Dunbar, since I wrongly assumed that the functionality is unused. At least llbuild still uses this [2]. [1] 70ca752ccf6a8f362aea25ccd3ee2bbceca93b20 [2] https://github.com/apple/swift-llbuild/blob/master/utils/Xcode/LitXCTestAdaptor/LitTests.py#L16 Reviewed By: ddunbar Differential Revision: https://reviews.llvm.org/D69002 llvm-svn: 374947
* [LLDB] [Windows] Initial support for ARM64 register contextsMartin Storsjo2019-10-151-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D67954 llvm-svn: 374866
* [lit] Add argument check: --timeout must be non-negative integerJulian Lettner2019-10-141-7/+13
| | | | llvm-svn: 374847
* [lit] Create Run object later and only when it is neededJulian Lettner2019-10-141-30/+31
| | | | | | | | Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68843 llvm-svn: 374823
* [clang-scan-deps] Support for clang --analyze in clang-scan-depsJan Korous2019-10-141-1/+1
| | | | | | | | | | | | | | | The goal is to have 100% fidelity in clang-scan-deps behavior when --analyze is present in compilation command. At the same time I don't want to break clang-tidy which expects __static_analyzer__ macro defined as built-in. I introduce new cc1 options (-setup-static-analyzer) that controls the macro definition and is conditionally set in driver. Differential Revision: https://reviews.llvm.org/D68093 llvm-svn: 374815
* [lit] Extend internal diff to support -UJoel E. Denny2019-10-146-6/+142
| | | | | | | | | | | | | | | | | | | | | | When using lit's internal shell, RUN lines like the following accidentally execute an external `diff` instead of lit's internal `diff`: ``` # RUN: program | diff -U1 file - ``` Such cases exist now, in `clang/test/Analysis` for example. We are preparing patches to ensure lit's internal `diff` is called in such cases, which will then fail because lit's internal `diff` doesn't recognize `-U` as a command-line option. This patch adds `-U` support. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68668 llvm-svn: 374814
* Revert r374648: "Reland r374388: [lit] Make internal diff work in pipelines"Joel E. Denny2019-10-125-276/+241
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 374683
* Revert r374649: "Reland r374389: [lit] Clean up internal diff's encoding ↵Joel E. Denny2019-10-127-86/+33
| | | | | | | | handling" This series of patches still breaks a Windows bot. llvm-svn: 374682
* Revert r374650: "Reland r374390: [lit] Extend internal diff to support `-` ↵Joel E. Denny2019-10-127-146/+5
| | | | | | | | argument" This series of patches still breaks a Windows bot. llvm-svn: 374681
* Revert 374651: "Reland r374392: [lit] Extend internal diff to support -U"Joel E. Denny2019-10-124-136/+6
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 374680
* Revert r374652: "[lit] Fix internal diff's --strip-trailing-cr and use it"Joel E. Denny2019-10-126-73/+4
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 374679
* Revert r374653: "[lit] Fix a few oversights in r374651 that broke some bots"Joel E. Denny2019-10-121-1/+1
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 374678
* Revert r374665: "[lit] Try yet again to fix new tests that fail on Windows bots"Joel E. Denny2019-10-121-3/+0
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 374677
* Revert r374666: "[lit] Adjust error handling for decode introduced by r374665"Joel E. Denny2019-10-121-1/+1
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 374676
* Revert r374671: "[lit] Try errors="ignore" for decode introduced by r374665"Joel E. Denny2019-10-121-1/+1
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 374675
* [lit] Try errors="ignore" for decode introduced by r374665Joel E. Denny2019-10-121-1/+1
| | | | | | Still trying to fix the same error as in r374666. llvm-svn: 374671
* [lit] Adjust error handling for decode introduced by r374665Joel E. Denny2019-10-121-1/+1
| | | | | | | | | | | | | On that decode, Windows bots fail with: ``` UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128) ``` That's the same error as before r374665 except it's now at the decode before the write to stdout. llvm-svn: 374666
* [lit] Try yet again to fix new tests that fail on Windows botsJoel E. Denny2019-10-121-0/+3
| | | | | | | | | | | | | | | | | | | | | I seem to have misread the bot logs on my last attempt. When lit's internal diff runs on Windows under Python 2.7, it's text diffs not binary diffs that need decoding to avoid this error when writing the diff to stdout: ``` UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128) ``` There is no `decode` attribute in this case under Python 3.6.8 under Ubuntu, so this patch checks for the `decode` attribute before using it here. Hopefully nothing else is needed when `decode` isn't available. It might take a couple more attempts to figure out what error handling, if any, is needed for this decoding. llvm-svn: 374665
* Revert r374657: "[lit] Try again to fix new tests that fail on Windows bots"Joel E. Denny2019-10-122-7/+6
| | | | llvm-svn: 374664
* [lit] Try again to fix new tests that fail on Windows botsJoel E. Denny2019-10-122-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the bot logs, when lit's internal diff runs on Windows, it looks like binary diffs must be decoded also for Python 2.7. Otherwise, writing the diff to stdout fails with: ``` UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128) ``` I did not need to decode using Python 2.7.15 under Ubuntu. When I do it anyway in that case, `errors="backslashreplace"` fails for me: ``` TypeError: don't know how to handle UnicodeDecodeError in error callback ``` However, `errors="ignore"` works, so this patch uses that, hoping it'll work on Windows as well. This patch leaves `errors="backslashreplace"` for Python >= 3.5 as there's no evidence yet that doesn't work and it produces more informative binary diffs. This patch also adjusts some lit tests to succeed for either error handler. This patch adjusts changes introduced by D68664. llvm-svn: 374657
* Revert r374654: "[lit] Try to fix new tests that fail on Windows bots"Joel E. Denny2019-10-121-20/+20
| | | | llvm-svn: 374656
* [lit] Try to fix new tests that fail on Windows botsJoel E. Denny2019-10-121-20/+20
| | | | llvm-svn: 374654
* [lit] Fix a few oversights in r374651 that broke some botsJoel E. Denny2019-10-121-1/+1
| | | | llvm-svn: 374653
* [lit] Fix internal diff's --strip-trailing-cr and use itJoel E. Denny2019-10-126-4/+73
| | | | | | | | | | | | | | | | | | | | | | | | | Using GNU diff, `--strip-trailing-cr` removes a `\r` appearing before a `\n` at the end of a line. Without this patch, lit's internal diff only removes `\r` if it appears as the last character. That seems useless. This patch fixes that. This patch also adds `--strip-trailing-cr` to some tests that fail on Windows bots when D68664 is applied. Based on what I see in the bot logs, I think the following is happening. In each test there, lit diff is comparing a file with `\r\n` line endings to a file with `\n` line endings. Without D68664, lit diff reads those files with Python's universal newlines support activated, causing `\r` to be dropped. However, with D68664, lit diff reads the files in binary mode instead and thus reports that every line is different, just as GNU diff does (at least under Ubuntu). Adding `--strip-trailing-cr` to those tests restores the previous behavior while permitting the behavior of lit diff to be more like GNU diff. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68839 llvm-svn: 374652
* Reland r374392: [lit] Extend internal diff to support -UJoel E. Denny2019-10-124-6/+136
| | | | | | | | | | To avoid breaking some tests, D66574, D68664, D67643, and D68668 landed together. However, D68664 introduced an issue now addressed by D68839, with which these are now all relanding. Differential Revision: https://reviews.llvm.org/D68668 llvm-svn: 374651
* Reland r374390: [lit] Extend internal diff to support `-` argumentJoel E. Denny2019-10-127-5/+146
| | | | | | | | | | To avoid breaking some tests, D66574, D68664, D67643, and D68668 landed together. However, D68664 introduced an issue now addressed by D68839, with which these are now all relanding. Differential Revision: https://reviews.llvm.org/D67643 llvm-svn: 374650
OpenPOWER on IntegriCloud