X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fframework%2Finclude%2Fdpl%2Ftest%2Ftest_runner_multiprocess.h;h=ac6939e3228e8917143601a6367b9c29ee0295d6;hb=cb0c3e54fa2ed9fc04c29b98f9ea4d74fd3d6674;hp=279b5ef26693f2b84bf6d4f4d09e8fde6c38c65e;hpb=9f4a36d7c674bcac2f60271556fbab5ddd5615c2;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git diff --git a/src/framework/include/dpl/test/test_runner_multiprocess.h b/src/framework/include/dpl/test/test_runner_multiprocess.h index 279b5ef..ac6939e 100644 --- a/src/framework/include/dpl/test/test_runner_multiprocess.h +++ b/src/framework/include/dpl/test/test_runner_multiprocess.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2014-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. @@ -22,6 +22,13 @@ #ifndef DPL_TEST_RUNNER_MULTIPROCESS_H #define DPL_TEST_RUNNER_MULTIPROCESS_H +#include +#include +#include +#include +#include + +#include #include namespace DPL { @@ -39,22 +46,23 @@ class SimplePipeWrapper : Status receive(std::string &data, bool &empty, time_t deadline); }; -void RunMultiProc(TestRunner::TestCase procMulti); +void RunMultiProc(const std::function& testFunc); } // namespace Test } // namespace DPL -#define RUNNER_MULTIPROCESS_TEST(Proc) \ - void Proc(); \ - void Proc##Multi(); \ - static int Static##Proc##Init() \ - { \ - DPL::Test::TestRunnerSingleton::Instance().RegisterTest(#Proc, &Proc); \ - return 0; \ - } \ - const int DPL_UNUSED Static##Proc##InitVar = Static##Proc##Init(); \ - void Proc(){ \ - DPL::Test::RunMultiProc(&Proc##Multi); \ - } \ - void Proc##Multi() +#define RUNNER_MULTIPROCESS_TEST(Proc, ...) \ + void Proc(std::tuple<__VA_ARGS__> &optionalArgsTuple); \ + void Proc##Multi(std::tuple<__VA_ARGS__> &optionalArgsTuple); \ + static int Static##Proc##Init() \ + { \ + DPL::Test::TestRunnerSingleton::Instance().RegisterTest( \ + new DPL::Test::TestCaseExtended<__VA_ARGS__>(#Proc, &Proc)); \ + return 0; \ + } \ + const int DPL_UNUSED Static##Proc##InitVar = Static##Proc##Init(); \ + void Proc(std::tuple<__VA_ARGS__> &optionalArgsTuple) { \ + DPL::Test::RunMultiProc(std::bind(Proc##Multi, optionalArgsTuple)); \ + } \ + void Proc##Multi(std::tuple<__VA_ARGS__> &optionalArgsTuple DPL_UNUSED) #endif // DPL_TEST_RUNNER_MULTIPROCESS_H