Selaa lähdekoodia

test/CMakeLib: make testUVProcessChain work with qemu

When building and testing CMake in a container with qemu
user mode emulation, the expected termination with std::abort()
in testUVProcessChainHelper leads qemu to emit an additional
message about an uncaught signal. There appears to be no way
to make qemu shut up, so any qemu message will be removed
from the output during validation.
Eicke Herbertz 5 vuotta sitten
vanhempi
sitoutus
8c42cfb2e8
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. 4 0
      Tests/CMakeLib/testUVProcessChain.cxx

+ 4 - 0
Tests/CMakeLib/testUVProcessChain.cxx

@@ -181,6 +181,10 @@ bool checkOutput(std::istream& outputStream, std::istream& errorStream)
   }
 
   std::string error = getInput(errorStream);
+  auto qemu_error_pos = error.find("qemu:");
+  if (qemu_error_pos != std::string::npos) {
+    error.resize(qemu_error_pos);
+  }
   if (error.length() != 3 || error.find('1') == std::string::npos ||
       error.find('2') == std::string::npos ||
       error.find('3') == std::string::npos) {