From ee739e19db1d30ed54431f578ee935a596fe94eb Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 11:03:51 +0530 Subject: [PATCH 01/16] added interpreter_args argument in GetAllTopLevelDecl --- lib/Interpreter/CppInterOpInterpreter.h | 2 -- unittests/CppInterOp/FunctionReflectionTest.cpp | 8 ++++++-- unittests/CppInterOp/Utils.cpp | 8 +++++--- unittests/CppInterOp/Utils.h | 10 ++++++---- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/lib/Interpreter/CppInterOpInterpreter.h b/lib/Interpreter/CppInterOpInterpreter.h index cdac4f768..01b6d9795 100644 --- a/lib/Interpreter/CppInterOpInterpreter.h +++ b/lib/Interpreter/CppInterOpInterpreter.h @@ -148,8 +148,6 @@ class Interpreter { llvm::InitializeAllAsmPrinters(); std::vector vargs(argv + 1, argv + argc); - vargs.push_back("-include"); - vargs.push_back("new"); inner = compat::createClangInterpreter(vargs); } diff --git a/unittests/CppInterOp/FunctionReflectionTest.cpp b/unittests/CppInterOp/FunctionReflectionTest.cpp index 606c30cda..9adbccb2e 100644 --- a/unittests/CppInterOp/FunctionReflectionTest.cpp +++ b/unittests/CppInterOp/FunctionReflectionTest.cpp @@ -1372,7 +1372,9 @@ TEST(FunctionReflectionTest, JitCallAdvanced) { } name; )"; - GetAllTopLevelDecls(code, Decls); + std::vector vargs = {"-include", "new"}; + + GetAllTopLevelDecls(code, Decls, false, vargs); auto *CtorD = (clang::CXXConstructorDecl*)Cpp::GetDefaultConstructor(Decls[0]); auto Ctor = Cpp::MakeFunctionCallable(CtorD); @@ -1410,6 +1412,8 @@ TEST(FunctionReflectionTest, GetFunctionCallWrapper) { int f1(int i) { return i * i; } )"; + std::vector interpreter_args = {"-include", "new"}; + GetAllTopLevelDecls(code, Decls); Interp->process(R"( @@ -1510,7 +1514,7 @@ TEST(FunctionReflectionTest, GetFunctionCallWrapper) { }; )"; - GetAllTopLevelDecls(code1, Decls1); + GetAllTopLevelDecls(code1, Decls1, false, interpreter_args); ASTContext& C = Interp->getCI()->getASTContext(); std::vector argument = {C.IntTy.getAsOpaquePtr()}; diff --git a/unittests/CppInterOp/Utils.cpp b/unittests/CppInterOp/Utils.cpp index ca7227b99..978800469 100644 --- a/unittests/CppInterOp/Utils.cpp +++ b/unittests/CppInterOp/Utils.cpp @@ -18,9 +18,11 @@ using namespace clang; using namespace llvm; -void TestUtils::GetAllTopLevelDecls(const std::string& code, std::vector& Decls, - bool filter_implicitGenerated /* = false */) { - Cpp::CreateInterpreter(); +void TestUtils::GetAllTopLevelDecls( + const std::string& code, std::vector& Decls, + bool filter_implicitGenerated /* = false */, + std::vector interpreter_args /* = {} */) { + Cpp::CreateInterpreter(interpreter_args); #ifdef CPPINTEROP_USE_CLING cling::Transaction *T = nullptr; Interp->declare(code, &T); diff --git a/unittests/CppInterOp/Utils.h b/unittests/CppInterOp/Utils.h index 180e209fe..674cae59b 100644 --- a/unittests/CppInterOp/Utils.h +++ b/unittests/CppInterOp/Utils.h @@ -17,10 +17,12 @@ namespace clang { } #define Interp (static_cast(Cpp::GetInterpreter())) namespace TestUtils { - void GetAllTopLevelDecls(const std::string& code, std::vector& Decls, - bool filter_implicitGenerated = false); - void GetAllSubDecls(clang::Decl *D, std::vector& SubDecls, - bool filter_implicitGenerated = false); +void GetAllTopLevelDecls(const std::string& code, + std::vector& Decls, + bool filter_implicitGenerated = false, + std::vector interpreter_args = {}); +void GetAllSubDecls(clang::Decl* D, std::vector& SubDecls, + bool filter_implicitGenerated = false); } // end namespace TestUtils const char* get_c_string(CXString string); From e913bc30f4258fc15805e63aa7faae236b03e354 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 11:08:17 +0530 Subject: [PATCH 02/16] variable name updation --- unittests/CppInterOp/FunctionReflectionTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unittests/CppInterOp/FunctionReflectionTest.cpp b/unittests/CppInterOp/FunctionReflectionTest.cpp index 9adbccb2e..b7d1e7d1a 100644 --- a/unittests/CppInterOp/FunctionReflectionTest.cpp +++ b/unittests/CppInterOp/FunctionReflectionTest.cpp @@ -1372,9 +1372,9 @@ TEST(FunctionReflectionTest, JitCallAdvanced) { } name; )"; - std::vector vargs = {"-include", "new"}; + std::vector interpreter_args = {"-include", "new"}; - GetAllTopLevelDecls(code, Decls, false, vargs); + GetAllTopLevelDecls(code, Decls, false, interpreter_args); auto *CtorD = (clang::CXXConstructorDecl*)Cpp::GetDefaultConstructor(Decls[0]); auto Ctor = Cpp::MakeFunctionCallable(CtorD); From de5e5bd2038f196b4dbf20145f5abe9f8fcd0cd2 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 11:24:17 +0530 Subject: [PATCH 03/16] clang-tidy changes --- unittests/CppInterOp/Utils.cpp | 1 + unittests/CppInterOp/Utils.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/unittests/CppInterOp/Utils.cpp b/unittests/CppInterOp/Utils.cpp index 978800469..7cd305f2c 100644 --- a/unittests/CppInterOp/Utils.cpp +++ b/unittests/CppInterOp/Utils.cpp @@ -14,6 +14,7 @@ #include #include +#include using namespace clang; using namespace llvm; diff --git a/unittests/CppInterOp/Utils.h b/unittests/CppInterOp/Utils.h index 674cae59b..78a58e956 100644 --- a/unittests/CppInterOp/Utils.h +++ b/unittests/CppInterOp/Utils.h @@ -5,6 +5,7 @@ #include "llvm/Support/Valgrind.h" #include +#include #include #include "clang-c/CXCppInterOp.h" #include "clang-c/CXString.h" @@ -20,7 +21,7 @@ namespace TestUtils { void GetAllTopLevelDecls(const std::string& code, std::vector& Decls, bool filter_implicitGenerated = false, - std::vector interpreter_args = {}); + const std::vector interpreter_args = {}); void GetAllSubDecls(clang::Decl* D, std::vector& SubDecls, bool filter_implicitGenerated = false); } // end namespace TestUtils From 658e6ed4df1c276ec38cf6a13eea787d7b408837 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 11:34:05 +0530 Subject: [PATCH 04/16] const-qualifiction in fxn def --- unittests/CppInterOp/Utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/CppInterOp/Utils.cpp b/unittests/CppInterOp/Utils.cpp index 7cd305f2c..db6939d10 100644 --- a/unittests/CppInterOp/Utils.cpp +++ b/unittests/CppInterOp/Utils.cpp @@ -22,7 +22,7 @@ using namespace llvm; void TestUtils::GetAllTopLevelDecls( const std::string& code, std::vector& Decls, bool filter_implicitGenerated /* = false */, - std::vector interpreter_args /* = {} */) { + const std::vector interpreter_args /* = {} */) { Cpp::CreateInterpreter(interpreter_args); #ifdef CPPINTEROP_USE_CLING cling::Transaction *T = nullptr; From 397c04dc7a93e3b2a587d7dc797bf90b6546a6fe Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 11:55:08 +0530 Subject: [PATCH 05/16] isBuiltin bug --- unittests/CppInterOp/ScopeReflectionTest.cpp | 4 +++- unittests/CppInterOp/Utils.cpp | 2 +- unittests/CppInterOp/Utils.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/unittests/CppInterOp/ScopeReflectionTest.cpp b/unittests/CppInterOp/ScopeReflectionTest.cpp index db441e124..d780dc880 100644 --- a/unittests/CppInterOp/ScopeReflectionTest.cpp +++ b/unittests/CppInterOp/ScopeReflectionTest.cpp @@ -168,7 +168,9 @@ TEST(ScopeReflectionTest, IsBuiltin) { // "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long", // "float", "double", "long double", "void"} - Cpp::CreateInterpreter(); + std::vector interpreter_args = { "-include", "new" }; + + Cpp::CreateInterpreter(interpreter_args); ASTContext &C = Interp->getCI()->getASTContext(); EXPECT_TRUE(Cpp::IsBuiltin(C.BoolTy.getAsOpaquePtr())); EXPECT_TRUE(Cpp::IsBuiltin(C.CharTy.getAsOpaquePtr())); diff --git a/unittests/CppInterOp/Utils.cpp b/unittests/CppInterOp/Utils.cpp index db6939d10..4daf18c35 100644 --- a/unittests/CppInterOp/Utils.cpp +++ b/unittests/CppInterOp/Utils.cpp @@ -22,7 +22,7 @@ using namespace llvm; void TestUtils::GetAllTopLevelDecls( const std::string& code, std::vector& Decls, bool filter_implicitGenerated /* = false */, - const std::vector interpreter_args /* = {} */) { + const std::vector& interpreter_args /* = {} */) { Cpp::CreateInterpreter(interpreter_args); #ifdef CPPINTEROP_USE_CLING cling::Transaction *T = nullptr; diff --git a/unittests/CppInterOp/Utils.h b/unittests/CppInterOp/Utils.h index 78a58e956..fb79ee804 100644 --- a/unittests/CppInterOp/Utils.h +++ b/unittests/CppInterOp/Utils.h @@ -21,7 +21,7 @@ namespace TestUtils { void GetAllTopLevelDecls(const std::string& code, std::vector& Decls, bool filter_implicitGenerated = false, - const std::vector interpreter_args = {}); + const std::vector& interpreter_args = {}); void GetAllSubDecls(clang::Decl* D, std::vector& SubDecls, bool filter_implicitGenerated = false); } // end namespace TestUtils From b67c44094fe944dfed7e84311282450a1d753a06 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 12:09:43 +0530 Subject: [PATCH 06/16] GetNamed fixed --- unittests/CppInterOp/ScopeReflectionTest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unittests/CppInterOp/ScopeReflectionTest.cpp b/unittests/CppInterOp/ScopeReflectionTest.cpp index d780dc880..06d2a8ca5 100644 --- a/unittests/CppInterOp/ScopeReflectionTest.cpp +++ b/unittests/CppInterOp/ScopeReflectionTest.cpp @@ -505,7 +505,10 @@ TEST(ScopeReflectionTest, GetNamed) { } } )"; - Cpp::CreateInterpreter(); + + std::vector interpreter_args = {"-include", "new"}; + + Cpp::CreateInterpreter(interpreter_args); Interp->declare(code); Cpp::TCppScope_t ns_N1 = Cpp::GetNamed("N1", nullptr); From 4346d97fd56cb39a3df2a2e63f1edc3a77742fd6 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 12:17:47 +0530 Subject: [PATCH 07/16] InstantiateTemplateFunctionFromString fixed --- unittests/CppInterOp/ScopeReflectionTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unittests/CppInterOp/ScopeReflectionTest.cpp b/unittests/CppInterOp/ScopeReflectionTest.cpp index 06d2a8ca5..b6a6ece63 100644 --- a/unittests/CppInterOp/ScopeReflectionTest.cpp +++ b/unittests/CppInterOp/ScopeReflectionTest.cpp @@ -885,7 +885,8 @@ template T TrivialFnTemplate() { return T(); } TEST(ScopeReflectionTest, InstantiateTemplateFunctionFromString) { if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; - Cpp::CreateInterpreter(); + std::vector interpreter_args = {"-include", "new"}; + Cpp::CreateInterpreter(interpreter_args); std::string code = R"(#include )"; Interp->process(code); const char* str = "std::make_unique"; From 96c2e962792a70a425cd1c1e82fade8f44281349 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 12:27:15 +0530 Subject: [PATCH 08/16] f --- .github/workflows/MacOS.yml | 2 -- .github/workflows/Ubuntu-arm.yml | 2 -- .github/workflows/Ubuntu.yml | 2 -- .github/workflows/Windows.yml | 2 -- .github/workflows/clang-format.yml | 6 ------ .github/workflows/clang-tidy-review-post.yml | 6 ------ .github/workflows/clang-tidy-review.yml | 6 ------ .github/workflows/deploy-pages.yml | 8 -------- .github/workflows/emscripten.yml | 2 -- .github/workflows/markdown-linter.yml | 6 ------ unittests/CppInterOp/ScopeReflectionTest.cpp | 2 ++ 11 files changed, 2 insertions(+), 42 deletions(-) diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml index ea84aa1a7..31ab321e6 100644 --- a/.github/workflows/MacOS.yml +++ b/.github/workflows/MacOS.yml @@ -1,8 +1,6 @@ name: OSX-x86 on: - pull_request: - branches: [main] push: branches: [main] release: diff --git a/.github/workflows/Ubuntu-arm.yml b/.github/workflows/Ubuntu-arm.yml index a341cc465..26a38e54c 100644 --- a/.github/workflows/Ubuntu-arm.yml +++ b/.github/workflows/Ubuntu-arm.yml @@ -1,8 +1,6 @@ name: Ubuntu-arm on: - pull_request: - branches: [main] push: branches: [main] release: diff --git a/.github/workflows/Ubuntu.yml b/.github/workflows/Ubuntu.yml index b7ae47c58..3e4978f2a 100644 --- a/.github/workflows/Ubuntu.yml +++ b/.github/workflows/Ubuntu.yml @@ -1,8 +1,6 @@ name: Ubuntu-x86 on: - pull_request: - branches: [main] push: branches: [main] release: diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index addb6e060..869c8016d 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -1,7 +1,5 @@ name: Windows on: - pull_request: - branches: [main] push: branches: [main] release: diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 95e34354a..e357a55ee 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,11 +1,5 @@ name: clang-format -on: - pull_request: - paths: - - '**.h' - - '**.cpp' - concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true diff --git a/.github/workflows/clang-tidy-review-post.yml b/.github/workflows/clang-tidy-review-post.yml index f1aecb0d4..fabe2c86b 100644 --- a/.github/workflows/clang-tidy-review-post.yml +++ b/.github/workflows/clang-tidy-review-post.yml @@ -1,11 +1,5 @@ name: Post clang-tidy review comments -on: - workflow_run: - workflows: ["clang-tidy-review"] - types: - - completed - permissions: checks: write pull-requests: write diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index 825983a05..f6efb44b3 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -1,11 +1,5 @@ name: clang-tidy-review -on: - pull_request: - paths: - - '**.h' - - '**.cpp' - concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index fb4d9f1fb..6cb103f96 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -1,13 +1,5 @@ name: Build and Deploy -on: - workflow_dispatch: - push: - branches: - - main - schedule: - - cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00 - permissions: contents: read pages: write diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index 6fdf75197..8dc2e0247 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -1,7 +1,5 @@ name: Emscripten on: - pull_request: - branches: [main] push: branches: [main] release: diff --git a/.github/workflows/markdown-linter.yml b/.github/workflows/markdown-linter.yml index 539f8845d..4036588ae 100644 --- a/.github/workflows/markdown-linter.yml +++ b/.github/workflows/markdown-linter.yml @@ -1,12 +1,6 @@ --- name: Markdown-Linter -on: - pull_request: - branches: [main] - paths: - - '**.md' - concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true diff --git a/unittests/CppInterOp/ScopeReflectionTest.cpp b/unittests/CppInterOp/ScopeReflectionTest.cpp index b6a6ece63..1d18575f0 100644 --- a/unittests/CppInterOp/ScopeReflectionTest.cpp +++ b/unittests/CppInterOp/ScopeReflectionTest.cpp @@ -1030,6 +1030,8 @@ TEST(ScopeReflectionTest, IncludeVector) { #include #include )"; + std::vector interpreter_args = {"-include", "new"}; + Cpp::CreateInterpreter(interpreter_args); Interp->declare(code); } From 22ff87e53f3cc9aff3e6ef619104e6c3ff081cab Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 12:34:46 +0530 Subject: [PATCH 09/16] g --- unittests/CppInterOp/FunctionReflectionTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unittests/CppInterOp/FunctionReflectionTest.cpp b/unittests/CppInterOp/FunctionReflectionTest.cpp index b7d1e7d1a..23488988d 100644 --- a/unittests/CppInterOp/FunctionReflectionTest.cpp +++ b/unittests/CppInterOp/FunctionReflectionTest.cpp @@ -637,7 +637,8 @@ TEST(FunctionReflectionTest, ExistsFunctionTemplate) { TEST(FunctionReflectionTest, InstantiateTemplateFunctionFromString) { if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; - Cpp::CreateInterpreter(); + std::vector interpreter_args = { "-include", "new" }; + Cpp::CreateInterpreter(interpreter_args); std::string code = R"(#include )"; Interp->process(code); const char* str = "std::make_unique"; From 3d71f8ca77c94a366d2a2bc1410c0b2354da9635 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 12:42:39 +0530 Subject: [PATCH 10/16] g --- unittests/CppInterOp/FunctionReflectionTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unittests/CppInterOp/FunctionReflectionTest.cpp b/unittests/CppInterOp/FunctionReflectionTest.cpp index 23488988d..22a153809 100644 --- a/unittests/CppInterOp/FunctionReflectionTest.cpp +++ b/unittests/CppInterOp/FunctionReflectionTest.cpp @@ -1323,8 +1323,9 @@ TEST(FunctionReflectionTest, GetFunctionAddress) { #endif std::vector Decls, SubDecls; std::string code = "int f1(int i) { return i * i; }"; + std::vector interpreter_args = {"-include", "new"}; - GetAllTopLevelDecls(code, Decls); + GetAllTopLevelDecls(code, Decls, false, interpreter_args); testing::internal::CaptureStdout(); Interp->declare("#include "); From 1dd85a764a5606b69f5a4f3319b83e2bd69be12e Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 12:49:13 +0530 Subject: [PATCH 11/16] g --- unittests/CppInterOp/FunctionReflectionTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/CppInterOp/FunctionReflectionTest.cpp b/unittests/CppInterOp/FunctionReflectionTest.cpp index 22a153809..6e99c3be1 100644 --- a/unittests/CppInterOp/FunctionReflectionTest.cpp +++ b/unittests/CppInterOp/FunctionReflectionTest.cpp @@ -1416,7 +1416,7 @@ TEST(FunctionReflectionTest, GetFunctionCallWrapper) { std::vector interpreter_args = {"-include", "new"}; - GetAllTopLevelDecls(code, Decls); + GetAllTopLevelDecls(code, Decls, false, interpreter_args); Interp->process(R"( #include From 1bf093c9eabc0d54fd044547e30f58c2c62be552 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 12:56:36 +0530 Subject: [PATCH 12/16] h --- unittests/CppInterOp/FunctionReflectionTest.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/unittests/CppInterOp/FunctionReflectionTest.cpp b/unittests/CppInterOp/FunctionReflectionTest.cpp index 6e99c3be1..b01b30397 100644 --- a/unittests/CppInterOp/FunctionReflectionTest.cpp +++ b/unittests/CppInterOp/FunctionReflectionTest.cpp @@ -1721,8 +1721,8 @@ TEST(FunctionReflectionTest, Construct) { #ifdef _WIN32 GTEST_SKIP() << "Disabled on Windows. Needs fixing."; #endif - - Cpp::CreateInterpreter(); + std::vector interpreter_args = {"-include", "new"}; + Cpp::CreateInterpreter(interpreter_args); Interp->declare(R"( #include @@ -1783,7 +1783,8 @@ TEST(FunctionReflectionTest, ConstructNested) { GTEST_SKIP() << "Disabled on Windows. Needs fixing."; #endif - Cpp::CreateInterpreter(); + std::vector interpreter_args = {"-include", "new"}; + Cpp::CreateInterpreter(interpreter_args); Interp->declare(R"( #include @@ -1843,7 +1844,8 @@ TEST(FunctionReflectionTest, Destruct) { GTEST_SKIP() << "Disabled on Windows. Needs fixing."; #endif - Cpp::CreateInterpreter(); + std::vector interpreter_args = {"-include", "new"}; + Cpp::CreateInterpreter(interpreter_args); Interp->declare(R"( #include From 9808f814b6a899e10a133a7247f641fda26125b3 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 13:04:52 +0530 Subject: [PATCH 13/16] h --- unittests/CppInterOp/InterpreterTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unittests/CppInterOp/InterpreterTest.cpp b/unittests/CppInterOp/InterpreterTest.cpp index 55cd3f742..71e1ca991 100644 --- a/unittests/CppInterOp/InterpreterTest.cpp +++ b/unittests/CppInterOp/InterpreterTest.cpp @@ -86,7 +86,8 @@ TEST(InterpreterTest, Process) { #endif if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; - auto* I = Cpp::CreateInterpreter(); + std::vector interpreter_args = { "-include", "new" }; + auto* I = Cpp::CreateInterpreter(interpreter_args); EXPECT_TRUE(Cpp::Process("") == 0); EXPECT_TRUE(Cpp::Process("int a = 12;") == 0); EXPECT_FALSE(Cpp::Process("error_here;") == 0); From 6a9743f96d9c79db507d0fb41b4e5af1c6baf56a Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 13:11:46 +0530 Subject: [PATCH 14/16] h --- unittests/CppInterOp/TypeReflectionTest.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/unittests/CppInterOp/TypeReflectionTest.cpp b/unittests/CppInterOp/TypeReflectionTest.cpp index 7d5dafcc2..37d884839 100644 --- a/unittests/CppInterOp/TypeReflectionTest.cpp +++ b/unittests/CppInterOp/TypeReflectionTest.cpp @@ -550,7 +550,9 @@ TEST(TypeReflectionTest, IsPODType) { TEST(TypeReflectionTest, IsSmartPtrType) { if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; - Cpp::CreateInterpreter(); + + std::vector interpreter_args = {"-include", "new"}; + Cpp::CreateInterpreter(interpreter_args); Interp->declare(R"( #include @@ -588,7 +590,8 @@ TEST(TypeReflectionTest, IsSmartPtrType) { } TEST(TypeReflectionTest, IsFunctionPointerType) { - Cpp::CreateInterpreter(); + std::vector interpreter_args = {"-include", "new"}; + Cpp::CreateInterpreter(interpreter_args); Interp->declare(R"( typedef int (*int_func)(int, int); From cab9b09ec06373f220b099787acb3263c65497c7 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 13:19:05 +0530 Subject: [PATCH 15/16] h --- unittests/CppInterOp/VariableReflectionTest.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unittests/CppInterOp/VariableReflectionTest.cpp b/unittests/CppInterOp/VariableReflectionTest.cpp index 0d8376f4d..11ede7a5c 100644 --- a/unittests/CppInterOp/VariableReflectionTest.cpp +++ b/unittests/CppInterOp/VariableReflectionTest.cpp @@ -334,6 +334,9 @@ TEST(VariableReflectionTest, VariableOffsetsWithInheritance) { if (llvm::sys::RunningOnValgrind()) GTEST_SKIP() << "XFAIL due to Valgrind report"; + std::vector interpreter_args = {"-include", "string"}; + Cpp::CreateInterpreter(interpreter_args); + Cpp::Declare("#include"); #define Stringify(s) Stringifyx(s) From c82515448299417cd7cc7086ec6aafb468346749 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Mon, 14 Apr 2025 14:26:13 +0530 Subject: [PATCH 16/16] done --- .github/workflows/MacOS.yml | 2 ++ .github/workflows/Ubuntu-arm.yml | 2 ++ .github/workflows/Ubuntu.yml | 2 ++ .github/workflows/Windows.yml | 2 ++ .github/workflows/clang-format.yml | 6 ++++++ .github/workflows/clang-tidy-review-post.yml | 6 ++++++ .github/workflows/clang-tidy-review.yml | 6 ++++++ .github/workflows/deploy-pages.yml | 8 ++++++++ .github/workflows/emscripten.yml | 2 ++ .github/workflows/markdown-linter.yml | 6 ++++++ 10 files changed, 42 insertions(+) diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml index 31ab321e6..ea84aa1a7 100644 --- a/.github/workflows/MacOS.yml +++ b/.github/workflows/MacOS.yml @@ -1,6 +1,8 @@ name: OSX-x86 on: + pull_request: + branches: [main] push: branches: [main] release: diff --git a/.github/workflows/Ubuntu-arm.yml b/.github/workflows/Ubuntu-arm.yml index 26a38e54c..a341cc465 100644 --- a/.github/workflows/Ubuntu-arm.yml +++ b/.github/workflows/Ubuntu-arm.yml @@ -1,6 +1,8 @@ name: Ubuntu-arm on: + pull_request: + branches: [main] push: branches: [main] release: diff --git a/.github/workflows/Ubuntu.yml b/.github/workflows/Ubuntu.yml index 3e4978f2a..b7ae47c58 100644 --- a/.github/workflows/Ubuntu.yml +++ b/.github/workflows/Ubuntu.yml @@ -1,6 +1,8 @@ name: Ubuntu-x86 on: + pull_request: + branches: [main] push: branches: [main] release: diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 869c8016d..addb6e060 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -1,5 +1,7 @@ name: Windows on: + pull_request: + branches: [main] push: branches: [main] release: diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index e357a55ee..95e34354a 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,5 +1,11 @@ name: clang-format +on: + pull_request: + paths: + - '**.h' + - '**.cpp' + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true diff --git a/.github/workflows/clang-tidy-review-post.yml b/.github/workflows/clang-tidy-review-post.yml index fabe2c86b..f1aecb0d4 100644 --- a/.github/workflows/clang-tidy-review-post.yml +++ b/.github/workflows/clang-tidy-review-post.yml @@ -1,5 +1,11 @@ name: Post clang-tidy review comments +on: + workflow_run: + workflows: ["clang-tidy-review"] + types: + - completed + permissions: checks: write pull-requests: write diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index f6efb44b3..825983a05 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -1,5 +1,11 @@ name: clang-tidy-review +on: + pull_request: + paths: + - '**.h' + - '**.cpp' + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 6cb103f96..fb4d9f1fb 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -1,5 +1,13 @@ name: Build and Deploy +on: + workflow_dispatch: + push: + branches: + - main + schedule: + - cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00 + permissions: contents: read pages: write diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index 8dc2e0247..6fdf75197 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -1,5 +1,7 @@ name: Emscripten on: + pull_request: + branches: [main] push: branches: [main] release: diff --git a/.github/workflows/markdown-linter.yml b/.github/workflows/markdown-linter.yml index 4036588ae..539f8845d 100644 --- a/.github/workflows/markdown-linter.yml +++ b/.github/workflows/markdown-linter.yml @@ -1,6 +1,12 @@ --- name: Markdown-Linter +on: + pull_request: + branches: [main] + paths: + - '**.md' + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true