Skip to content

Commit

Permalink
Use valgrind's macro instead of LLVM's interface
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronj0 committed May 16, 2024
1 parent fa7ab10 commit 462a97b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
13 changes: 6 additions & 7 deletions unittests/CppInterOp/FunctionReflectionTest.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "Utils.h"

#include "llvm/Support/Valgrind.h"
#include "clang/AST/ASTContext.h"
#include "clang/Interpreter/CppInterOp.h"
#include "clang/Frontend/CompilerInstance.h"
Expand Down Expand Up @@ -532,7 +531,7 @@ TEST(FunctionReflectionTest, ExistsFunctionTemplate) {
}

TEST(FunctionReflectionTest, InstantiateTemplateFunctionFromString) {
if (llvm::sys::RunningOnValgrind())
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
Cpp::CreateInterpreter();
std::string code = R"(#include <memory>)";
Expand Down Expand Up @@ -735,7 +734,7 @@ TEST(FunctionReflectionTest, IsStaticMethod) {
}

TEST(FunctionReflectionTest, GetFunctionAddress) {
if (llvm::sys::RunningOnValgrind())
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
std::vector<Decl*> Decls, SubDecls;
std::string code = "int f1(int i) { return i * i; }";
Expand Down Expand Up @@ -776,7 +775,7 @@ TEST(FunctionReflectionTest, IsVirtualMethod) {
}

TEST(FunctionReflectionTest, JitCallAdvanced) {
if (llvm::sys::RunningOnValgrind())
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
std::vector<Decl*> Decls;
std::string code = R"(
Expand All @@ -800,7 +799,7 @@ TEST(FunctionReflectionTest, JitCallAdvanced) {


TEST(FunctionReflectionTest, GetFunctionCallWrapper) {
if (llvm::sys::RunningOnValgrind())
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
std::vector<Decl*> Decls;
std::string code = R"(
Expand Down Expand Up @@ -1011,7 +1010,7 @@ TEST(FunctionReflectionTest, GetFunctionArgDefault) {
}

TEST(FunctionReflectionTest, Construct) {
if (llvm::sys::RunningOnValgrind())
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
Cpp::CreateInterpreter();

Expand Down Expand Up @@ -1047,7 +1046,7 @@ TEST(FunctionReflectionTest, Construct) {
}

TEST(FunctionReflectionTest, Destruct) {
if (llvm::sys::RunningOnValgrind())
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
Cpp::CreateInterpreter();

Expand Down
9 changes: 5 additions & 4 deletions unittests/CppInterOp/InterpreterTest.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include "clang/Interpreter/CppInterOp.h"
#include "Utils.h"

#include "clang/Interpreter/CppInterOp.h"
#include "clang/Basic/Version.h"

#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Valgrind.h"

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

Expand Down Expand Up @@ -44,7 +45,7 @@ TEST(InterpreterTest, DebugFlag) {
}

TEST(InterpreterTest, Evaluate) {
if (llvm::sys::RunningOnValgrind())
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
// EXPECT_TRUE(Cpp::Evaluate(I, "") == 0);
//EXPECT_TRUE(Cpp::Evaluate(I, "__cplusplus;") == 201402);
Expand All @@ -60,7 +61,7 @@ TEST(InterpreterTest, Evaluate) {
}

TEST(InterpreterTest, Process) {
if (llvm::sys::RunningOnValgrind())
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
Cpp::CreateInterpreter();
EXPECT_TRUE(Cpp::Process("") == 0);
Expand Down
3 changes: 1 addition & 2 deletions unittests/CppInterOp/JitTest.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "Utils.h"

#include "clang/Interpreter/CppInterOp.h"
#include "llvm/Support/Valgrind.h"

#include "gtest/gtest.h"

Expand All @@ -13,7 +12,7 @@ static int printf_jit(const char* format, ...) {
}

TEST(JitTest, InsertOrReplaceJitSymbol) {
if (llvm::sys::RunningOnValgrind())
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
std::vector<Decl*> Decls;
std::string code = R"(
Expand Down
7 changes: 4 additions & 3 deletions unittests/CppInterOp/ScopeReflectionTest.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "Utils.h"
#include "llvm/Support/Valgrind.h"

#include "clang/Interpreter/CppInterOp.h"

#include "clang/AST/ASTContext.h"
Expand Down Expand Up @@ -800,7 +800,7 @@ template<typename T> T TrivialFnTemplate() { return T(); }
}

TEST(ScopeReflectionTest, InstantiateTemplateFunctionFromString) {
if (llvm::sys::RunningOnValgrind())
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
Cpp::CreateInterpreter();
std::string code = R"(#include <memory>)";
Expand Down Expand Up @@ -940,7 +940,8 @@ TEST(ScopeReflectionTest, GetClassTemplateInstantiationArgs) {


TEST(ScopeReflectionTest, IncludeVector) {
GTEST_SKIP() << "XFAIL due to Valgrind report";
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
std::string code = R"(
#include <vector>
#include <iostream>
Expand Down
3 changes: 1 addition & 2 deletions unittests/CppInterOp/TypeReflectionTest.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "Utils.h"

#include "llvm/Support/Valgrind.h"
#include "clang/AST/ASTContext.h"
#include "clang/Interpreter/CppInterOp.h"
#include "clang/Frontend/CompilerInstance.h"
Expand Down Expand Up @@ -524,7 +523,7 @@ TEST(TypeReflectionTest, IsPODType) {
}

TEST(TypeReflectionTest, IsSmartPtrType) {
if (llvm::sys::RunningOnValgrind())
if (RUNNING_ON_VALGRIND)
GTEST_SKIP() << "XFAIL due to Valgrind report";
Cpp::CreateInterpreter();

Expand Down
1 change: 1 addition & 0 deletions unittests/CppInterOp/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <memory>
#include <vector>
#include <valgrind/valgrind.h>

using namespace clang;
using namespace llvm;
Expand Down

0 comments on commit 462a97b

Please sign in to comment.