Skip to content

Commit 302fc67

Browse files
aaronj0vgvassilev
authored andcommitted
Perform check for clang binary before running resourcedir test
1 parent a901f57 commit 302fc67

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

unittests/CppInterOp/InterpreterTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "llvm/ADT/SmallString.h"
1919
#include "llvm/Support/Path.h"
20+
#include <llvm/Support/FileSystem.h>
2021

2122
#include <gmock/gmock.h>
2223
#include "gtest/gtest.h"
@@ -135,6 +136,10 @@ TEST(InterpreterTest, DISABLED_DetectResourceDir) {
135136
EXPECT_STRNE(Cpp::DetectResourceDir().c_str(), Cpp::GetResourceDir());
136137
llvm::SmallString<256> Clang(LLVM_BINARY_DIR);
137138
llvm::sys::path::append(Clang, "bin", "clang");
139+
140+
if (!llvm::sys::fs::exists(llvm::Twine(Clang.str().str())))
141+
GTEST_SKIP() << "Test not run (Clang binary does not exist)";
142+
138143
std::string DetectedPath = Cpp::DetectResourceDir(Clang.str().str().c_str());
139144
EXPECT_STREQ(DetectedPath.c_str(), Cpp::GetResourceDir());
140145
}

0 commit comments

Comments
 (0)