diff options
author | Julian Schmidt <git.julian.schmidt@gmail.com> | 2024-09-27 13:03:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-27 13:03:23 +0200 |
commit | 7dfdca1961aadc75ca397818bfb9bd32f1879248 (patch) | |
tree | e30d669c95dc31aae996e98ac9652095937f51f3 /clang/unittests/Tooling/Syntax/TreeTest.cpp | |
parent | 3fee3e83a8a802cd23e79fbf2f1320bb8f961d0c (diff) | |
download | llvm-7dfdca1961aadc75ca397818bfb9bd32f1879248.zip llvm-7dfdca1961aadc75ca397818bfb9bd32f1879248.tar.gz llvm-7dfdca1961aadc75ca397818bfb9bd32f1879248.tar.bz2 |
[clang][test] add TestLanguage.def to specify all tested language versions (#94243)
Adds a def file to have a single location where tested language versions
are specified. Removes the need to update multiple locations in the
testing infrastructure to add a new language version to be tested. Test
instatiation can now include all languages without needing to specify
them.
This patch also adds pretty printing for instantiated test names. That
means, that a test instantiated with C++23 will have the name
`...TestSuite/TestName/CXX23` instead ending with some number (index of
the argument for instantiation of the test), which provides a better
experience when encountering a test failure with a specific language
version. The suffix will also contain an `_win` if the target contains
`win`.
---------
Co-authored-by: Sirraide <aeternalmail@gmail.com>
Diffstat (limited to 'clang/unittests/Tooling/Syntax/TreeTest.cpp')
-rw-r--r-- | clang/unittests/Tooling/Syntax/TreeTest.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/unittests/Tooling/Syntax/TreeTest.cpp b/clang/unittests/Tooling/Syntax/TreeTest.cpp index 44cf42f..b553f70 100644 --- a/clang/unittests/Tooling/Syntax/TreeTest.cpp +++ b/clang/unittests/Tooling/Syntax/TreeTest.cpp @@ -103,8 +103,11 @@ protected: } }; -INSTANTIATE_TEST_SUITE_P(TreeTests, TreeTest, - ::testing::ValuesIn(allTestClangConfigs()) ); +INSTANTIATE_TEST_SUITE_P( + TreeTests, TreeTest, ::testing::ValuesIn(allTestClangConfigs()), + [](const testing::TestParamInfo<TestClangConfig> &Info) { + return Info.param.toShortString(); + }); TEST_P(TreeTest, FirstLeaf) { buildTree("", GetParam()); @@ -221,8 +224,11 @@ protected: } }; -INSTANTIATE_TEST_SUITE_P(TreeTests, ListTest, - ::testing::ValuesIn(allTestClangConfigs()) ); +INSTANTIATE_TEST_SUITE_P( + TreeTests, ListTest, ::testing::ValuesIn(allTestClangConfigs()), + [](const testing::TestParamInfo<TestClangConfig> &Info) { + return Info.param.toShortString(); + }); /// "a, b, c" <=> [("a", ","), ("b", ","), ("c", null)] TEST_P(ListTest, List_Separated_WellFormed) { |