From 1b6cda034fe805f3f9306b35737655631662e6dd Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 15 Mar 2024 20:40:28 +0000 Subject: [PATCH] Re-enable tests and disable only the failing ones. Fixes #191 --- .github/workflows/ci.yml | 1 - .../CppInterOp/DynamicLibraryManagerTest.cpp | 4 ++++ unittests/CppInterOp/FunctionReflectionTest.cpp | 17 ++++++++++++++++- unittests/CppInterOp/InterpreterTest.cpp | 12 ++++++++++-- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7c43a590..7c6bd037d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -684,7 +684,6 @@ jobs: echo "CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH" >> $GITHUB_ENV - name: Build and Test/Install CppInterOp on Windows systems - continue-on-error: true if: ${{ runner.os == 'windows' }} run: | #FIXME: Windows CppInterOp tests expected to fail diff --git a/unittests/CppInterOp/DynamicLibraryManagerTest.cpp b/unittests/CppInterOp/DynamicLibraryManagerTest.cpp index 01624ef78..c2ca1e8a3 100644 --- a/unittests/CppInterOp/DynamicLibraryManagerTest.cpp +++ b/unittests/CppInterOp/DynamicLibraryManagerTest.cpp @@ -17,7 +17,11 @@ std::string GetExecutablePath(const char* Argv0) { return llvm::sys::fs::getMainExecutable(Argv0, MainAddr); } +#ifdef _WIN32 +TEST(DynamicLibraryManagerTest, DISABLED_Sanity) { +#else TEST(DynamicLibraryManagerTest, Sanity) { +#endif // _WIN32 EXPECT_TRUE(Cpp::CreateInterpreter()); EXPECT_FALSE(Cpp::GetFunctionAddress("ret_zero")); diff --git a/unittests/CppInterOp/FunctionReflectionTest.cpp b/unittests/CppInterOp/FunctionReflectionTest.cpp index 3fcb3533f..7a71c19a7 100644 --- a/unittests/CppInterOp/FunctionReflectionTest.cpp +++ b/unittests/CppInterOp/FunctionReflectionTest.cpp @@ -553,7 +553,11 @@ TEST(FunctionReflectionTest, IsStaticMethod) { EXPECT_TRUE(Cpp::IsStaticMethod(SubDecls[2])); } +#ifdef _WIN32 +TEST(FunctionReflectionTest, DISABLED_GetFunctionAddress) { +#else TEST(FunctionReflectionTest, GetFunctionAddress) { +#endif // _WIN32 std::vector Decls, SubDecls; std::string code = "int f1(int i) { return i * i; }"; @@ -613,8 +617,11 @@ TEST(FunctionReflectionTest, JitCallAdvanced) { Cpp::Destruct(object, Decls[1]); } - +#ifdef _WIN32 +TEST(FunctionReflectionTest, DISABLED_GetFunctionCallWrapper) { +#else TEST(FunctionReflectionTest, GetFunctionCallWrapper) { +#endif // _WIN32 std::vector Decls; std::string code = R"( int f1(int i) { return i * i; } @@ -777,7 +784,11 @@ TEST(FunctionReflectionTest, GetFunctionArgDefault) { EXPECT_EQ(Cpp::GetFunctionArgDefault(Decls[1], 2), "34126"); } +#ifdef _WIN32 +TEST(FunctionReflectionTest, DISABLED_Construct) { +#else TEST(FunctionReflectionTest, Construct) { +#endif // _WIN32 Cpp::CreateInterpreter(); Interp->declare(R"( @@ -811,7 +822,11 @@ TEST(FunctionReflectionTest, Construct) { EXPECT_EQ(output, "Constructor Executed"); } +#ifdef _WIN32 +TEST(FunctionReflectionTest, DISABLED_Destruct) { +#else TEST(FunctionReflectionTest, Destruct) { +#endif // _WIN32 Cpp::CreateInterpreter(); Interp->declare(R"( diff --git a/unittests/CppInterOp/InterpreterTest.cpp b/unittests/CppInterOp/InterpreterTest.cpp index 19cc1bf11..82810a59d 100644 --- a/unittests/CppInterOp/InterpreterTest.cpp +++ b/unittests/CppInterOp/InterpreterTest.cpp @@ -53,7 +53,11 @@ TEST(InterpreterTest, Evaluate) { EXPECT_FALSE(HadError) ; } +#ifdef _WIN32 +TEST(InterpreterTest, DISABLED_Process) { +#else TEST(InterpreterTest, Process) { +#endif // _WIN32 Cpp::CreateInterpreter(); EXPECT_TRUE(Cpp::Process("") == 0); EXPECT_TRUE(Cpp::Process("int a = 12;") == 0); @@ -85,11 +89,11 @@ TEST(InterpreterTest, CreateInterpreter) { EXPECT_FALSE(Cpp::GetNamed("cppUnknown")); } -#ifdef LLVM_BINARY_DIR +#if defined(LLVM_BINARY_DIR) && !defined(_WIN32) TEST(InterpreterTest, DetectResourceDir) { #else TEST(InterpreterTest, DISABLED_DetectResourceDir) { -#endif // LLVM_BINARY_DIR +#endif // LLVM_BINARY_DIR || !_WIN32 Cpp::CreateInterpreter(); EXPECT_STRNE(Cpp::DetectResourceDir().c_str(), Cpp::GetResourceDir()); llvm::SmallString<256> Clang(LLVM_BINARY_DIR); @@ -98,7 +102,11 @@ TEST(InterpreterTest, DISABLED_DetectResourceDir) { EXPECT_STREQ(DetectedPath.c_str(), Cpp::GetResourceDir()); } +#ifdef _WIN32 +TEST(InterpreterTest, DISABLED_DetectSystemCompilerIncludePaths) { +#else TEST(InterpreterTest, DetectSystemCompilerIncludePaths) { +#endif // _WIN32 std::vector includes; Cpp::DetectSystemCompilerIncludePaths(includes); EXPECT_FALSE(includes.empty());