From 73553dd16a2ed0b64475ccb33b523c799ff4a933 Mon Sep 17 00:00:00 2001 From: Ayrton Chilibeck Date: Tue, 1 Oct 2024 02:51:02 -0600 Subject: [PATCH] Fixed tests now fail when failing to create output --- src/tests/TestRunning.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tests/TestRunning.cpp b/src/tests/TestRunning.cpp index a4ac1015..ab99ee68 100644 --- a/src/tests/TestRunning.cpp +++ b/src/tests/TestRunning.cpp @@ -212,6 +212,12 @@ TestResult runTest(TestFile* test, const ToolChain& toolChain, const Config& cfg genOutPath = eo.getOutputFile(); } + // Check if we were able to create the output file + std::ifstream file(genErrorString); + if (!file.is_open()) { + return TestResult(testPath, false, true, "Failed to create output file"); + } + } catch (const CommandException& ce) { // toolchain throws errors only when allowError is false in the config if (cfg.getVerbosity() > 0) {