Similar to FILECHECK_OPTS for FileCheck, LIT_OPTS makes it easy to
adjust lit behavior when running the test suite via ninja. For
example:
$ LIT_OPTS='--time-tests -vv --filter=threadprivate' \ ninja check-clang-openmp
Differential D64135
[lit] Parse command-line options from LIT_OPTS jdenny on Jul 3 2019, 7:59 AM. Authored by
Details Similar to FILECHECK_OPTS for FileCheck, LIT_OPTS makes it easy to $ LIT_OPTS='--time-tests -vv --filter=threadprivate' \ ninja check-clang-openmp
Diff Detail
Event TimelineComment Actions I think it would be preferable to standardize on llvm-lit as the way to re-run particular tests with some options. Comment Actions Thanks for the comment. Why so? For me, it seems quicker to use LIT_OPTS and ninja because I don't have to extract the lit command line from ninja -v. For ninja check-all, that's a lot to copy and paste. It also avoids forgetting to rebuild while I'm alternating between hacking the source and re-running failing tests. Comment Actions lit has options? If this works when running llvm-lit.py as well as ninja check-foo, I can see it being handy for those (rare at least for me) occasions when a lit option is what you want. And it looks pretty cheap. Re tests, I don't see why you have 4, wouldn't 2 be sufficient? Given that 2, 3, and 4 are identical. Comment Actions :-)
Lately, I most often use -vv (so I can see the line number of a failed RUN command) and -a (so I can verify the passing tests are doing what I expect).
Good point. Actually, 1 is probably enough for what I actually mean to test. I'll adjust soon. Thanks. Comment Actions Hi Joel @jdenny,
One more ask independent of what we decide: the lit-opts.py test does not go red when we change the override order. Can you adapt the test to give a signal in this case? env_args = shlex.split(os.environ.get("LIT_OPTS", "")) args = sys.argv[1:] + env_args # lit-opts.py does not go red when we flip the order of concatenation here. Is this expected? opts = parser.parse_args(args) Also: thank you for adding and documenting this feature and even providing a test. I am already using it and find it useful! Comment Actions Hi Julian.
I guess it depends on the intended use case: which is the default, and which is the override?
To fully support the use case 1 without risking surprising behavior if someone attempts use case 2, we could try to move the LIT_OPTS implementation out of lit and into the build system. That is, use case 2 would become impossible. Then again, order doesn't seem to matter anyway for options that I normally care about: -a and -vv seem to take effect no matter where they appear in relation to the usual default of -sv. Order does matter for --filter, and I assume it matters for -D. I don't know if anyone would ever build with those as default options and then want to override them. It might be surprising if you couldn't, given that 1 is the intended use case. Without knowing which use cases beyond my own are real, I'm inclined to wait before selecting a path forward. @probinson reviewed, so perhaps he has some opinion.
Good point.
Good to hear! Thanks. |