upload tizen1.0 source
[platform/framework/web/wrt.git] / tests / warp_tests / warp_iri_tests.cpp
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 /*
17  * @file        main.cpp
18  * @version     1.0
19  * @brief       This file is used by WarpIRI tests.
20  */
21 #include <dpl/test/test_runner.h>
22 #include <dpl/log/log.h>
23
24 #include <string>
25
26 #include <wrt_api.h>
27 #include <wrt_installer_api.h>
28
29 #include <loop_control.h>
30 using namespace LoopControl;
31 /**
32  * Callback function type invoked when WRT is initialized
33  */
34 void init_cb (WrtErrStatus status, void* data)
35 {
36     (void) status;
37     (void) data;
38     LogInfo("Init Succesfull");
39     finish_wait_for_wrt_init();
40 }
41
42 int main (int argc, char *argv[])
43 {
44 /**
45  * initialization main loop
46  */
47     init_loop(argc, argv);
48     LogInfo("Initializing WRT");
49 /**
50  * wrt initialization
51  */
52     wrt_installer_init_for_tests(NULL, &init_cb);
53     wrt_init(NULL, &init_cb);
54
55     wait_for_wrt_init();
56     LogInfo("Starting tests");
57
58 /**
59  * run tests
60  */
61     int status = DPL::Test::TestRunnerSingleton::Instance().ExecTestRunner(argc, argv);
62 /**
63  * stop wrt
64  */
65     wrt_installer_shutdown_for_tests();
66     wrt_shutdown();
67 /**
68  * quit loop
69  */
70     quit_loop();
71     return status;
72 }