diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index d32541941..2517ea31d 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -5,7 +5,7 @@ on: paths: - '**.h' - '**.cpp' - + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true diff --git a/unittests/CppInterOp/FunctionReflectionTest.cpp b/unittests/CppInterOp/FunctionReflectionTest.cpp index 745740502..d0b38c3d2 100644 --- a/unittests/CppInterOp/FunctionReflectionTest.cpp +++ b/unittests/CppInterOp/FunctionReflectionTest.cpp @@ -518,8 +518,11 @@ TEST(FunctionReflectionTest, IsStaticMethod) { EXPECT_TRUE(Cpp::IsStaticMethod(SubDecls[2])); } -#if !(__clang__ && __APPLE__) +#ifdef __APPLE__ +TEST(FunctionReflectionTest, DISABLED_GetFunctionAddress) { +#else TEST(FunctionReflectionTest, GetFunctionAddress) { +#endif std::vector Decls, SubDecls; std::string code = "int f1(int i) { return i * i; }"; @@ -537,7 +540,6 @@ TEST(FunctionReflectionTest, GetFunctionAddress) { address << Cpp::GetFunctionAddress(Decls[0]); EXPECT_EQ(address.str(), output); } -#endif TEST(FunctionReflectionTest, IsVirtualMethod) { std::vector Decls, SubDecls; @@ -558,8 +560,11 @@ TEST(FunctionReflectionTest, IsVirtualMethod) { EXPECT_FALSE(Cpp::IsVirtualMethod(SubDecls[3])); // y() } -#if !(__clang__ && __APPLE__) +#ifdef __APPLE__ +TEST(FunctionReflectionTest, DISABLED_JitCallAdvanced) { +#else TEST(FunctionReflectionTest, JitCallAdvanced) { +#endif std::vector Decls; std::string code = R"( typedef struct _name { @@ -580,7 +585,11 @@ TEST(FunctionReflectionTest, JitCallAdvanced) { Cpp::Destruct(object, Decls[1]); } +#ifdef __APPLE__ +TEST(FunctionReflectionTest, DISABLED_GetFunctionCallWrapper) { +#else TEST(FunctionReflectionTest, GetFunctionCallWrapper) { +#endif std::vector Decls; std::string code = R"( int f1(int i) { return i * i; } @@ -661,7 +670,6 @@ TEST(FunctionReflectionTest, GetFunctionCallWrapper) { output = testing::internal::GetCapturedStdout(); EXPECT_EQ(output, "Dtor Called\n"); } -#endif TEST(FunctionReflectionTest, IsConstMethod) { std::vector Decls, SubDecls; @@ -716,8 +724,11 @@ TEST(FunctionReflectionTest, GetFunctionArgDefault) { EXPECT_EQ(Cpp::GetFunctionArgDefault(Decls[1], 2), "34126"); } -#if !(__clang__ && __APPLE__) +#ifdef __APPLE__ +TEST(FunctionReflectionTest, DISABLED_Construct) { +#else TEST(FunctionReflectionTest, Construct) { +#endif Cpp::CreateInterpreter(); Interp->declare(R"( @@ -751,7 +762,11 @@ TEST(FunctionReflectionTest, Construct) { EXPECT_EQ(output, "Constructor Executed"); } +#ifdef __APPLE__ +TEST(FunctionReflectionTest, DISABLED_Destruct) { +#else TEST(FunctionReflectionTest, Destruct) { +#endif Cpp::CreateInterpreter(); Interp->declare(R"( @@ -783,4 +798,3 @@ TEST(FunctionReflectionTest, Destruct) { output = testing::internal::GetCapturedStdout(); EXPECT_EQ(output, "Destructor Executed"); } -#endif diff --git a/unittests/CppInterOp/JitTest.cpp b/unittests/CppInterOp/JitTest.cpp index d679da35b..93edd04a9 100644 --- a/unittests/CppInterOp/JitTest.cpp +++ b/unittests/CppInterOp/JitTest.cpp @@ -11,8 +11,11 @@ static int printf_jit(const char* format, ...) { return 0; } -#if !(__clang__ && __APPLE__) +#ifdef __APPLE__ +TEST(JitTest, DISABLED_InsertOrReplaceJitSymbol) { +#else TEST(JitTest, InsertOrReplaceJitSymbol) { +#endif std::vector Decls; std::string code = R"( extern "C" int printf(const char*,...); @@ -31,7 +34,6 @@ TEST(JitTest, InsertOrReplaceJitSymbol) { Cpp::InsertOrReplaceJitSymbol("non_existent", (uint64_t)&printf_jit)); EXPECT_TRUE(Cpp::InsertOrReplaceJitSymbol("non_existent", 0)); } -#endif TEST(Streams, StreamRedirect) { // printf and etc are fine here. diff --git a/unittests/CppInterOp/ScopeReflectionTest.cpp b/unittests/CppInterOp/ScopeReflectionTest.cpp index a7114573b..3601e6b1e 100644 --- a/unittests/CppInterOp/ScopeReflectionTest.cpp +++ b/unittests/CppInterOp/ScopeReflectionTest.cpp @@ -97,8 +97,11 @@ TEST(ScopeReflectionTest, SizeOf) { EXPECT_EQ(Cpp::SizeOf(Decls[7]), (size_t)16); } -#if !(__clang__ && __APPLE__) +#ifdef __APPLE__ +TEST(ScopeReflectionTest, DISABLED_IsBuiltin) { +#else TEST(ScopeReflectionTest, IsBuiltin) { +#endif // static std::set g_builtins = // {"bool", "char", "signed char", "unsigned char", "wchar_t", "short", "unsigned short", // "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long", @@ -127,7 +130,6 @@ TEST(ScopeReflectionTest, IsBuiltin) { for (ClassTemplateSpecializationDecl *CTSD : CTD->specializations()) EXPECT_TRUE(Cpp::IsBuiltin(C.getTypeDeclType(CTSD).getAsOpaquePtr())); } -#endif TEST(ScopeReflectionTest, IsTemplate) { std::vector Decls; @@ -410,8 +412,11 @@ TEST(ScopeReflectionTest, GetScopefromCompleteName) { EXPECT_EQ(Cpp::GetQualifiedName(Cpp::GetScopeFromCompleteName("N1::N2::C::S")), "N1::N2::C::S"); } -#if !(__clang__ && __APPLE__) +#ifdef __APPLE__ +TEST(ScopeReflectionTest, DISABLED_GetNamed) { +#else TEST(ScopeReflectionTest, GetNamed) { +#endif std::string code = R"(namespace N1 { namespace N2 { class C { @@ -448,7 +453,6 @@ TEST(ScopeReflectionTest, GetNamed) { EXPECT_EQ(Cpp::GetQualifiedName(std_string_class), "std::string"); EXPECT_EQ(Cpp::GetQualifiedName(std_string_npos_var), "std::basic_string::npos"); } -#endif TEST(ScopeReflectionTest, GetParentScope) { std::string code = R"(namespace N1 { @@ -538,7 +542,6 @@ TEST(ScopeReflectionTest, GetNumBases) { EXPECT_EQ(Cpp::GetNumBases(Decls[5]), 0); } - TEST(ScopeReflectionTest, GetBaseClass) { std::vector Decls; std::string code = R"( @@ -708,8 +711,11 @@ TEST(ScopeReflectionTest, InstantiateNNTPClassTemplate) { /*type_size*/ args1.size())); } -#if !(__clang__ && __APPLE__) +#ifdef __APPLE__ +TEST(ScopeReflectionTest, DISABLED_InstantiateTemplateFunctionFromString) { +#else TEST(ScopeReflectionTest, InstantiateTemplateFunctionFromString) { +#endif Cpp::CreateInterpreter(); std::string code = R"(#include )"; Interp->process(code); @@ -717,7 +723,6 @@ TEST(ScopeReflectionTest, InstantiateTemplateFunctionFromString) { auto* Instance1 = (Decl*)Cpp::InstantiateTemplateFunctionFromString(str); EXPECT_TRUE(Instance1); } -#endif TEST(ScopeReflectionTest, InstantiateClassTemplate) { std::vector Decls; @@ -850,12 +855,14 @@ TEST(ScopeReflectionTest, GetClassTemplateInstantiationArgs) { EXPECT_TRUE(instance_types.size() == 0); } -#if !(__clang__ && __APPLE__) +#ifdef __APPLE__ +TEST(ScopeReflectionTest, DISABLED_IncludeVector) { +#else TEST(ScopeReflectionTest, IncludeVector) { +#endif std::string code = R"( #include #include )"; Interp->process(code); -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/unittests/CppInterOp/TypeReflectionTest.cpp b/unittests/CppInterOp/TypeReflectionTest.cpp index d5b931cae..61fb4af18 100644 --- a/unittests/CppInterOp/TypeReflectionTest.cpp +++ b/unittests/CppInterOp/TypeReflectionTest.cpp @@ -515,8 +515,11 @@ TEST(TypeReflectionTest, IsPODType) { EXPECT_FALSE(Cpp::IsPODType(0)); } -#if !(__clang__ && __APPLE__) +#ifdef __APPLE__ +TEST(TypeReflectionTest, DISABLED_IsSmartPtrType) { +#else TEST(TypeReflectionTest, IsSmartPtrType) { +#endif Cpp::CreateInterpreter(); Interp->declare(R"( @@ -552,5 +555,4 @@ TEST(TypeReflectionTest, IsSmartPtrType) { EXPECT_TRUE(Cpp::IsSmartPtrType(get_type_from_varname("smart_ptr6"))); EXPECT_FALSE(Cpp::IsSmartPtrType(get_type_from_varname("raw_ptr"))); EXPECT_FALSE(Cpp::IsSmartPtrType(get_type_from_varname("object"))); -} -#endif +} \ No newline at end of file