-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add -output-dir and other file handling improvements #412
Conversation
All 6 tests deleted in #364 except for complex_expressionBUG were in test_updater.
Code changes, dedicated regression tests for fixes/enhancements, and other closely related changes. See the PR description for details.
This was fully automated and shouldn't need review.
81e0e5e
to
12b1ea3
Compare
This was partially scripted, but there are enough special cases that it deserves some manual review. typedefs, typedefbounds: Turn the commented-out commands for an idempotence test into a real test, since it passes. Addition of "rm -rf %t*" lines is split into a separate commit to make this diff easier for naive diff tools (e.g., GitHub) to review by avoiding breaking the alignment of corresponding old and new commands.
12b1ea3
to
17fa09a
Compare
John (or anyone else interested): Please let me know if you think any more of the changes deserve regression tests. I wanted to get your opinion before spending the time to write them. I replaced the original, messy commit history with a sequence of commits broken down specifically to make this PR easier to review, though I still plan to squash-merge the PR. If anyone wants to see the old history, let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions about the code, but it generally looks good. I've been over the manually updated tests and don't see anything amiss there.
I took a brief look, and none of the changes stood out as needing tweaks, but I don't know the particulars of unix file system, etc. As far as tests:
It looks like you added tests (or commands within the tests) to run with this option. If they don't exercise the new functionality, then a new test is warranted, but otherwise I don't know what the assumption is here
It may be useful to have a single general-purpose test for each of these. Definitely don't add them as run commands in existing tests, but a special-case regression test for each of them would be useful for potential future regressions, since you've identified an intended behavior |
Suggested by John and it seems to work and yield a slight cleanup.
Great!
Yes, I migrated a large number of existing tests to use
Re Re |
Co-authored-by: John Kastner <[email protected]>
I see, you were asking for explanations for why these issues might regress, rather than votes. If For |
I decided I was worried enough that LLVM might break this at some point on either Linux or Windows to merit a dedicated test. Also fix line wrapping in canwrite_constraints_unimplemented.c.
The only extra thing it did was delete temporary files from the clang/test/3C directory, and our tests no longer create such files.
Co-authored-by: John Kastner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
path. I apparently broke this in #412 and neglected to test testgenerator.py.
Draft squash commit message
List of changes and regression testing status
..
, symlink,foo.c
is not underfoo/
): all have dedicated tests-output-dir
(fixes 3C needs a better way to output multiple files. #347): Assume this is sufficiently exercised by many of the other tests.-allow-sources-outside-base-dir
: Won’t bother with a test, following the precedent of-allow-unwritable-changes
.getCanonicalFilePath
,filePathStartsWith
, etc.: Assume these are tested as much as we care via the higher-level features they implement.-output-dir
+-output-postfix
is an error: Not worth testing? Agreed-base-dir
with trailing slash +-output-dir
gets canonicalized properly and doesn’t cause files to be written at a wrong path: update 2021-02-11: has a dedicated test!errs()
instead ofouts()
to avoid corrupting stdout mode: Not worth testing? Agreed3c -help
text, most notably with explanation of--
(fixes Interaction of error and--
param produces different results in output of 3c #343) (test N/A)-output-postfix
to-output-dir
(fixes 3C output is not cleaned up when a test fails. #378); required adding-base-dir
in a bunch of places-base-dir
in many more commands since input files are now required to be under the base dir and the base dir defaults to lit's working directory, which is notclang/test/3C
count 0
withdiff
now that stdout mode outputs the file even if it is unchangedtest_updater
: Removed tests from the list that were deleted in Remove obsolete tests that were incorrectly resurrected #364; mark some tests as no longer producing whitespace diffs3c
now use--
-fcheckedc-extension
flag from3c
calls because it got in my way (not from%clang
; that can be done later in Clean up testRUN
commands #346)rm -rf %t*
to all tests that mention%t
. This is overkill for tests that only use%t.unused
and the like, but I didn’t think it was worth the trouble to exclude those tests. This boilerplate is unpleasant but is expected to go away eventually with Refactor testRUN
commands into a separate tool #355. I looked into solutions via the lit config and didn’t think it was promising. See the LLVM bug report.canWrite
constraints case to use a crazy#include
instead of a typedef, in anticipation of Fix for issue #373 #408.typedef
,typedefbounds
: Enable the idempotence tests because they pass and having lines that looked like commands but weren't realRUN
lines was confusing my scripts.TODO
-output-postfix
to-output-dir
(fixes 3C output is not cleaned up when a test fails. #378)testgenerator
processor
test_updater
main