-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[libcxx][docs] Make test name pattern documentation more obvious #73136
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
Changes from all commits
ec9cd46
11d5ec3
a3a7740
d272cad
29fd8e3
b538e94
7efd1ec
55b8a07
be73e31
a5f8fbd
4f0e726
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,38 +151,11 @@ class CxxStandardLibraryTest(lit.formats.FileBasedTest): | |
""" | ||
Lit test format for the C++ Standard Library conformance test suite. | ||
|
||
This test format is based on top of the ShTest format -- it basically | ||
creates a shell script performing the right operations (compile/link/run) | ||
based on the extension of the test file it encounters. It supports files | ||
with the following extensions: | ||
|
||
FOO.pass.cpp - Compiles, links and runs successfully | ||
FOO.pass.mm - Same as .pass.cpp, but for Objective-C++ | ||
|
||
FOO.compile.pass.cpp - Compiles successfully, link and run not attempted | ||
FOO.compile.pass.mm - Same as .compile.pass.cpp, but for Objective-C++ | ||
FOO.compile.fail.cpp - Does not compile successfully | ||
|
||
FOO.link.pass.cpp - Compiles and links successfully, run not attempted | ||
FOO.link.pass.mm - Same as .link.pass.cpp, but for Objective-C++ | ||
FOO.link.fail.cpp - Compiles successfully, but fails to link | ||
|
||
FOO.sh.<anything> - A builtin Lit Shell test | ||
|
||
FOO.gen.<anything> - A .sh test that generates one or more Lit tests on the | ||
fly. Executing this test must generate one or more files | ||
as expected by LLVM split-file, and each generated file | ||
leads to a separate Lit test that runs that file as | ||
defined by the test format. This can be used to generate | ||
multiple Lit tests from a single source file, which is | ||
useful for testing repetitive properties in the library. | ||
Be careful not to abuse this since this is not a replacement | ||
for usual code reuse techniques. | ||
|
||
FOO.verify.cpp - Compiles with clang-verify. This type of test is | ||
automatically marked as UNSUPPORTED if the compiler | ||
does not support Clang-verify. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All done!! |
||
Lit tests are contained in files that follow a certain pattern, which determines the semantics of the test. | ||
Under the hood, we basically generate a builtin Lit shell test that follows the ShTest format, and perform | ||
the appropriate operations (compile/link/run). See | ||
https://libcxx.llvm.org/TestingLibcxx.html#test-names | ||
for a complete description of those semantics. | ||
|
||
Substitution requirements | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a follow-up, it would be great to also move this part of the documentation to |
||
=============================== | ||
|
@@ -200,30 +173,6 @@ class CxxStandardLibraryTest(lit.formats.FileBasedTest): | |
in the same command line. In other words, the test format doesn't perform | ||
separate compilation and linking steps in this case. | ||
|
||
|
||
Additional supported directives | ||
=============================== | ||
In addition to everything that's supported in Lit ShTests, this test format | ||
also understands the following directives inside test files: | ||
|
||
// FILE_DEPENDENCIES: file, directory, /path/to/file | ||
|
||
This directive expresses that the test requires the provided files | ||
or directories in order to run. An example is a test that requires | ||
some test input stored in a data file. When a test file contains | ||
such a directive, this test format will collect them and copy them | ||
to the directory represented by %T. The intent is that %T contains | ||
all the inputs necessary to run the test, such that e.g. execution | ||
on a remote host can be done by simply copying %T to the host. | ||
|
||
// ADDITIONAL_COMPILE_FLAGS: flag1 flag2 flag3 | ||
|
||
This directive will cause the provided flags to be added to the | ||
%{compile_flags} substitution for the test that contains it. This | ||
allows adding special compilation flags without having to use a | ||
.sh.cpp test, which would be more powerful but perhaps overkill. | ||
|
||
|
||
Additional provided substitutions and features | ||
============================================== | ||
The test format will define the following substitutions for use inside tests: | ||
|
Uh oh!
There was an error while loading. Please reload this page.