ModuleCacheTest.cpp 868 B

12345678910111213141516171819202122232425262728
  1. //===- unittests/Driver/ModuleCacheTest.cpp -------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // Unit tests for the LLDB module cache API.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #include "clang/Driver/Driver.h"
  14. #include "gtest/gtest.h"
  15. using namespace clang;
  16. using namespace clang::driver;
  17. namespace {
  18. TEST(ModuleCacheTest, GetTargetAndMode) {
  19. SmallString<128> Buf;
  20. Driver::getDefaultModuleCachePath(Buf);
  21. StringRef Path = Buf;
  22. EXPECT_TRUE(Path.find("org.llvm.clang") != Path.npos);
  23. EXPECT_TRUE(Path.endswith("ModuleCache"));
  24. }
  25. } // end anonymous namespace.