Revert "Add handling uncaught exceptions from the child process function" 06/323606/1
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 30 Apr 2025 08:38:15 +0000 (10:38 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 30 Apr 2025 15:34:10 +0000 (17:34 +0200)
This reverts commit a8ae172c7481236669783f870698640fc9409b4d.

Without it, we won't be able to get the failed assertion info in
RUNNER_CHILD_TESTs.

Change-Id: Ib38eee248e950e30e8eae88daf03e0289152d4a4

src/common/tests_common.cpp

index bbc3c0b2cdbb08bfb675ddba727e60e2df2afd09..c9c411aa36a153678df4353b63692fe2aa2a6c50 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <cassert>
 #include <cerrno>
-#include <cstdlib>
 
 #include <grp.h>
 #include <sys/mman.h>
@@ -147,11 +146,7 @@ pid_t runInChild(const std::function<void(void)> &process) {
     RUNNER_ASSERT_ERRNO_MSG(pid >= 0, "fork failed");
 
     if (pid == 0) {
-        try {
-            process();
-        } catch (...) {
-            exit(EXIT_FAILURE);
-        }
+        process();
         exit(EXIT_SUCCESS);
     }
     return pid;
@@ -161,11 +156,7 @@ pid_t runInChildParentWait(const std::function<void(void)> &process) {
     pid_t pid = fork();
     RUNNER_ASSERT_ERRNO_MSG(pid >= 0, "fork failed");
     if (pid == 0) {
-        try {
-            process();
-        } catch (...) {
-            exit(EXIT_FAILURE);
-        }
+        process();
         exit(EXIT_SUCCESS);
     }
     waitPid(pid);