mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-29 11:17:28 +00:00
Move unittest helpers to a shared location
Summary: unittests/AST/Language.h defines some helpers that we would like to reuse in other tests, for example, in tests for syntax trees. Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, martong, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D80792
This commit is contained in:
parent
16506d7890
commit
0e265e3157
@ -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 <vector>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace clang {
|
||||
|
@ -152,6 +152,12 @@ module Clang_StaticAnalyzer_Frontend {
|
||||
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
|
||||
|
@ -24,3 +24,4 @@ if(CLANG_ENABLE_STATIC_ANALYZER)
|
||||
add_subdirectory(StaticAnalyzer)
|
||||
endif()
|
||||
add_subdirectory(Format)
|
||||
add_subdirectory(Testing)
|
||||
|
7
clang/lib/Testing/CMakeLists.txt
Normal file
7
clang/lib/Testing/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
set(LLVM_LINK_COMPONENTS
|
||||
Support
|
||||
)
|
||||
|
||||
add_clang_library(clangTesting
|
||||
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 {
|
@ -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 <sstream>
|
||||
|
||||
|
@ -26,7 +26,6 @@ add_clang_unittest(ASTTests
|
||||
DeclTest.cpp
|
||||
EvaluateAsRValueTest.cpp
|
||||
ExternalASTSourceTest.cpp
|
||||
Language.cpp
|
||||
NamedDeclPrinterTest.cpp
|
||||
RecursiveASTVisitorTest.cpp
|
||||
SizelessTypesTest.cpp
|
||||
@ -42,6 +41,7 @@ clang_target_link_libraries(ASTTests
|
||||
clangBasic
|
||||
clangFrontend
|
||||
clangSerialization
|
||||
clangTesting
|
||||
clangTooling
|
||||
)
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user