Fix the cmdLineInvalidExportMacro

The test was faulty positive because of invalid command line.
The input file name was missing there, so protoc was failing to
generate code, but didn't test the actual invalid EXPORT_MACRO name.

Pick-to: 6.8 6.9
Change-Id: Ib57235fb22c740dc30aec58076833c8f6de4a250
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
This commit is contained in:
Alexey Edelev 2025-03-17 22:27:30 +01:00
parent 2bc78bfb7d
commit 428e3d07b9
1 changed files with 6 additions and 3 deletions

View File

@ -252,9 +252,12 @@ void qtprotobufgenTest::cmdLineInvalidExportMacro()
QProcess process;
process.setWorkingDirectory(cmdLineGeneratedPath());
process.startCommand(ProtocPath + QString(" ") + PluginKey + QtprotobufgenPath + OptKey
+ exportMacroCmd + OutKey + outputDirectory.absolutePath() + IncludeKey
+ expectedResultPath() + "qtprotobufgen.proto" + allow_proto3_optional);
process.startCommand(ProtocPath + QString(" ") + PluginKey + QtprotobufgenPath
+ OptKey + exportMacroCmd
+ OutKey + outputDirectory.absolutePath()
+ IncludeKey + expectedResultPath() +
+ " " + expectedResultPath() + "/qtprotobufgen.proto"
+ allow_proto3_optional);
QVERIFY2(process.waitForStarted(), msgProcessStartFailed(process).constData());
if (!process.waitForFinished()) {
process.kill();