diff --git a/tests/auto/grpcgen/tst_qtgrpcgen.cpp b/tests/auto/grpcgen/tst_qtgrpcgen.cpp index 87d9a30d..93153bdf 100644 --- a/tests/auto/grpcgen/tst_qtgrpcgen.cpp +++ b/tests/auto/grpcgen/tst_qtgrpcgen.cpp @@ -20,15 +20,10 @@ const QLatin1StringView grpcGenQtprotobufKey(" --plugin=protoc-gen-qtgrpc="); const QLatin1StringView optKey(" --qtgrpc_opt="); const QLatin1StringView outputKey(" --qtgrpc_out="); const QLatin1StringView includeKey(" -I"); -#if defined(PROTOC_EXECUTABLE) +#ifndef PROTOC_EXECUTABLE +# error PROTOC_EXECUTABLE definition must be set and point to the valid protoc executable +#endif const QLatin1StringView protocolBufferCompiler(XSTR(PROTOC_EXECUTABLE)); -#else -#if defined(Q_OS_WIN) -const QLatin1StringView protocolBufferCompiler("protoc.exe"); -#else -const QLatin1StringView protocolBufferCompiler("protoc"); -#endif -#endif #if defined(Q_OS_WIN) const QLatin1StringView qtgrpcgen("/qtgrpcgen.exe"); #else diff --git a/tests/auto/protobufgen/tst_qtprotobufgen.cpp b/tests/auto/protobufgen/tst_qtprotobufgen.cpp index 2ce8f1ae..ce25771c 100644 --- a/tests/auto/protobufgen/tst_qtprotobufgen.cpp +++ b/tests/auto/protobufgen/tst_qtprotobufgen.cpp @@ -25,15 +25,10 @@ const QLatin1StringView allow_proto3_optional(" --experimental_allow_proto3_opti #else const QLatin1StringView allow_proto3_optional(""); #endif // ALLOW_PROTO3_OPTIONAL -#if defined(PROTOC_EXECUTABLE) +#ifndef PROTOC_EXECUTABLE +# error PROTOC_EXECUTABLE definition must be set and point to the valid protoc executable +#endif const QLatin1StringView protocolBufferCompiler(XSTR(PROTOC_EXECUTABLE)); -#else -#if defined(Q_OS_WIN) -const QLatin1StringView protocolBufferCompiler("protoc.exe"); -#else -const QLatin1StringView protocolBufferCompiler("protoc"); -#endif -#endif #if defined(Q_OS_WIN) const QLatin1StringView qtprotobufgen("/qtprotobufgen.exe"); #else