Skip to content

Commit

Permalink
Perform check for clang binary before running resourcedir test
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronj0 authored and vgvassilev committed Feb 6, 2025
1 parent a901f57 commit 302fc67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions unittests/CppInterOp/InterpreterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Path.h"
#include <llvm/Support/FileSystem.h>

#include <gmock/gmock.h>
#include "gtest/gtest.h"
Expand Down Expand Up @@ -135,6 +136,10 @@ TEST(InterpreterTest, DISABLED_DetectResourceDir) {
EXPECT_STRNE(Cpp::DetectResourceDir().c_str(), Cpp::GetResourceDir());
llvm::SmallString<256> Clang(LLVM_BINARY_DIR);
llvm::sys::path::append(Clang, "bin", "clang");

if (!llvm::sys::fs::exists(llvm::Twine(Clang.str().str())))
GTEST_SKIP() << "Test not run (Clang binary does not exist)";

std::string DetectedPath = Cpp::DetectResourceDir(Clang.str().str().c_str());
EXPECT_STREQ(DetectedPath.c_str(), Cpp::GetResourceDir());
}
Expand Down

0 comments on commit 302fc67

Please # to comment.