diff options
Diffstat (limited to 'vespalib/src/tests/assert/assert_test.cpp')
-rw-r--r-- | vespalib/src/tests/assert/assert_test.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/vespalib/src/tests/assert/assert_test.cpp b/vespalib/src/tests/assert/assert_test.cpp index 49f4d2194f4..e953fc439c3 100644 --- a/vespalib/src/tests/assert/assert_test.cpp +++ b/vespalib/src/tests/assert/assert_test.cpp @@ -1,6 +1,6 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> -#include <vespa/vespalib/util/child_process.h> +#include <vespa/vespalib/process/process.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/util/assert.h> #include <vespa/vespalib/io/fileutil.h> @@ -16,24 +16,21 @@ TEST("that it borks the first time.") { vespalib::rmdir("var", true); ASSERT_TRUE(vespalib::mkdir(assertDir, true)); { - ChildProcess proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); - proc.wait(); - ASSERT_EQUAL(proc.getExitCode() & 0x7f, 6); + Process proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); + ASSERT_EQUAL(proc.join() & 0x7f, 6); } { - ChildProcess proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); - proc.readLine(assertName); - proc.wait(); - ASSERT_EQUAL(proc.getExitCode() & 0x7f, 0); + Process proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); + assertName = proc.read_line(); + ASSERT_EQUAL(proc.join() & 0x7f, 0); } ASSERT_EQUAL(0, unlink(assertName.c_str())); { - ChildProcess proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); - proc.wait(); - ASSERT_EQUAL(proc.getExitCode() & 0x7f, 6); + Process proc("ulimit -c 0 && exec env VESPA_HOME=./ ./vespalib_asserter_app myassert 10000"); + ASSERT_EQUAL(proc.join() & 0x7f, 6); } ASSERT_EQUAL(0, unlink(assertName.c_str())); ASSERT_TRUE(vespalib::rmdir("var", true)); } -TEST_MAIN_WITH_PROCESS_PROXY() { TEST_RUN_ALL(); } +TEST_MAIN() { TEST_RUN_ALL(); } |