/*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
+/**
* @file test_runner_child.cpp
* @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
* @version 1.0
* @brief This file is the implementation file of test runner
*/
#include <stddef.h>
+#include <dpl/test/test_failed.h>
+#include <dpl/test/test_ignored.h>
#include <dpl/test/test_runner.h>
#include <dpl/test/test_runner_child.h>
#include <dpl/test/test_results_collector.h>
{
PipeWrapper pipe;
if (!pipe.isReady()) {
- throw TestRunner::TestFailed("Pipe creation failed");
+ throw TestFailed("Pipe creation failed");
}
pid_t pid = fork();
if (pid == -1) {
- throw TestRunner::TestFailed("Child creation failed");
+ throw TestFailed("Child creation failed");
}
if (pid != 0) {
waitpid(pid, &status, 0);
if (pipeReturn == PipeWrapper::TIMEOUT) {
- throw TestRunner::TestFailed("Timeout");
+ throw TestFailed("Timeout");
}
if (pipeReturn == PipeWrapper::ERROR) {
- throw TestRunner::TestFailed("Reading pipe error");
+ throw TestFailed("Reading pipe error");
}
if (code == CHILD_TEST_PASS && msgType == MSG_TYPE_PERF_TIME) {
}
if (code == CHILD_TEST_FAIL) {
- throw TestRunner::TestFailed(message);
+ throw TestFailed(message);
} else if (code == CHILD_TEST_IGNORED) {
- throw TestRunner::Ignored(message);
+ throw TestIgnored(message);
}
} else {
// child code
try {
procChild();
- } catch (const DPL::Test::TestRunner::TestFailed &e) {
+ } catch (const DPL::Test::TestFailed &e) {
msg = e.GetMessage();
code = CHILD_TEST_FAIL;
- } catch (const DPL::Test::TestRunner::Ignored &e) {
+ } catch (const DPL::Test::TestIgnored &e) {
msg = e.GetMessage();
code = CHILD_TEST_IGNORED;
} catch (...) { // catch all exception generated by "user" code