Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
07a0bfa
win32: Enable exactness
joaoantoniocardoso Oct 6, 2020
99390e1
exactness: meson should not use directly '/' when possible
joaoantoniocardoso Oct 6, 2020
e6879ce
exactness: fix implicit conversion
joaoantoniocardoso Oct 6, 2020
c3c64ed
exactness: add .py extension to python executable scripts
joaoantoniocardoso Oct 8, 2020
4b15823
exactness: run edje_cc in-tree
joaoantoniocardoso Oct 8, 2020
1d9bb53
exactness: Fix lib preload path
joaoantoniocardoso Oct 13, 2020
9a0d862
win32: Add exactness-win32 option to build system
joaoantoniocardoso Oct 13, 2020
9c55204
ecore: add exactness-win32
joaoantoniocardoso Oct 13, 2020
5c4b93f
exactness: fix dlfcn and other headers
joaoantoniocardoso Oct 21, 2020
70c3108
exacness: Add DllMain and functions to exactness preload
joaoantoniocardoso Oct 21, 2020
b07811d
eina: add exactness preload support
joaoantoniocardoso Oct 21, 2020
208b78c
elementary: add exactness preload support
joaoantoniocardoso Oct 21, 2020
49c82cb
ecore_evas: add exactness preload support
joaoantoniocardoso Oct 21, 2020
487b2ba
efl: add exactness preload support
joaoantoniocardoso Oct 21, 2020
f9c1f49
ecore: move efl_loop_data to its own file
joaoantoniocardoso Oct 21, 2020
2efb258
exactness: preload added to eina
joaoantoniocardoso Oct 20, 2020
8842d42
win32: add -DEFL_EXACTNESS_WIN32 when exactness-win32 option used
joaoantoniocardoso Oct 20, 2020
2886b6e
exactness: add support to exactness preload method
joaoantoniocardoso Oct 21, 2020
422a8ef
exactness_record: fix ORIGINAL_CALL macros to support win32
joaoantoniocardoso Oct 21, 2020
2d9c856
exactness: clean debug messages
joaoantoniocardoso Nov 13, 2020
61d3bea
exactness: call exactness_preload in all necessary <lib>_init
joaoantoniocardoso Oct 22, 2020
19afaa3
exactness_play: Fix atribution of speed env with float value
joaoantoniocardoso Oct 27, 2020
664181e
exactness: fix first value of _last_timestamp
joaoantoniocardoso Oct 30, 2020
808e404
exactness: run exactness_play from installed path
joaoantoniocardoso Oct 30, 2020
ef11a36
win32: use only supported engines for windows
joaoantoniocardoso Nov 5, 2020
d0a5a81
exactness: prevent leading blank space in command string
joaoantoniocardoso Nov 5, 2020
3fc04f8
exactness: strings should use double quotes on windows cmd line
joaoantoniocardoso Nov 5, 2020
db305fc
exactness: resolve base_dirs to absolute path
joaoantoniocardoso Nov 12, 2020
60b7ad8
exactness: resolve dest_dir to absolute path
joaoantoniocardoso Nov 12, 2020
281b642
exactness: Fix relative path for the commands
joaoantoniocardoso Nov 10, 2020
c96b0b9
exactness: fix relative path for dest_dir
joaoantoniocardoso Nov 10, 2020
7a306f8
exactness: use underscore prefix for variable name
joaoantoniocardoso Nov 10, 2020
4433f73
exactness: fix stdout/stderr to work in realtime
joaoantoniocardoso Nov 11, 2020
9ce2f3c
exactness: fix when to write to file
joaoantoniocardoso Nov 11, 2020
18d8bf2
exactness: force to use the buffer engine
joaoantoniocardoso Nov 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ exit /B 0
-Dlibmount=false^
"-Devas-loaders-disabler=gst,pdf,ps,raw,svg,rsvg,xcf,bmp,dds,generic,gif,ico,jp2k,pmaps,psd,tga,tgv,tiff,wbmp,webp,xpm,json"^
-Dopengl=none^
-Dexactness-win32=true^
"-Demotion-loaders-disabler=gstreamer1,libvlc,xine"^
-Dbindings=^
--buildtype=debug^
Expand Down
8 changes: 6 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ foreach lang : ['c', 'objc', 'cpp']
error('Version of targetted Windows incorrect')
endif
add_global_arguments('-D__USE_MINGW_ANSI_STDIO', language: lang)
if get_option('exactness-win32')
add_global_arguments('-DEFL_EXACTNESS_WIN32', language: lang)
endif
endif
endforeach

Expand Down Expand Up @@ -495,13 +498,14 @@ subprojects = [
if sys_windows
ignored_subprojects = [
# temporarily ignored
'exactness',
]
if get_option('exactness-win32') == false
ignored_subprojects += ['exactness']
endif
else
ignored_subprojects = []
endif


_subprojects = []
foreach package : subprojects
package_name = package[0]
Expand Down
6 changes: 6 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ option('dotnet',
description: 'Enable building C# bindings with dotnet instead of mono'
)

option('exactness-win32',
type: 'boolean',
value: false,
description: 'Enable building Exactness on Windows'
)

option('lua-interpreter',
type: 'combo',
choices: ['luajit', 'lua'],
Expand Down
71 changes: 50 additions & 21 deletions src/bin/exactness/exactness.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include "common.h"

#ifdef _WIN32
# include <evil_private.h> /* mkdir */
# include <evil_private.h> /* mkdir, dirname */
#else
# include <libgen.h>
#endif

#define SCHEDULER_CMD_SIZE 1024
Expand Down Expand Up @@ -44,6 +46,7 @@ typedef enum
static unsigned short _running_jobs = 0, _max_jobs = 1;
static Eina_List *_base_dirs = NULL;
static char *_dest_dir;
static char dest_dir[PATH_MAX];
static char *_wrap_command = NULL, *_fonts_dir = NULL;
static int _verbose = 0;
static Eina_Bool _scan_objs = EINA_FALSE, _disable_screenshots = EINA_FALSE, _stabilize_shots = EINA_FALSE;
Expand Down Expand Up @@ -110,17 +113,17 @@ _file_compare(const char *orig_dir, const char *ent_name)
Eina_Bool result = EINA_FALSE;
Exactness_Image *img1, *img2, *imgO = NULL;
char *filename1 = alloca(strlen(orig_dir) + strlen(ent_name) + 20);
char *filename2 = alloca(strlen(_dest_dir) + strlen(ent_name) + 20);
char *filename2 = alloca(strlen(dest_dir) + strlen(ent_name) + 20);
sprintf(filename1, "%s/%s", orig_dir, ent_name);
sprintf(filename2, "%s/%s/%s", _dest_dir, CURRENT_SUBDIR, ent_name);
sprintf(filename2, "%s/%s/%s", dest_dir, CURRENT_SUBDIR, ent_name);

img1 = _image_load(filename1);
img2 = _image_load(filename2);

if (exactness_image_compare(img1, img2, &imgO))
{
char *buf = alloca(strlen(_dest_dir) + strlen(ent_name));
sprintf(buf, "%s/%s/comp_%s", _dest_dir, CURRENT_SUBDIR, ent_name);
char *buf = alloca(strlen(dest_dir) + strlen(ent_name));
sprintf(buf, "%s/%s/comp_%s", dest_dir, CURRENT_SUBDIR, ent_name);
if (!_image_save(imgO, buf))
goto cleanup;
_compare_errors = eina_list_append(_compare_errors, strdup(ent_name));
Expand Down Expand Up @@ -164,7 +167,7 @@ static void
_run_test_compare(const List_Entry *ent)
{
char *path = alloca(PATH_MAX);
char *origdir = alloca(strlen(_dest_dir) + 20);
char *origdir = alloca(strlen(dest_dir) + 20);
const char *base_dir;
Eina_List *itr;
int n = 1, nb_fails = 0;
Expand All @@ -175,7 +178,7 @@ _run_test_compare(const List_Entry *ent)
if (ecore_file_exists(path))
{
char *currentdir;
sprintf(origdir, "%s/%s/%s", _dest_dir, CURRENT_SUBDIR, ORIG_SUBDIR);
sprintf(origdir, "%s/%s/%s", dest_dir, CURRENT_SUBDIR, ORIG_SUBDIR);
if (!ecore_file_exists(origdir))
{
if (mkdir(origdir, 0744) < 0)
Expand All @@ -185,9 +188,10 @@ _run_test_compare(const List_Entry *ent)
}
}
_exu_imgs_unpack(path, origdir, ent->name);
sprintf(path, "%s/%s/%s.exu", _dest_dir, CURRENT_SUBDIR, ent->name);
currentdir = alloca(strlen(_dest_dir) + 20);
sprintf(currentdir, "%s/%s", _dest_dir, CURRENT_SUBDIR);
sprintf(path, "%s/%s/%s.exu", dest_dir, CURRENT_SUBDIR, ent->name);
currentdir = alloca(strlen(dest_dir) + 20);
sprintf(currentdir, "%s/%s", dest_dir, CURRENT_SUBDIR);

_exu_imgs_unpack(path, currentdir, ent->name);
goto found;
}
Expand Down Expand Up @@ -228,9 +232,13 @@ _run_command_prepare(const List_Entry *ent, char *buf)
ok:
sbuf = eina_strbuf_new();
printf("STATUS %s: START\n", ent->name);

if (_wrap_command)
eina_strbuf_append_printf(sbuf, "%s", _wrap_command);

eina_strbuf_append_printf(sbuf,
"%s exactness_play %s %s%s %s%.*s %s%s%s-t '%s' ",
_wrap_command ? _wrap_command : "",
"python %s/exactness_play.py %s %s%s %s%.*s %s%s%s-t \"%s\" ",
PACKAGE_BIN_DIR,
_mode == RUN_SIMULATION ? "-s" : "",
_fonts_dir ? "-f " : "", _fonts_dir ? _fonts_dir : "",
_verbose ? "-" : "", _verbose, "vvvvvvvvvv",
Expand All @@ -241,12 +249,13 @@ _run_command_prepare(const List_Entry *ent, char *buf)
);

if (_mode == RUN_PLAY)
eina_strbuf_append_printf(sbuf, "-o '%s/%s/%s.exu' ", _dest_dir, CURRENT_SUBDIR, ent->name);
eina_strbuf_append_printf(sbuf, "-o \"%s/%s/%s.exu\" ", dest_dir, CURRENT_SUBDIR, ent->name);
if (_mode == RUN_INIT)
eina_strbuf_append_printf(sbuf, "-o '%s' ", scn_path);
eina_strbuf_append_printf(sbuf, "-o \"%s\" ", scn_path);

if (ent->command)
{

eina_strbuf_append(sbuf, "-- ");
eina_strbuf_append(sbuf, CONFIG);
eina_strbuf_append(sbuf, ent->command);
Expand Down Expand Up @@ -345,6 +354,9 @@ _list_file_load(const char *filename)
return NULL;
}

char *_test_file_dir = realpath(filename, NULL);
_test_file_dir = dirname(_test_file_dir);

while (fgets(buf, BUF_SIZE, file))
{
/* Skip comment/empty lines. */
Expand All @@ -360,7 +372,9 @@ _list_file_load(const char *filename)
if (tmp)
{
*tmp = '\0';
cur->command = tmp + 1;
char *command;
asprintf(&command, "%s/%s", _test_file_dir, tmp + 1);
cur->command = command;
}
else
{
Expand All @@ -380,6 +394,8 @@ _list_file_load(const char *filename)
List_Entry);
}

free(_test_file_dir);

fclose(file);
return ret;
}
Expand Down Expand Up @@ -497,11 +513,15 @@ main(int argc, char *argv[])
ECORE_GETOPT_VALUE_NONE
};

// Force to use the buffer engine
setenv("ELM_DISPLAY", "buffer", 1);
setenv("ECORE_EVAS_ENGINE", "buffer", 1);

if (!ecore_evas_init())
return EXIT_FAILURE;

_log_domain = eina_log_domain_register("exactness", "red");
_dest_dir = "./";
_dest_dir = ".";
_scan_objs = scan_objs;

eina_log_abort_on_critical_set(EINA_TRUE);
Expand Down Expand Up @@ -549,19 +569,28 @@ main(int argc, char *argv[])
goto end;
}

/* Get absolute path for all parameters */
EINA_LIST_FOREACH(_base_dirs, itr, base_dir)
{
char _resolved_base_dir[PATH_MAX];
realpath(base_dir, _resolved_base_dir);
eina_list_data_set(itr, _resolved_base_dir);
}
realpath(_dest_dir, dest_dir);

/* Pre-run summary */
fprintf(stderr, "Running with settings:\n");
fprintf(stderr, "\tConcurrent jobs: %d\n", _max_jobs);
fprintf(stderr, "\tTest list file: %s\n", list_file);
fprintf(stderr, "\tBase dirs:\n");
EINA_LIST_FOREACH(_base_dirs, itr, base_dir)
fprintf(stderr, "\t\t%s\n", base_dir);
fprintf(stderr, "\tDest dir: %s\n", _dest_dir);
fprintf(stderr, "\tDest dir: %s\n", dest_dir);

if (mode_play)
{
_mode = RUN_PLAY;
if (snprintf(tmp, PATH_MAX, "%s/%s", _dest_dir, CURRENT_SUBDIR)
if (snprintf(tmp, PATH_MAX, "%s/%s", dest_dir, CURRENT_SUBDIR)
>= PATH_MAX)
{
fprintf(stderr, "Path too long: %s", tmp);
Expand All @@ -581,7 +610,7 @@ main(int argc, char *argv[])
else if (mode_init)
{
_mode = RUN_INIT;
if (snprintf(tmp, PATH_MAX, "%s/%s", _dest_dir, ORIG_SUBDIR)
if (snprintf(tmp, PATH_MAX, "%s/%s", dest_dir, ORIG_SUBDIR)
>= PATH_MAX)
{
fprintf(stderr, "Path too long: %s", tmp);
Expand Down Expand Up @@ -637,7 +666,7 @@ main(int argc, char *argv[])
/* Generate the filename. */
snprintf(report_filename, PATH_MAX,
"%s/%s/errors.html",
_dest_dir, mode_init ? ORIG_SUBDIR : CURRENT_SUBDIR);
dest_dir, mode_init ? ORIG_SUBDIR : CURRENT_SUBDIR);
report_file = fopen(report_filename, "w+");
if (report_file)
{
Expand Down Expand Up @@ -671,7 +700,7 @@ main(int argc, char *argv[])
Eina_Bool is_from_exu;
char origpath[PATH_MAX];
snprintf(origpath, PATH_MAX, "%s/%s/orig/%s",
_dest_dir, CURRENT_SUBDIR, test_name);
dest_dir, CURRENT_SUBDIR, test_name);
is_from_exu = ecore_file_exists(origpath);
printf("\t* %s\n", test_name);

Expand Down
14 changes: 10 additions & 4 deletions src/bin/exactness/exactness_play.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ if G.version:
exit(0)

spawn_env = os.environ.copy()
spawn_env["LD_PRELOAD"] = @EXACTNESS_PLAY_PRELOAD_PATH@
if os.name == 'nt':
# Windows
spawn_env["EXACTNESS_PRELOAD_WIN32"] = "PLAY"
else:
spawn_env["LD_PRELOAD"] = @EXACTNESS_PLAY_PRELOAD_PATH@

if G.tests == None and G.external_injection == True:
print("no test file specified")
Expand All @@ -69,7 +73,7 @@ if G.tests != None:
if G.fontsdir != None:
spawn_env["EXACTNESS_FONTS_DIR"] = G.fontsdir
if G.speed != 1.0:
spawn_env["EXACTNESS_SPEED"] = G.speed
spawn_env["EXACTNESS_SPEED"] = str(G.speed)
if G.scan_objects:
spawn_env["EXACTNESS_SCAN_OBJECTS"] = "Yes"
if G.disable_screenshots:
Expand All @@ -80,6 +84,7 @@ if G.verbose:
spawn_env["EXACTNESS_VERBOSE"] = "Yes"
if G.show_on_screen == False:
spawn_env["ELM_DISPLAY"] = "buffer"
spawn_env["ECORE_EVAS_ENGINE"] = "buffer"

passed_all_the_env_vars = False
app = []
Expand All @@ -97,5 +102,6 @@ for argument in G.app:
if passed_all_the_env_vars:
app.append(argument)

recorder = subprocess.Popen(app, env=spawn_env)
recorder.wait()
with subprocess.Popen(app, env=spawn_env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) as p:
for line in p.stdout:
print(line, end='')
11 changes: 8 additions & 3 deletions src/bin/exactness/exactness_record.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ if G.version:
exit(0)

spawn_env = os.environ.copy()
spawn_env["LD_PRELOAD"] = @EXACTNESS_RECORD_PRELOAD_PATH@
if os.name == 'nt':
# Windows
spawn_env["EXACTNESS_PRELOAD_WIN32"] = "RECORD"
else:
spawn_env["LD_PRELOAD"] = @EXACTNESS_PLAY_PRELOAD_PATH@

if G.tests != None:
spawn_env["EXACTNESS_DEST"] = G.tests
Expand All @@ -72,5 +76,6 @@ for argument in G.app:
if passed_all_the_env_vars:
app.append(argument)

recorder = subprocess.Popen(app, env=spawn_env)
recorder.wait()
with subprocess.Popen(app, env=spawn_env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) as p:
for line in p.stdout:
print(line, end='')
30 changes: 22 additions & 8 deletions src/bin/exactness/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,58 @@ edjs = custom_target('player_entry',
input : 'player_entry.edc',
output : 'player_entry.edj',
install : true,
install_dir : 'share/exactness',
install_dir : join_paths('share', 'exactness'),
command : edje_cc_exe + [
'-id', join_paths(meson.source_root(), 'data', 'elementary', 'themes', 'img'),
'-sd', join_paths(meson.source_root(), 'data', 'elementary', 'themes', 'snd'),
'-in-tree',
'@INPUT@', '@OUTPUT@'],
depends : edje_depends)

exactness_play_bin = library('exactness_play',
exactness_play_lib = library('exactness_play',
[ 'player.c', 'common.c', 'common.h', edjs ],
dependencies: [ elementary, dl],
c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"',
install: true,
version : meson.project_version()
)

exactness_record_bin = library('exactness_record',
exactness_record_deps = [ elementary, dl]
if sys_windows
winmm = cc.find_library('winmm')
exactness_record_deps += winmm
endif

exactness_record_lib = library('exactness_record',
[ 'recorder.c', 'common.c', 'common.h' ],
dependencies: [ elementary, dl],
dependencies: exactness_record_deps,
c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"',
install: true,
version : meson.project_version()
)

exactness_play_lib_path = join_paths(
get_option('prefix'), get_option('libdir'),
'lib' + exactness_play_lib.name() + '.so.' + meson.project_version() )
exactness_record_lib_path = join_paths(
get_option('prefix'), get_option('libdir'),
'lib' + exactness_record_lib.name() + '.so.' + meson.project_version() )

exactness_env = configuration_data()
exactness_env.set_quoted('EXACTNESS_PLAY_PRELOAD_PATH', exactness_play_bin.full_path())
exactness_env.set_quoted('EXACTNESS_RECORD_PRELOAD_PATH', exactness_record_bin.full_path())
exactness_env.set_quoted('EXACTNESS_PLAY_PRELOAD_PATH', exactness_play_lib_path)
exactness_env.set_quoted('EXACTNESS_RECORD_PRELOAD_PATH', exactness_record_lib_path)
exactness_env.set_quoted('VERSION', meson.project_version())

configure_file(
input: 'exactness_record.in',
output: 'exactness_record',
output: 'exactness_record.py',
configuration: exactness_env,
install_dir: get_option('bindir'),
install_mode: 'rwxr-xr-x')

configure_file(
input: 'exactness_play.in',
output: 'exactness_play',
output: 'exactness_play.py',
configuration: exactness_env,
install_dir: get_option('bindir'),
install_mode: 'rwxr-xr-x')
Loading