2008-08-06 11:15:24 -07:00
|
|
|
/* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-08-01 05:22:31 -07:00
|
|
|
#include "eina_suite.h"
|
|
|
|
|
|
|
|
typedef struct _Eina_Test_Case Eina_Test_Case;
|
|
|
|
struct _Eina_Test_Case
|
|
|
|
{
|
|
|
|
const char *test_case;
|
|
|
|
void (*build)(TCase *tc);
|
|
|
|
};
|
|
|
|
|
|
|
|
static const Eina_Test_Case etc[] = {
|
|
|
|
{ "Array", eina_test_array },
|
|
|
|
{ "String Share", eina_test_stringshare },
|
2008-08-01 07:27:01 -07:00
|
|
|
{ "Error", eina_test_error },
|
|
|
|
{ "Magic", eina_test_magic },
|
2008-08-01 08:44:53 -07:00
|
|
|
{ "Inlist", eina_test_inlist },
|
2008-08-04 09:50:03 -07:00
|
|
|
{ "Lazy alloc", eina_test_lalloc },
|
2008-08-06 09:00:12 -07:00
|
|
|
{ "Main", eina_test_main },
|
|
|
|
{ "Counter", eina_test_counter },
|
|
|
|
{ "Hash", eina_test_hash },
|
2008-08-07 06:09:09 -07:00
|
|
|
{ "List", eina_test_list },
|
2008-08-11 09:30:16 -07:00
|
|
|
{ "Iterator", eina_test_iterator },
|
|
|
|
{ "Accessor", eina_test_accessor },
|
2008-08-18 01:18:16 -07:00
|
|
|
{ "Module", eina_test_module },
|
2008-08-21 07:20:41 -07:00
|
|
|
{ "Convert", eina_test_convert },
|
2008-08-28 09:36:18 -07:00
|
|
|
{ "Rbtree", eina_test_rbtree },
|
2008-09-03 07:40:12 -07:00
|
|
|
{ "File", eina_test_file },
|
2008-09-04 08:06:26 -07:00
|
|
|
{ "Benchmark", eina_test_benchmark },
|
2008-09-17 08:23:09 -07:00
|
|
|
{ "Mempool", eina_test_mempool },
|
2008-08-01 05:22:31 -07:00
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
Suite *
|
|
|
|
eina_build_suite(void)
|
|
|
|
{
|
|
|
|
TCase *tc;
|
|
|
|
Suite *s;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
s = suite_create("Eina");
|
|
|
|
|
|
|
|
for (i = 0; etc[i].test_case != NULL; ++i)
|
|
|
|
{
|
|
|
|
tc = tcase_create(etc[i].test_case);
|
|
|
|
|
|
|
|
etc[i].build(tc);
|
|
|
|
|
|
|
|
suite_add_tcase(s, tc);
|
|
|
|
}
|
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
|
|
|
Suite *s;
|
|
|
|
SRunner *sr;
|
|
|
|
int failed_count;
|
|
|
|
|
|
|
|
|
|
|
|
s = eina_build_suite();
|
|
|
|
sr = srunner_create(s);
|
|
|
|
srunner_run_all(sr, CK_NORMAL);
|
|
|
|
failed_count = srunner_ntests_failed(sr);
|
|
|
|
srunner_free(sr);
|
|
|
|
|
|
|
|
return (failed_count == 0) ? 0 : 255;
|
|
|
|
}
|