TCT Tests for platform abstraction
[platform/core/uifw/dali-adaptor.git] / automated-tests / src / dali-platform-abstraction / tct-dali-platform-abstraction-core.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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 #include <stdio.h>
18 #include <string.h>
19 #include "tct-dali-platform-abstraction-core.h"
20
21 int main(int argc, const char *argv[])
22 {
23     int result = -1;
24     int i;
25
26     if (argc != 2) {
27         printf("Usage: %s <testcase name>\n", argv[0]);
28         return 2;
29     }
30
31     for (i = 0; tc_array[i].name; i++) {
32         if (!strcmp(argv[1], tc_array[i].name)) {
33             if (tc_array[i].startup)
34                 tc_array[i].startup();
35
36             result = tc_array[i].function();
37
38             if (tc_array[i].cleanup)
39                 tc_array[i].cleanup();
40
41             return result;
42         }
43     }
44
45     printf("Unknown testcase name: \"%s\"\n", argv[1]);
46     return 2;
47 }