- enhancement: Info contents from stderr are logged into "Tools Output" panel, add problem case name info to the log.

This commit is contained in:
Roy Qu 2024-03-26 13:45:26 +08:00
parent 40777386a9
commit 477f7f1d7d
6 changed files with 62 additions and 42 deletions

View File

@ -91,6 +91,7 @@ Red Panda C++ Version 2.27
- enhancement: Auto define macro "_DEBUG" for "Debug" compiler set(like visual studio).
- enhancement: Suggest macro names after "#ifdef"/"#ifndef".
- enhancement: Info contents from stderr are logged into "Tools Output" panel, add problem case name info to the log.
Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors.

View File

@ -84,7 +84,7 @@ void OJProblemCasesRunner::runCase(int index,POJProblemCase problemCase)
env.insert("PATH",path);
process.setProcessEnvironment(env);
if (pSettings->executor().redirectStderrToToolLog()) {
emit logStderrOutput("\n");
emit logStderrOutput("\n"+tr("--- stderr from %1 ---").arg(problemCase->name)+"\n");
} else {
process.setProcessChannelMode(QProcess::MergedChannels);
process.setReadChannel(QProcess::StandardOutput);

View File

@ -49,6 +49,9 @@ public:
void setMemoryLimit(size_t limit);
bool includeOutputFromStderr() const;
void setIncludeOutputFromStderr(bool newIncludeOutputFromStderr);
signals:
void caseStarted(const QString &caseId, int current, int total);
void caseFinished(const QString &caseId, int current, int total);
@ -68,6 +71,7 @@ private:
int mOutputRefreshTime;
int mExecTimeout;
size_t mMemoryLimit;
bool mIncludeOutputFromStderr;
};
#endif // OJPROBLEMCASESRUNNER_H

View File

@ -1382,7 +1382,7 @@
<location filename="../editor.cpp" line="+384"/>
<location line="+70"/>
<location line="+29"/>
<location line="+1088"/>
<location line="+1093"/>
<location line="+5"/>
<location line="+21"/>
<location line="+5"/>
@ -1390,7 +1390,7 @@
<translation>Erro</translation>
</message>
<message>
<location line="-1182"/>
<location line="-1187"/>
<source>Save As</source>
<translation>Salvar como</translation>
</message>
@ -1400,7 +1400,7 @@
<translation>Arquivo %1 aberto!</translation>
</message>
<message>
<location line="+1117"/>
<location line="+1122"/>
<source>The text to be copied exceeds count limit!</source>
<translation>O texto a ser copiado excede o limite do contador!</translation>
</message>
@ -1432,7 +1432,7 @@
<translation>Ctrl+clik para mais informações</translation>
</message>
<message>
<location line="+919"/>
<location line="+920"/>
<source>astyle not found</source>
<translation>astyle não encontrado</translation>
</message>
@ -1457,13 +1457,13 @@
<translation>Apenas leitura</translation>
</message>
<message>
<location line="-5368"/>
<location line="-5374"/>
<location line="+434"/>
<source>Error Load File</source>
<translation type="unfinished">Erro ao carregar arquivo</translation>
</message>
<message>
<location line="+1578"/>
<location line="+1583"/>
<source>hex: %1</source>
<translation type="unfinished"></translation>
</message>
@ -2907,18 +2907,18 @@
</message>
<message>
<location line="+42"/>
<location line="+94"/>
<location line="+96"/>
<source>Can&apos;t delete the old executable file &quot;%1&quot;.
</source>
<translation>Impossível remover o antigo arquivo executável &quot;%1&quot;.</translation>
</message>
<message>
<location line="-63"/>
<location line="-65"/>
<source>Can&apos;t find the compiler for file %1</source>
<translation>Impossível encontrar o compilador para o arquivo %1</translation>
</message>
<message>
<location line="+41"/>
<location line="+43"/>
<source>The Compiler &apos;%1&apos; doesn&apos;t exists!</source>
<translation>O compilador &apos;%1&apos; é inexistente!</translation>
</message>
@ -2942,7 +2942,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-122"/>
<location line="-124"/>
<source>Checking single file...</source>
<translation type="unfinished"></translation>
</message>
@ -2952,7 +2952,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+68"/>
<location line="+70"/>
<source>Command: %1</source>
<translation type="unfinished">Comando: %1</translation>
</message>
@ -7345,7 +7345,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<location line="-91"/>
<source>--- stderr from %1 ---</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+94"/>
<source>Memory limit exceeded!</source>
<translation type="unfinished"></translation>
</message>
@ -7674,7 +7679,7 @@
<translation>- Arquivo de recursos: %1</translation>
</message>
<message>
<location line="+343"/>
<location line="+345"/>
<source>Compiling project changes...</source>
<translation>Compilando alterações em projeto ...</translation>
</message>
@ -8374,7 +8379,7 @@
<location filename="../autolinkmanager.cpp" line="+54"/>
<location line="+16"/>
<location line="+19"/>
<location filename="../settings.cpp" line="+4045"/>
<location filename="../settings.cpp" line="+4051"/>
<location filename="../widgets/ojproblemsetmodel.cpp" line="-401"/>
<location line="+61"/>
<source>Can&apos;t open file &apos;%1&apos; for read.</source>
@ -9676,7 +9681,7 @@
<translation type="unfinished">Impossível abrir &apos;%1&apos; para gravar!</translation>
</message>
<message>
<location line="+214"/>
<location line="+212"/>
<source>Compiling project changes...</source>
<translation type="unfinished">Compilando alterações em projeto ...</translation>
</message>

View File

@ -1596,7 +1596,7 @@ p, li { white-space: pre-wrap; }
<location filename="../editor.cpp" line="+384"/>
<location line="+70"/>
<location line="+29"/>
<location line="+1088"/>
<location line="+1093"/>
<location line="+5"/>
<location line="+21"/>
<location line="+5"/>
@ -1608,7 +1608,7 @@ p, li { white-space: pre-wrap; }
<translation type="vanished">&quot;%1&quot;</translation>
</message>
<message>
<location line="-1475"/>
<location line="-1480"/>
<location line="+434"/>
<source>Error Load File</source>
<translation></translation>
@ -1648,7 +1648,7 @@ p, li { white-space: pre-wrap; }
<translation>%1</translation>
</message>
<message>
<location line="+1117"/>
<location line="+1122"/>
<source>The text to be copied exceeds count limit!</source>
<translation></translation>
</message>
@ -1694,7 +1694,7 @@ p, li { white-space: pre-wrap; }
<translation type="vanished">&apos;%1&apos;!</translation>
</message>
<message>
<location line="+919"/>
<location line="+920"/>
<source>astyle not found</source>
<translation>astyle程序</translation>
</message>
@ -3222,13 +3222,13 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location line="+42"/>
<location line="+94"/>
<location line="+96"/>
<source>Can&apos;t delete the old executable file &quot;%1&quot;.
</source>
<translation>&quot;%1&quot;.</translation>
</message>
<message>
<location line="-81"/>
<location line="-83"/>
<source>GNU Assembler</source>
<translation>GNU汇编</translation>
</message>
@ -3239,7 +3239,7 @@ p, li { white-space: pre-wrap; }
<translation>%1</translation>
</message>
<message>
<location line="+41"/>
<location line="+43"/>
<source>The Compiler &apos;%1&apos; doesn&apos;t exists!</source>
<translation>&quot;%1&quot;</translation>
</message>
@ -7930,7 +7930,12 @@ p, li { white-space: pre-wrap; }
<translation type="vanished"></translation>
</message>
<message>
<location filename="../compiler/ojproblemcasesrunner.cpp" line="+178"/>
<location filename="../compiler/ojproblemcasesrunner.cpp" line="+87"/>
<source>--- stderr from %1 ---</source>
<translation type="unfinished">--- %1stderr ---</translation>
</message>
<message>
<location line="+91"/>
<source>Time limit exceeded!</source>
<translation></translation>
</message>
@ -8312,7 +8317,7 @@ p, li { white-space: pre-wrap; }
<translation>- : %1</translation>
</message>
<message>
<location line="+343"/>
<location line="+345"/>
<source>Compiling project changes...</source>
<translation>...</translation>
</message>
@ -9234,7 +9239,7 @@ p, li { white-space: pre-wrap; }
<translation>(-g3)</translation>
</message>
<message>
<location filename="../settings.cpp" line="+3443"/>
<location filename="../settings.cpp" line="+3449"/>
<source>Would you like Red Panda C++ to search for compilers in PATH?</source>
<translation>C++PATH路径中寻找gcc编译器吗</translation>
</message>
@ -10421,7 +10426,7 @@ p, li { white-space: pre-wrap; }
<translation>&apos;%1&apos;</translation>
</message>
<message>
<location line="+214"/>
<location line="+212"/>
<source>Compiling project changes...</source>
<translation>...</translation>
</message>

View File

@ -1227,7 +1227,7 @@
<location filename="../editor.cpp" line="+384"/>
<location line="+70"/>
<location line="+29"/>
<location line="+1088"/>
<location line="+1093"/>
<location line="+5"/>
<location line="+21"/>
<location line="+5"/>
@ -1235,7 +1235,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-1182"/>
<location line="-1187"/>
<source>Save As</source>
<translation type="unfinished"></translation>
</message>
@ -1245,7 +1245,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1117"/>
<location line="+1122"/>
<source>The text to be copied exceeds count limit!</source>
<translation type="unfinished"></translation>
</message>
@ -1277,7 +1277,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+919"/>
<location line="+920"/>
<source>astyle not found</source>
<translation type="unfinished"></translation>
</message>
@ -1302,13 +1302,13 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-5368"/>
<location line="-5374"/>
<location line="+434"/>
<source>Error Load File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1578"/>
<location line="+1583"/>
<source>hex: %1</source>
<translation type="unfinished"></translation>
</message>
@ -2716,18 +2716,18 @@
</message>
<message>
<location line="+42"/>
<location line="+94"/>
<location line="+96"/>
<source>Can&apos;t delete the old executable file &quot;%1&quot;.
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-63"/>
<location line="-65"/>
<source>Can&apos;t find the compiler for file %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+41"/>
<location line="+43"/>
<source>The Compiler &apos;%1&apos; doesn&apos;t exists!</source>
<translation type="unfinished"></translation>
</message>
@ -2747,7 +2747,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-122"/>
<location line="-124"/>
<source>Checking single file...</source>
<translation type="unfinished"></translation>
</message>
@ -2757,7 +2757,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+68"/>
<location line="+70"/>
<source>Command: %1</source>
<translation type="unfinished"></translation>
</message>
@ -7030,7 +7030,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<location line="-91"/>
<source>--- stderr from %1 ---</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+94"/>
<source>Memory limit exceeded!</source>
<translation type="unfinished"></translation>
</message>
@ -7335,7 +7340,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+343"/>
<location line="+345"/>
<source>Compiling project changes...</source>
<translation type="unfinished"></translation>
</message>
@ -8002,7 +8007,7 @@
<location filename="../autolinkmanager.cpp" line="+54"/>
<location line="+16"/>
<location line="+19"/>
<location filename="../settings.cpp" line="+4045"/>
<location filename="../settings.cpp" line="+4051"/>
<location filename="../widgets/ojproblemsetmodel.cpp" line="-401"/>
<location line="+61"/>
<source>Can&apos;t open file &apos;%1&apos; for read.</source>
@ -9077,7 +9082,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+214"/>
<location line="+212"/>
<source>Compiling project changes...</source>
<translation type="unfinished"></translation>
</message>