ModuleCacheTest.cpp 896 B

123456789101112131415161718192021222324252627
  1. //===- unittests/Driver/ModuleCacheTest.cpp -------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // Unit tests for the LLDB module cache API.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #include "clang/Driver/Driver.h"
  13. #include "gtest/gtest.h"
  14. using namespace clang;
  15. using namespace clang::driver;
  16. namespace {
  17. TEST(ModuleCacheTest, GetTargetAndMode) {
  18. SmallString<128> Buf;
  19. Driver::getDefaultModuleCachePath(Buf);
  20. StringRef Path = Buf;
  21. EXPECT_TRUE(Path.find("org.llvm.clang") != Path.npos);
  22. EXPECT_TRUE(Path.endswith("ModuleCache"));
  23. }
  24. } // end anonymous namespace.