From 20df8c7db06f5dab97fa70e68bba5a1ec847ba85 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Tue, 1 Apr 2025 15:36:11 +0530 Subject: [PATCH 1/4] Fix Evaluate tests for emscripten build --- unittests/CppInterOp/InterpreterTest.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/unittests/CppInterOp/InterpreterTest.cpp b/unittests/CppInterOp/InterpreterTest.cpp index 71e1ca991..6c1c21b44 100644 --- a/unittests/CppInterOp/InterpreterTest.cpp +++ b/unittests/CppInterOp/InterpreterTest.cpp @@ -59,9 +59,6 @@ TEST(InterpreterTest, DebugFlag) { } TEST(InterpreterTest, Evaluate) { -#ifdef EMSCRIPTEN - GTEST_SKIP() << "Test fails for Emscipten builds"; -#endif #ifdef _WIN32 GTEST_SKIP() << "Disabled on Windows. Needs fixing."; #endif @@ -71,6 +68,7 @@ TEST(InterpreterTest, Evaluate) { //EXPECT_TRUE(Cpp::Evaluate(I, "__cplusplus;") == 201402); // Due to a deficiency in the clang-repl implementation to get the value we // always must omit the ; + Cpp::CreateInterpreter(); EXPECT_TRUE(Cpp::Evaluate("__cplusplus") == 201402); bool HadError; From a49d361c82646c0f7ad7c7e725839519735b4750 Mon Sep 17 00:00:00 2001 From: Anutosh Bhat Date: Tue, 1 Apr 2025 16:27:53 +0530 Subject: [PATCH 2/4] try with later version --- unittests/CppInterOp/InterpreterTest.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/unittests/CppInterOp/InterpreterTest.cpp b/unittests/CppInterOp/InterpreterTest.cpp index 6c1c21b44..fdc089563 100644 --- a/unittests/CppInterOp/InterpreterTest.cpp +++ b/unittests/CppInterOp/InterpreterTest.cpp @@ -68,8 +68,11 @@ TEST(InterpreterTest, Evaluate) { //EXPECT_TRUE(Cpp::Evaluate(I, "__cplusplus;") == 201402); // Due to a deficiency in the clang-repl implementation to get the value we // always must omit the ; - Cpp::CreateInterpreter(); - EXPECT_TRUE(Cpp::Evaluate("__cplusplus") == 201402); + std::vector Args = { + "-std=c++20" + }; + Cpp::CreateInterpreter(Args); + EXPECT_TRUE(Cpp::Evaluate("__cplusplus") == 202002); bool HadError; EXPECT_TRUE(Cpp::Evaluate("#error", &HadError) == (intptr_t)~0UL); From d863430b520a140b348b7bc03879371e163569d8 Mon Sep 17 00:00:00 2001 From: Anutosh Bhat Date: Tue, 1 Apr 2025 16:44:02 +0530 Subject: [PATCH 3/4] Reverting previous commit --- unittests/CppInterOp/InterpreterTest.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/unittests/CppInterOp/InterpreterTest.cpp b/unittests/CppInterOp/InterpreterTest.cpp index fdc089563..6c1c21b44 100644 --- a/unittests/CppInterOp/InterpreterTest.cpp +++ b/unittests/CppInterOp/InterpreterTest.cpp @@ -68,11 +68,8 @@ TEST(InterpreterTest, Evaluate) { //EXPECT_TRUE(Cpp::Evaluate(I, "__cplusplus;") == 201402); // Due to a deficiency in the clang-repl implementation to get the value we // always must omit the ; - std::vector Args = { - "-std=c++20" - }; - Cpp::CreateInterpreter(Args); - EXPECT_TRUE(Cpp::Evaluate("__cplusplus") == 202002); + Cpp::CreateInterpreter(); + EXPECT_TRUE(Cpp::Evaluate("__cplusplus") == 201402); bool HadError; EXPECT_TRUE(Cpp::Evaluate("#error", &HadError) == (intptr_t)~0UL); From 37fa8863e38513273b9215e2508b6ea195def065 Mon Sep 17 00:00:00 2001 From: Anutosh Bhat Date: Thu, 10 Apr 2025 15:00:58 +0530 Subject: [PATCH 4/4] Update CMakeLists.txt --- unittests/CppInterOp/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unittests/CppInterOp/CMakeLists.txt b/unittests/CppInterOp/CMakeLists.txt index 1665110cb..a52471578 100644 --- a/unittests/CppInterOp/CMakeLists.txt +++ b/unittests/CppInterOp/CMakeLists.txt @@ -10,9 +10,9 @@ else() endif() add_cppinterop_unittest(CppInterOpTests - EnumReflectionTest.cpp - FunctionReflectionTest.cpp InterpreterTest.cpp + FunctionReflectionTest.cpp + EnumReflectionTest.cpp JitTest.cpp ScopeReflectionTest.cpp TypeReflectionTest.cpp