summaryrefslogtreecommitdiff
path: root/src/tests/eina/eina_suite.c
blob: dfa2bd1e5f0e98548301436c517149ef51b10dc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/* EINA - EFL data type library
 * Copyright (C) 2008 Cedric Bail
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library;
 * if not, see <http://www.gnu.org/licenses/>.
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>

#include <Eina.h>

#include "eina_suite.h"
#include "eina_suite.x"
#include "../efl_check.h"

static const Efl_Test_Case etc[] = {
   { "fp", eina_test_fp },
   { "Inarray", eina_test_inarray },
   { "Array", eina_test_array },
   { "binshare", eina_test_binshare },
   { "stringshare", eina_test_stringshare },
   { "ustringshare", eina_test_ustringshare },
   { "Log", eina_test_log },
   { "Error", eina_test_error },
   { "Magic", eina_test_magic },
   { "Inlist", eina_test_inlist },
   { "lalloc", eina_test_lalloc },
   { "Main", eina_test_main },
   { "Counter", eina_test_counter },
   { "Hash", eina_test_hash },
   { "List", eina_test_list },
   { "CList", eina_test_clist },
   { "Iterator", eina_test_iterator },
   { "Accessor", eina_test_accessor },
   { "Module", eina_test_module },
   { "Convert", eina_test_convert },
   { "Rbtree", eina_test_rbtree },
   { "File", eina_test_file },
   { "Benchmark", eina_test_benchmark },
   { "Mempool", eina_test_mempool },
   { "Rectangle", eina_test_rectangle },
   { "MatrixSparse", eina_test_matrixsparse },
   { "Tiler", eina_test_tiler },
   { "Strbuf", eina_test_strbuf },
   { "Binbuf", eina_test_binbuf },
   { "String", eina_test_str },
   { "ustr", eina_test_ustr },
   { "QuadTree", eina_test_quadtree },
   { "Sched", eina_test_sched },
   { "Simple Xml Parser", eina_test_simple_xml_parser},
   { "Value", eina_test_value },
   { "COW", eina_test_cow },
   { "Barrier", eina_test_barrier },
   { "TmpStr", eina_test_tmpstr },
   { "Locking", eina_test_locking },
   { "ABI", eina_test_abi },
   { "Trash", eina_test_trash },
#ifdef XATTR_TEST_DIR
   { "Xattr", eina_test_xattr },
#endif
   { "Crc", eina_test_crc },
   { "Quad", eina_test_quad },
   { "Matrix", eina_test_matrix },
   { "Quaternion", eina_test_quaternion },
   { "Vector", eina_test_vector },
   { "Bezier", eina_test_bezier },
   { "SafePointer", eina_test_safepointer },
   { "Slice", eina_test_slice },
   { "Free Queue", eina_test_freeq },
   { "Util", eina_test_util },
   { "slstr", eina_test_slstr },
   { "Vpath", eina_test_vpath },
   { "debug", eina_test_debug },
   { NULL, NULL }
};

static Eina_Array *_modules;

SUITE_INIT(eina)
{
   ck_assert_int_eq(eina_init(), 1);
}

SUITE_SHUTDOWN(eina)
{
   ck_assert_int_eq(eina_shutdown(), 0);
}

EFL_START_TEST(mempool_module_load)
{
    _modules = eina_module_list_get(NULL,
                                 PACKAGE_BUILD_DIR "/src/modules/eina",
                                 EINA_TRUE,
                                 NULL,
                                 NULL);
   eina_module_list_load(_modules);
   eina_module_list_unload(_modules);
}
EFL_END_TEST

static void
mempool_init(TCase *tc)
{
   tcase_add_test(tc, mempool_module_load);
}

static const Efl_Test_Case mp_etc[] = {
   { "mempool_init", mempool_init },
   { NULL, NULL },
};

int
main(int argc, char **argv)
{
   int failed_count;

   if (!_efl_test_option_disp(argc, argv, etc))
     return 0;

#ifdef NEED_RUN_IN_TREE
   putenv("EFL_RUN_IN_TREE=1");
#endif
   /* force modules to be loaded in case they are not installed
    * this function does not require eina_init to be called
    */


   failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
                                           "eina_init_module", mp_etc, SUITE_INIT_FN(eina), SUITE_SHUTDOWN_FN(eina));

   eina_init();
   eina_module_list_load(_modules);
   failed_count += _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
                                           "Eina", etc, NULL, NULL);

   if (_modules)
     {
        while (eina_array_count(_modules))
          eina_module_free(eina_array_pop(_modules));
        eina_array_free(_modules);
     }
   eina_shutdown();

   return (failed_count == 0) ? 0 : 255;
}