Skip to content

Commit bbcfa06

Browse files
committed
issue #10866 Exiting with exit code 1, no warnings, no errors when executed on Github Action
Giving a message together with the "Exiting..." text with reference to the warnings log file so the user knows where to look for the reason of termination. Replacing the `err` function at the appropriate places with `term` Th message was also necessary when using `WARN_AS_ERROR = YES`
1 parent 6374856 commit bbcfa06

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/doxygen.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11563,9 +11563,7 @@ static QCString createOutputDirectory(const QCString &baseDirName,
1156311563
Dir formatDir(result.str());
1156411564
if (!formatDir.exists() && !formatDir.mkdir(result.str()))
1156511565
{
11566-
err("Could not create output directory %s\n", qPrint(result));
11567-
cleanUpDoxygen();
11568-
exit(1);
11566+
term("Could not create output directory %s\n", qPrint(result));
1156911567
}
1157011568
return result;
1157111569
}
@@ -11816,10 +11814,8 @@ void parseInput()
1181611814
dir.setPath(Dir::currentDirPath());
1181711815
if (!dir.mkdir(outputDirectory.str()))
1181811816
{
11819-
err("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
11820-
"exist and cannot be created\n",qPrint(outputDirectory));
11821-
cleanUpDoxygen();
11822-
exit(1);
11817+
term("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
11818+
"exist and cannot be created\n",qPrint(outputDirectory));
1182311819
}
1182411820
else
1182511821
{

src/message.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ static void format_warn(const QCString &file,int line,const QCString &text)
145145
}
146146
if (g_warnBehavior == WARN_AS_ERROR_t::YES)
147147
{
148+
if (g_warnFile != stderr && !Config_getBool(QUIET))
149+
{
150+
msg("See '%s' for the reason of termination.\n",qPrint(g_warnlogFile));
151+
}
148152
Doxygen::terminating=true;
149153
exit(1);
150154
}
@@ -159,6 +163,11 @@ static void handle_warn_as_error()
159163
std::unique_lock<std::mutex> lock(g_mutex);
160164
QCString msgText = " (warning treated as error, aborting now)\n";
161165
fwrite(msgText.data(),1,msgText.length(),g_warnFile);
166+
if (g_warnFile != stderr && !Config_getBool(QUIET))
167+
{
168+
// cannot use `msg` due to the mutex
169+
fprintf(stdout,"See '%s' for the reason of termination.\n",qPrint(g_warnlogFile));
170+
}
162171
}
163172
Doxygen::terminating=true;
164173
exit(1);
@@ -283,6 +292,11 @@ void term_(const char *fmt, ...)
283292
size_t l = strlen(g_errorStr);
284293
for (size_t i=0; i<l; i++) fprintf(g_warnFile, " ");
285294
fprintf(g_warnFile, "%s\n", "Exiting...");
295+
if (!Config_getBool(QUIET))
296+
{
297+
// cannot use `msg` due to the mutex
298+
fprintf(stdout,"See '%s' for the reason of termination.\n",qPrint(g_warnlogFile));
299+
}
286300
}
287301
}
288302
Doxygen::terminating=true;

0 commit comments

Comments
 (0)