Commit Graph

33 Commits

Author SHA1 Message Date
Carsten Haitzler 0a06c7b568 efl check - use global not stack local buffer for srunner_set_xml
asan is most unhappy about using a priori stack frame's data for
this.. it seems check uses the char * buf directly as-is without
duplicating it... so we can't sensibvly use local stack data. that is
what asan is saying... and this makes our tests not work under asan to
begin with... nto to mention other possible issues i have yet to see
as i got to this one first.
2019-08-11 16:35:03 +01:00
Christopher Michael 2d94748133 efl_check: Fix memory leak
Summary:
Coverity reports that we leak variable 'n' here (memory returned from
strdup) so let's free it

Fixes CID1401070

@fix

Depends on D8759

Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8760
2019-05-02 13:42:08 +02:00
Vincent Torri cbea302b8f unit tests: fix warnings when fork() is not available, fix evil's unit tests compilation
Summary:
* some variables were defined, only when fork() was available
* since Eina.h is included unconditionally, add Eina path in Makefile_Evil.am

Test Plan: compilation

Reviewers: zmike, cedric, raster, devilhorns

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl_build

Differential Revision: https://phab.enlightenment.org/D8586
2019-04-09 10:05:18 -04:00
Carsten Haitzler 1f402946a2 tests - fix check header to always include eina due to windows
windows means HAVE_FORK is false... thus missing eina.h and now we
have macros that use eina calls always... so this fixes nbuild of
tests on windows

@fix
2019-04-07 14:16:55 +01:00
Marcel Hollerbach de8993575c efl_check: add API to expect a error
Summary:
sometimes it is not enough to just disable aborting on critical error
messages. Sometimes it is better to explicitly expect an error, and fail
the testcase if there is no error.

This is used in later commits here.

Depends on D8417

Reviewers: YOhoho, segfaultxavi, zmike, woohyun, Jaehyun_Cho

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8519
2019-04-02 08:56:28 -04:00
Stefan Schmidt b39d3990e9 tests: guard eina bool variable to avoid compilation failure on windows
The timeout_reached bool is only used in this function when HAVE_FORK is
available. This is not the case on windows. Eina.h would only be
included with fork available so the Eina_Bool type causes a compilation
fail on windows. Guarding them as the other parts of the function using
it solves the problem.

Reviewed-by: Vincent Torri <vincent.torri@gmail.com>
Differential Revision: https://phab.enlightenment.org/D7947
2019-02-14 13:00:54 +01:00
Carsten Haitzler 9fd36d7037 efl check - fix uniit var warning by setting to 0 to start 2018-11-09 11:43:59 +00:00
Shinwoo Kim f84408e325 tests: fix a build error on the 0.12.0 check
Summary:
(1) EFL_START_TEST(TEST_NAME) is defined as follows if you are using
    the 0.12.0 check:

  START_TEST(TEST_NAME) \
  _timing_start();

(2) START_TEST(__testname) is defined as follows
    (To make it simple I am using 'blah-blah' here):

static void __testname_fn (blah-blah);\
static const TTest __testname_ttest = { blah-blah };\
static const TTest * __testname = & __testname_ttest;\
static void __testname_fn (blah-blah)

For example we are using as follows in a test case:

EFL_START_TEST(evas_object_smart_paragraph_direction)
{
   ...
}
EFL_END_TEST

This made a build error.

Test Plan: make check

Reviewers: Hermet, zmike

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6969
2018-09-04 14:58:10 +09:00
Mike Blumenkrantz eb32d164a7 tests: add more info on failsafe timeout
if a test is continually deadlocking then it's useful to know which
test is failing to complete

Differential Revision: https://phab.enlightenment.org/D6785
2018-08-16 09:59:58 +02:00
Mike Blumenkrantz 440b7ce03f tests: add failsafe timeout for tests running in fork mode
some tests manage to deadlock themselves on travis, seemingly due to some
hard to reproduce issues which are a result of the extremely low amount of
resources available on travis builds

this adds a simple 'timeout' process which does nothing but sleep(60);
and then returns. the exiting of this process will cause the main test
process to break out of the deadlock and then exit instead of timing out
a ci build

Differential Revision: https://phab.enlightenment.org/D6697
2018-08-16 09:59:58 +02:00
Mike Blumenkrantz 6fbcff15db tests: check WIFEXITED to determine if test exited before using exit status
Summary:
the exit status value is not valid unless the process has terminated normally
by calling exit() or _exit(), so only use the status if this is true. otherwise
mark the process as a failed test
Depends on D6597

Reviewers: ManMower

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl_tests

Differential Revision: https://phab.enlightenment.org/D6600
2018-07-25 10:56:23 -05:00
Mike Blumenkrantz bc7cbaffb5 tests: limit per-suite forks to cpu count
this is mostly fine to thrash the cpus on beefy desktop computers, but
it completely destroys travis's wimpy 2cpu/2gb ram configurations and causes
all the tests to fail

instead, restrict forking to the number of cpus detected and wait until a fork
exits before beginning a new one

ref T7151

Differential Revision: https://phab.enlightenment.org/D6597
2018-07-25 09:50:11 +02:00
Mike Blumenkrantz a8532e4ed6 tests: remove eldbus special casing from checks to enable parallel test runs
Summary:
now that eldbus tests can safely run in parallel there is no reason to
prevent them from doing so

fix T6848
Depends on D6204

Reviewers: stefan_schmidt, cedric, ManMower, devilhorns

Reviewed By: cedric, ManMower

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6848

Differential Revision: https://phab.enlightenment.org/D6205
2018-06-19 14:08:27 -04:00
Mike Blumenkrantz abd1db8b1e tests: add macros to selectively disable aborting on critical log messages
in many cases, a test will intentionally trigger an error to verify that it
is handled correctly. when the test is manually run with EINA_LOG_ABORT set,
this may cause the test to abort, preventing further debugging. by wrapping
intentional cases where critical errors are triggered, debugging tests
becomes easier

ref T7002

Differential Revision: https://phab.enlightenment.org/D6269
2018-06-18 12:11:27 +02:00
Mike Blumenkrantz b9d3347a48 tests: flush stdout before beginning a test suite
Summary:
avoid having lines from the main pid repeated in forks
Depends on D5963

Reviewers: stefan_schmidt

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5964
2018-04-20 14:31:11 +02:00
Mike Blumenkrantz 7708154069 tests: remove explicit checks for eina mempool tests
Summary:
this was only a temporary measure
Depends on D5916

Reviewers: stefan_schmidt

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5937
2018-04-16 12:24:35 +02:00
Mike Blumenkrantz 576570ce27 tests: flush stdout after printing test suite timing info
Summary:
avoid repeating lines

Depends on D5937

Reviewers: stefan_schmidt

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5917
2018-04-16 12:24:35 +02:00
Mike Blumenkrantz 1885374ce5 tests: do not attempt to parallelize test suites with only 1 test case
Summary: Depends on D5911

Reviewers: stefan_schmidt

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5916
2018-04-16 12:24:35 +02:00
Lauro Moura 15afb832e6 tests: Fix compilation when timing is disabled.
Reviewers: zmike, cedric

Reviewed By: zmike

Differential Revision: https://phab.enlightenment.org/D5919
2018-04-11 13:43:38 -03:00
Mike Blumenkrantz b4da776b3b tests: add more timing info for per-file timing
Summary:
ref T6825
Depends on D5901

Reviewers: stefan_schmidt

Subscribers: cedric

Maniphest Tasks: T6825

Differential Revision: https://phab.enlightenment.org/D5902
2018-04-10 11:28:01 +02:00
Mike Blumenkrantz 0998f1586f tests: remove timing info for eina mempool initializer
Summary:
this is buggy somehow and prints its info a few dozen times, likely
taking longer to print the info than to run the actual test
Depends on D5879

Reviewers: stefan_schmidt

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5880
2018-04-10 11:28:01 +02:00
Mike Blumenkrantz 6879270b59 tests: parallelize most test suites
Summary:
check does not internally do any parallelizing and is impossible to use
with threads, so using fork appears to be the only viable option for
using more cpu without radically redesigning all existing tests

ref T6825
ref T6848

Reviewers: stefan_schmidt

Subscribers: cedric

Maniphest Tasks: T6848, T6825

Differential Revision: https://phab.enlightenment.org/D5877
2018-04-10 11:28:01 +02:00
Mike Blumenkrantz 71f76c65cf tests: add test for check < 0.11 to enable timing info 2018-04-05 12:25:16 -04:00
Mike Blumenkrantz 624925fe6e tests: move to using checked fixtures for all test suites
individual tests should not need to explicitly call init/shutdown functions
in most cases, and many did not properly do this anyway

see followup commit which resolves some issues with eina tests

ref T6813
ref T6811

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:26 +02:00
Mike Blumenkrantz ff67706783 tests: make test time output configurable with TIME_DIFF_THRESHOLD
setting this value too low will likely lead to unmanageable results

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:25 +02:00
Mike Blumenkrantz adc601aca2 tests: add instrumentation to existing tests to find slow tests
efl_check.h must be included and the EFL_START/END_TEST macros must be
used in place of normal START/END_TEST macros

timing is enabled when TIMING_ENABLED is set
https://phab.enlightenment.org/w/improve_tests/

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:25 +02:00
Mike Blumenkrantz b340b5e49c tests: match test names using strcasecmp when parsing cmdline
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:25 +02:00
Carsten Haitzler e767fbe2b5 efl check - fix env var for CK_FORK=no 2018-03-07 15:35:18 +09:00
Cedric BAIL a5a587510e efl: add helper to run tests suite under valgrind. 2016-12-21 16:40:22 -08:00
Cedric BAIL b734d18cca efl: improve help displayed by each tests suite. 2016-12-21 16:40:22 -08:00
Tom Hacohen 936801e8bb Efl tests: Fix running of tests. 2016-02-16 13:03:20 +00:00
Tom Hacohen d3b7e067ef Efl tests: Fix dangerous coding style. 2016-02-16 13:01:00 +00:00
Vincent Torri da98142de6 Test rework #1: Ecore
Factorisation of the infra
make uniform all the tests
2016-02-16 12:41:06 +00:00