-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang][test] add TestLanguage.def to specify all tested language ver…
…sions 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 improves 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`.
- Loading branch information
Showing
12 changed files
with
280 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
//===-- TestLanguage.def - Language Versions for Testing --------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef TESTLANGUAGE | ||
#error "TESTLANGUAGE must be defined before including this file" | ||
#endif | ||
|
||
#ifndef TESTLANGUAGE_C | ||
#define TESTLANGUAGE_C TESTLANGUAGE | ||
#endif | ||
|
||
#ifndef TESTLANGUAGE_CXX | ||
#define TESTLANGUAGE_CXX TESTLANGUAGE | ||
#endif | ||
|
||
TESTLANGUAGE_C(C, 89, c89, 0) | ||
TESTLANGUAGE_C(C, 99, c99, 1) | ||
TESTLANGUAGE_C(C, 11, c11, 2) | ||
TESTLANGUAGE_C(C, 17, c17, 3) | ||
TESTLANGUAGE_C(C, 23, c23, 4) | ||
|
||
// TESTLANGUAGE_CXX(CXX, 98, c++98, 0) | ||
TESTLANGUAGE_CXX(CXX, 03, c++03, 1) | ||
TESTLANGUAGE_CXX(CXX, 11, c++11, 2) | ||
TESTLANGUAGE_CXX(CXX, 14, c++14, 3) | ||
TESTLANGUAGE_CXX(CXX, 17, c++17, 4) | ||
TESTLANGUAGE_CXX(CXX, 20, c++20, 5) | ||
TESTLANGUAGE_CXX(CXX, 23, c++23, 6) | ||
TESTLANGUAGE_CXX(CXX, 26, c++26, 7) | ||
|
||
#undef TESTLANGUAGE_CXX | ||
#undef TESTLANGUAGE_C | ||
#undef TESTLANGUAGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.