Move ExecTestHelper to using a regex.

Test: treehugger
Change-Id: I1aa6bc174e000cb57481c51109d98b8c2c5acb8e
diff --git a/tests/utils.h b/tests/utils.h
index 592ac0e..284140a 100644
--- a/tests/utils.h
+++ b/tests/utils.h
@@ -229,7 +229,7 @@
   }
 
   void Run(const std::function<void()>& child_fn, int expected_exit_status,
-           const char* expected_output) {
+           const char* expected_output_regex) {
     int fds[2];
     ASSERT_NE(pipe(fds), -1);
 
@@ -258,8 +258,10 @@
 
     std::string error_msg("Test output:\n" + output_);
     AssertChildExited(pid, expected_exit_status, &error_msg);
-    if (expected_output != nullptr) {
-      ASSERT_EQ(expected_output, output_);
+    if (expected_output_regex != nullptr) {
+      if (!std::regex_search(output_, std::regex(expected_output_regex))) {
+        FAIL() << "regex " << expected_output_regex << " didn't match " << output_;
+      }
     }
   }