llvm/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp

//===-- CompileCommandsTests.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
//
//===----------------------------------------------------------------------===//

#include "CompileCommands.h"
#include "Config.h"
#include "TestFS.h"
#include "support/Context.h"

#include "clang/Testing/CommandLineArgs.h"
#include "clang/Tooling/ArgumentsAdjusters.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/TargetSelect.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"

namespace clang {
namespace clangd {
namespace {

_;
Contains;
ElementsAre;
HasSubstr;
Not;

// Sadly, CommandMangler::detect(), which contains much of the logic, is
// a bunch of untested integration glue. We test the string manipulation here
// assuming its results are correct.

// Make use of all features and assert the exact command we get out.
// Other tests just verify presence/absence of certain args.
TEST(CommandMangler, Everything) {}

TEST(CommandMangler, FilenameMismatch) {}

TEST(CommandMangler, ResourceDir) {}

TEST(CommandMangler, Sysroot) {}

TEST(CommandMangler, ClangPath) {}

// Only run the PATH/symlink resolving test on unix, we need to fiddle
// with permissions and environment variables...
#ifdef LLVM_ON_UNIX
MATCHER(ok, "") {}

TEST(CommandMangler, ClangPathResolve) {}
#endif

TEST(CommandMangler, ConfigEdits) {}

static std::string strip(llvm::StringRef Arg, llvm::StringRef Argv) {}

TEST(ArgStripperTest, Spellings) {}

TEST(ArgStripperTest, UnknownFlag) {}

TEST(ArgStripperTest, Xclang) {}

TEST(ArgStripperTest, ClangCL) {}

TEST(ArgStripperTest, ArgStyles) {}

TEST(ArgStripperTest, EndOfList) {}

TEST(ArgStripperTest, Multiple) {}

TEST(ArgStripperTest, Warning) {}

TEST(ArgStripperTest, Define) {}

TEST(ArgStripperTest, OrderDependent) {}

TEST(PrintArgvTest, All) {}

TEST(CommandMangler, InputsAfterDashDash) {}

TEST(CommandMangler, StripsMultipleArch) {}

TEST(CommandMangler, EmptyArgs) {}

TEST(CommandMangler, PathsAsPositional) {}

TEST(CommandMangler, RespectsOriginalResourceDir) {}

TEST(CommandMangler, RespectsOriginalSysroot) {}
} // namespace
} // namespace clangd
} // namespace clang