2012-08-26 06:18:44 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2012-09-04 00:03:02 -07:00
|
|
|
# include <config.h>
|
2012-08-26 06:18:44 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
2012-09-04 00:03:02 -07:00
|
|
|
#include <Eina.h>
|
|
|
|
|
2012-08-26 06:18:44 -07:00
|
|
|
#include "Eo.h"
|
|
|
|
#include "eo_bench.h"
|
|
|
|
|
|
|
|
typedef struct _Eina_Benchmark_Case Eina_Benchmark_Case;
|
|
|
|
struct _Eina_Benchmark_Case
|
|
|
|
{
|
|
|
|
const char *bench_case;
|
|
|
|
void (*build)(Eina_Benchmark *bench);
|
|
|
|
};
|
|
|
|
|
|
|
|
static const Eina_Benchmark_Case etc[] = {
|
2012-09-03 00:27:01 -07:00
|
|
|
{ "eo_do", eo_bench_eo_do },
|
2016-08-15 06:44:41 -07:00
|
|
|
{ "efl_add", eo_bench_efl_add },
|
2015-10-14 07:03:33 -07:00
|
|
|
{ "eo_callbacks", eo_bench_callbacks },
|
2012-08-26 06:18:44 -07:00
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
Eina_Benchmark *test;
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
if (argc != 2)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
eina_init();
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_object_init();
|
2012-08-26 06:18:44 -07:00
|
|
|
|
|
|
|
for (i = 0; etc[i].bench_case; ++i)
|
|
|
|
{
|
|
|
|
test = eina_benchmark_new(etc[i].bench_case, argv[1]);
|
|
|
|
if (!test)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
etc[i].build(test);
|
|
|
|
|
|
|
|
eina_benchmark_run(test);
|
|
|
|
|
|
|
|
eina_benchmark_free(test);
|
|
|
|
}
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_object_shutdown();
|
2012-08-26 06:18:44 -07:00
|
|
|
eina_shutdown();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|