diff --git a/clang/unittests/AST/Language.h b/clang/include/clang/Testing/CommandLineArgs.h rename from clang/unittests/AST/Language.h rename to clang/include/clang/Testing/CommandLineArgs.h --- a/clang/unittests/AST/Language.h +++ b/clang/include/clang/Testing/CommandLineArgs.h @@ -1,4 +1,4 @@ -//===------ unittest/AST/Language.h - AST unit test support ---------------===// +//===--- CommandLineArgs.h ------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,15 +6,15 @@ // //===----------------------------------------------------------------------===// // -// This file defines language options for AST unittests. +// This file defines language options for Clang unittests. // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_UNITTESTS_AST_LANGUAGE_H -#define LLVM_CLANG_UNITTESTS_AST_LANGUAGE_H +#ifndef LLVM_CLANG_TESTING_COMMANDLINEARGS_H +#define LLVM_CLANG_TESTING_COMMANDLINEARGS_H -#include #include +#include namespace clang { diff --git a/clang/include/clang/module.modulemap b/clang/include/clang/module.modulemap --- a/clang/include/clang/module.modulemap +++ b/clang/include/clang/module.modulemap @@ -152,6 +152,12 @@ module * { export * } } +module Clang_Testing { + requires cplusplus + umbrella "Testing" + module * { export * } +} + module Clang_Tooling { requires cplusplus umbrella "Tooling" module * { export * } // FIXME: Exclude these headers to avoid pulling all of the AST matchers diff --git a/clang/lib/CMakeLists.txt b/clang/lib/CMakeLists.txt --- a/clang/lib/CMakeLists.txt +++ b/clang/lib/CMakeLists.txt @@ -24,3 +24,4 @@ add_subdirectory(StaticAnalyzer) endif() add_subdirectory(Format) +add_subdirectory(Testing) diff --git a/clang/lib/Testing/CMakeLists.txt b/clang/lib/Testing/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/clang/lib/Testing/CMakeLists.txt @@ -0,0 +1,7 @@ +set(LLVM_LINK_COMPONENTS + Support + ) + +add_clang_library(clangTesting + CommandLineArgs.cpp + ) diff --git a/clang/unittests/AST/Language.cpp b/clang/lib/Testing/CommandLineArgs.cpp rename from clang/unittests/AST/Language.cpp rename to clang/lib/Testing/CommandLineArgs.cpp --- a/clang/unittests/AST/Language.cpp +++ b/clang/lib/Testing/CommandLineArgs.cpp @@ -1,16 +1,12 @@ -//===------ unittest/AST/Language.cpp - AST unit test support -------------===// +//===--- CommandLineArgs.cpp ----------------------------------------------===// // // 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 // //===----------------------------------------------------------------------===// -// -// This file defines language options for AST unittests. -// -//===----------------------------------------------------------------------===// -#include "Language.h" +#include "clang/Testing/CommandLineArgs.h" #include "llvm/Support/ErrorHandling.h" namespace clang { diff --git a/clang/unittests/AST/ASTImporterFixtures.h b/clang/unittests/AST/ASTImporterFixtures.h --- a/clang/unittests/AST/ASTImporterFixtures.h +++ b/clang/unittests/AST/ASTImporterFixtures.h @@ -19,11 +19,11 @@ #include "clang/AST/ASTImporter.h" #include "clang/AST/ASTImporterSharedState.h" #include "clang/Frontend/ASTUnit.h" +#include "clang/Testing/CommandLineArgs.h" #include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.h" #include "DeclMatcher.h" -#include "Language.h" #include diff --git a/clang/unittests/AST/CMakeLists.txt b/clang/unittests/AST/CMakeLists.txt --- a/clang/unittests/AST/CMakeLists.txt +++ b/clang/unittests/AST/CMakeLists.txt @@ -26,7 +26,6 @@ DeclTest.cpp EvaluateAsRValueTest.cpp ExternalASTSourceTest.cpp - Language.cpp NamedDeclPrinterTest.cpp RecursiveASTVisitorTest.cpp SizelessTypesTest.cpp @@ -42,6 +41,7 @@ clangBasic clangFrontend clangSerialization + clangTesting clangTooling ) diff --git a/clang/unittests/AST/MatchVerifier.h b/clang/unittests/AST/MatchVerifier.h --- a/clang/unittests/AST/MatchVerifier.h +++ b/clang/unittests/AST/MatchVerifier.h @@ -21,8 +21,8 @@ #include "clang/AST/ASTContext.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/Testing/CommandLineArgs.h" #include "clang/Tooling/Tooling.h" -#include "Language.h" #include "gtest/gtest.h" namespace clang { diff --git a/clang/unittests/AST/StructuralEquivalenceTest.cpp b/clang/unittests/AST/StructuralEquivalenceTest.cpp --- a/clang/unittests/AST/StructuralEquivalenceTest.cpp +++ b/clang/unittests/AST/StructuralEquivalenceTest.cpp @@ -2,10 +2,10 @@ #include "clang/AST/ASTStructuralEquivalence.h" #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Frontend/ASTUnit.h" +#include "clang/Testing/CommandLineArgs.h" #include "clang/Tooling/Tooling.h" #include "llvm/Support/Host.h" -#include "Language.h" #include "DeclMatcher.h" #include "gtest/gtest.h"