forked from enlightenment/efl
parent
6a87ca7590
commit
889d40abf8
|
@ -33,10 +33,6 @@
|
|||
#include "eina_iterator.h"
|
||||
#include "eina_accessor.h"
|
||||
|
||||
#ifndef PATH_MAX
|
||||
# define PATH_MAX 4096
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(x, y) (((x) > (y)) ? (y) : (x))
|
||||
#endif
|
||||
|
|
|
@ -292,6 +292,8 @@ eina_benchmark_register(Eina_Benchmark *bench, const char *name, Eina_Benchmark_
|
|||
* immediatly. Otherwise, it returns the list of the names of each
|
||||
* test.
|
||||
*/
|
||||
#define EINA_BENCHMARK_FILENAME_MASK "bench_%s_%s.gnuplot"
|
||||
#define EINA_BENCHMARK_DATA_MASK "bench_%s_%s.%s.data"
|
||||
EAPI Eina_Array *
|
||||
eina_benchmark_run(Eina_Benchmark *bench)
|
||||
{
|
||||
|
@ -299,12 +301,18 @@ eina_benchmark_run(Eina_Benchmark *bench)
|
|||
FILE *current_data;
|
||||
Eina_Array *ea;
|
||||
Eina_Run *run;
|
||||
char buffer[PATH_MAX];
|
||||
char *buffer;
|
||||
Eina_Bool first = EINA_FALSE;
|
||||
int length;
|
||||
|
||||
if (!bench) return NULL;
|
||||
|
||||
snprintf(buffer, PATH_MAX, "bench_%s_%s.gnuplot", bench->name, bench->run);
|
||||
length = strlen(EINA_BENCHMARK_FILENAME_MASK) + strlen(bench->name) + strlen(bench->run);
|
||||
|
||||
buffer = alloca(sizeof (char) * length);
|
||||
if (!buffer) return NULL;
|
||||
|
||||
snprintf(buffer, length, EINA_BENCHMARK_FILENAME_MASK, bench->name, bench->run);
|
||||
|
||||
main_script = fopen(buffer, "w");
|
||||
if (!main_script) return NULL;
|
||||
|
@ -336,9 +344,17 @@ eina_benchmark_run(Eina_Benchmark *bench)
|
|||
{
|
||||
Eina_Counter *counter;
|
||||
char *result;
|
||||
int tmp;
|
||||
int i;
|
||||
|
||||
snprintf(buffer, PATH_MAX, "bench_%s_%s.%s.data", bench->name, bench->run, run->name);
|
||||
tmp = strlen(EINA_BENCHMARK_DATA_MASK) + strlen(bench->name) + strlen(bench->run) + strlen(run->name);
|
||||
if (tmp > length)
|
||||
{
|
||||
buffer = alloca(sizeof (char) * tmp);
|
||||
length = tmp;
|
||||
}
|
||||
|
||||
snprintf(buffer, length, EINA_BENCHMARK_DATA_MASK, bench->name, bench->run, run->name);
|
||||
|
||||
current_data = fopen(buffer, "w");
|
||||
if (!current_data) continue ;
|
||||
|
|
|
@ -107,10 +107,16 @@ static void _dir_list_cb(const char *name, const char *path, void *data)
|
|||
if (!strcmp(name + length - strlen(MODULE_EXTENSION),
|
||||
MODULE_EXTENSION))
|
||||
{
|
||||
char file[PATH_MAX];
|
||||
char *file;
|
||||
Eina_Module *m;
|
||||
int length;
|
||||
|
||||
snprintf(file, PATH_MAX, "%s/%s", path, name);
|
||||
length = strlen(path) + strlen(name) + 2;
|
||||
|
||||
file = alloca(sizeof (char) * length);
|
||||
if (!file) return ;
|
||||
|
||||
snprintf(file, length, "%s/%s", path, name);
|
||||
m = eina_module_new(file);
|
||||
if (!m)
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue