#include "../clang-tidy/utils/IncludeInserter.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Frontend/CompilerInstance.h"
#include "ClangTidyTest.h"
#include "gtest/gtest.h"
#if !defined(_WIN32)
namespace clang {
namespace tidy {
namespace {
class IncludeInserterCheckBase : public ClangTidyCheck { … };
class NonSystemHeaderInserterCheck : public IncludeInserterCheckBase { … };
class EarlyInAlphabetHeaderInserterCheck : public IncludeInserterCheckBase { … };
class MultipleHeaderInserterCheck : public IncludeInserterCheckBase { … };
class MultipleHeaderSingleInserterCheck : public IncludeInserterCheckBase { … };
class CSystemIncludeInserterCheck : public IncludeInserterCheckBase { … };
class CXXSystemIncludeInserterCheck : public IncludeInserterCheckBase { … };
class InvalidIncludeInserterCheck : public IncludeInserterCheckBase { … };
class ObjCEarlyInAlphabetHeaderInserterCheck : public IncludeInserterCheckBase { … };
class ObjCCategoryHeaderInserterCheck : public IncludeInserterCheckBase { … };
class ObjCGeneratedHeaderInserterCheck : public IncludeInserterCheckBase { … };
template <typename Check>
std::string runCheckOnCode(StringRef Code, StringRef Filename) { … }
TEST(IncludeInserterTest, InsertAfterLastNonSystemInclude) { … }
TEST(IncludeInserterTest, InsertMultipleIncludesAndDeduplicate) { … }
TEST(IncludeInserterTest, InsertMultipleIncludesNoDeduplicate) { … }
TEST(IncludeInserterTest, InsertBeforeFirstNonSystemInclude) { … }
TEST(IncludeInserterTest, InsertBetweenNonSystemIncludes) { … }
TEST(IncludeInserterTest, NonSystemIncludeAlreadyIncluded) { … }
TEST(IncludeInserterTest, InsertNonSystemIncludeAfterLastCXXSystemInclude) { … }
TEST(IncludeInserterTest, InsertNonSystemIncludeAfterMainFileInclude) { … }
TEST(IncludeInserterTest, InsertCXXSystemIncludeAfterLastCXXSystemInclude) { … }
TEST(IncludeInserterTest, InsertCXXSystemIncludeBeforeFirstCXXSystemInclude) { … }
TEST(IncludeInserterTest, InsertCXXSystemIncludeBetweenCXXSystemIncludes) { … }
TEST(IncludeInserterTest, InsertCXXSystemIncludeAfterMainFileInclude) { … }
TEST(IncludeInserterTest, InsertCXXSystemIncludeAfterCSystemInclude) { … }
TEST(IncludeInserterTest, InsertCXXSystemIncludeBeforeNonSystemInclude) { … }
TEST(IncludeInserterTest, InsertCSystemIncludeBeforeCXXSystemInclude) { … }
TEST(IncludeInserterTest, InsertIncludeIfThereWasNoneBefore) { … }
TEST(IncludeInserterTest, DontInsertDuplicateIncludeEvenIfMiscategorized) { … }
TEST(IncludeInserterTest, HandleOrderInSubdirectory) { … }
TEST(IncludeInserterTest, InvalidHeaderName) { … }
TEST(IncludeInserterTest, InsertHeaderObjectiveC) { … }
TEST(IncludeInserterTest, InsertCategoryHeaderObjectiveC) { … }
TEST(IncludeInserterTest, InsertGeneratedHeaderObjectiveC) { … }
}
}
}
#endif