Move ExecTestHelper to using a regex.

Test: treehugger
Change-Id: I1aa6bc174e000cb57481c51109d98b8c2c5acb8e
diff --git a/tests/dl_test.cpp b/tests/dl_test.cpp
index 47bf133..95b5251 100644
--- a/tests/dl_test.cpp
+++ b/tests/dl_test.cpp
@@ -134,7 +134,8 @@
       "helper_func called\n";
   ExecTestHelper eth;
   eth.SetArgs({ path_to_linker, helper.c_str(), nullptr });
-  eth.Run([&]() { execve(path_to_linker, eth.GetArgs(), eth.GetEnv()); }, 0, expected_output.c_str());
+  eth.Run([&]() { execve(path_to_linker, eth.GetArgs(), eth.GetEnv()); }, 0, nullptr);
+  ASSERT_EQ(expected_output, eth.GetOutput());
 #endif
 }
 
@@ -150,7 +151,8 @@
       "helper_func called\n";
   ExecTestHelper eth;
   eth.SetArgs({ path_to_linker, helper.c_str(), nullptr });
-  eth.Run([&]() { execve(path_to_linker, eth.GetArgs(), eth.GetEnv()); }, 0, expected_output.c_str());
+  eth.Run([&]() { execve(path_to_linker, eth.GetArgs(), eth.GetEnv()); }, 0, nullptr);
+  ASSERT_EQ(expected_output, eth.GetOutput());
 #endif
 }