File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ jobs:
131131 test :
132132 needs : msys2-ucrt64
133133 strategy :
134+ fail-fast : false
134135 matrix :
135136 include :
136137 - os : windows-2022
@@ -202,6 +203,13 @@ jobs:
202203 # Cleanup
203204 Stop-Process -Id $process.Id -Force
204205
206+ - name : Upload cadabra_log.txt
207+ if : always()
208+ uses : actions/upload-artifact@v4
209+ with :
210+ name : cadabra_log-${{ matrix.os }}.txt
211+ path : C:\Windows\Temp\cadabra_log.txt
212+
205213 - name : Upload screenshot
206214 uses : actions/upload-artifact@v4
207215 with :
Original file line number Diff line number Diff line change 2121int main (int argc, char **argv)
2222 {
2323#ifdef _WIN32
24- // Disable console creation
24+ // We are going to disable console creation. However,
25+ // that also kills any output to stdout or stderr, which may
26+ // have been useful in case of missing dlls or other errors.
27+ // Write them to a log file.
28+ std::ofstream logFile (" C:\\ Windows\\ Temp\\ cadabra_log.txt" );
29+ std::streambuf* oldCout = std::cout.rdbuf (logFile.rdbuf ());
30+ std::streambuf* oldCerr = std::cerr.rdbuf (logFile.rdbuf ());
31+
2532 FreeConsole ();
2633#endif
2734
@@ -37,6 +44,11 @@ int main(int argc, char **argv)
3744 catch (std::exception& ex) {
3845 std::cerr << ex.what () << std::endl;
3946 }
47+
48+ #ifdef _WIN32
49+ std::cout.rdbuf (oldCout);
50+ std::cerr.rdbuf (oldCerr);
51+ #endif
4052 }
4153
4254// #if defined(_WIN32) && defined(NDEBUG)
You can’t perform that action at this time.
0 commit comments