Commit graph

96 commits

Author SHA1 Message Date
Roberto Ostinelli
fa6618f2b4 Add experimental tests= filter without eunit suites 2012-08-20 12:58:31 +02:00
Tuncer Ayaz
fc7df16e31 Clarify comments 2012-08-12 14:03:44 +02:00
Tuncer Ayaz
bdee72fae8 rebar_eunit: add tests= TODO item 2012-08-11 23:10:06 +02:00
Roberto Ostinelli
69dc9ec933 Add experimental tests= filter for eunit suites 2012-08-11 23:08:21 +02:00
Tuncer Ayaz
5d6b82390f rebar_eunit: fix typo 2012-08-10 16:05:00 +02:00
Tuncer Ayaz
e47d643ea3 Use separate dirs for eunit and qc 2012-08-09 18:37:26 +02:00
Tuncer Ayaz
99b645e4a3 Separate eunit and qc compile options 2012-08-09 14:04:53 +02:00
Tuncer Ayaz
803f6e8ecd Replace test-compile with compile_only=true option 2012-08-09 14:04:53 +02:00
Tuncer Ayaz
888bbc8ee2 Fix whitespace error 2012-08-07 14:03:58 +02:00
Tuncer Ayaz
fdc1425a3b Use rebar_utils:test_dir/0 for coverdata export file 2012-08-07 14:02:13 +02:00
David Åberg
43d5b6257e Enable export of cover data from eunit testrun 2012-08-07 13:44:40 +02:00
Tuncer Ayaz
c9ddb8325a Quote EUnit User's guide about _tests.beam handling 2012-07-31 16:39:25 +02:00
Tuncer Ayaz
ad2e94b96b Add experimental notice to test-compile and shell 2012-07-31 15:39:36 +02:00
Tuncer Ayaz
636c02f0be Fix R13B03 build (Reported-by: Sergey Nartimov) 2012-07-28 19:51:57 +02:00
Tuncer Ayaz
228f39efa1 Rename old eunit compile options for consistency with test-compile 2012-07-26 17:15:01 +02:00
Tuncer Ayaz
c0644dc195 Finalize app=, skip_app=, suite= deprecations 2012-07-23 16:48:15 +02:00
Tuncer Ayaz
e75a97ad33 Add 'qc' cmd and rename eunit-compile to test-compile 2012-07-23 16:22:06 +02:00
Tuncer Ayaz
902dcdf3ff Add 'eunit-compile' cmd (Suggested-by: Joe Norton) 2012-07-23 13:28:38 +02:00
Tuncer Ayaz
252757c753 Do not use application:set_env 2012-07-23 13:17:11 +02:00
Tuncer Ayaz
5a4ddd5524 Do not keep eunit config 2012-07-13 22:48:20 +02:00
Tuncer Ayaz
e185e86bff Remove shared state 2012-07-13 15:21:56 +02:00
Tuncer Ayaz
e4fb80799b Remove debug log 2012-07-11 23:40:28 +02:00
Tuncer Ayaz
015858b2d3 Simplify eunit 2012-07-11 20:36:41 +02:00
Tuncer Ayaz
990e60f120 Use filename:join 2012-07-11 18:44:48 +02:00
Tuncer Ayaz
f5af9d6c21 Fix rebar_eunit whitespace issues 2012-07-02 19:23:25 +02:00
Motiejus Jakštys
ad2f30ccb9 Fix cover crash if src_dirs is not default
Make sure files from erl_opts->src_dirs are copied to .eunit for cover
inspection.

Without this patch cover failed to find source files which were in
src_dirs, and threw the following exception:

ERROR: eunit failed while processing
/path/to/project:
{'EXIT',{{badmatch,{error,no_source_code_found}},
         [{rebar_eunit,'-cover_analyze/3-fun-0-',1,
                       [{file,"src/rebar_eunit.erl"},{line,280}]},
          {lists,foreach,2,[{file,"lists.erl"},{line,1262}]},
          {rebar_eunit,cover_analyze,3,
                       [{file,"src/rebar_eunit.erl"},{line,279}]},
          {rebar_eunit,eunit,2,[{file,"src/rebar_eunit.erl"},{line,140}]},
          {rebar_core,run_modules,4,[{file,"src/rebar_core.erl"},{line,425}]},
          {rebar_core,execute,5,[{file,"src/rebar_core.erl"},{line,359}]},
          {rebar_core,process_dir0,6,[{file,"src/rebar_core.erl"},{line,223}]},
          {rebar_core,process_dir,4,
                      [{file,"src/rebar_core.erl"},{line,130}]}]}}

Now all source files are copied to .eunit.
2012-07-02 18:46:00 +02:00
Tuncer Ayaz
e6165c7146 Fix #252 (Reported-by: Maxim-Vladimirsky) 2012-06-21 00:08:51 +02:00
Tuncer Ayaz
3dce05314b Fix rebar_eunit comments 2012-06-18 00:55:51 +02:00
Dave Smith
c86c99940d Remove ?FAIL in favor of ?ABORT 2012-06-08 07:06:15 -06:00
Jeremy Raymond
7e84634b8f Fix for destruction of config app vars on reset 2012-02-15 21:11:57 +01:00
Tuncer Ayaz
ee44d8554a Fix whitespace errors 2012-01-17 17:04:07 +01:00
Francis Joanis
b498e86ef7 Delete existing erl files in ?EUNIT_DIR
Before copying the .erl files to the .eunit directory ensure that they
are deleted if they already exist. This prevents EACCES errors to happen
when trying to re-copy .erl files that are read-only.
2012-01-17 16:54:27 +01:00
Tomas Abrahamsson
c8f56c7cb2 Don't kill any inet_gethost_native after eunit
Avoid error reports like this one:

  prompt$ rebar eunit
  ==> dummy (eunit)
    Test passed.

  =ERROR REPORT==== 29-Dec-2011::23:22:11 ===
  ** Generic server inet_gethost_native_sup terminating
  ** Last message in was {'EXIT',<0.62.0>,killed}
  ** When Server state == {state,inet_gethost_native,undefined,<0.62.0>,
                                 {local,inet_gethost_native_sup}}
  ** Reason for termination ==
  ** killed

Previously, it could happen if an eunit test did something that
required a name lookup, like in this example:

  -module(dummy_tests).
  -include_lib("eunit/include/eunit.hrl").

  x_test() ->
      {ok, _Hostent} = inet:gethostbyname(localhost).

The inet_gethost_native is a process, started on demand, under a
supervisor_bridge under the kernel_sup, but it is not a gen_server
process or the like, so it has nothing in '$ancestors' in its process
dictionary to indicate it is part of kernel.
2011-12-29 23:38:03 +01:00
Tuncer Ayaz
8c89a388bf Universally support apps=/skip_apps= 2011-12-12 21:20:34 +01:00
Klas Johansson
896e8505b2 Stop applications before killing extra processes
This means that applications get a chance to shut down themselves,
before rebar will start killing their processes.  This avoids ERROR
REPORTS from application supervisors.
2011-11-02 20:08:24 +01:00
Jon Meredith
5775746758 Remove modules that fail coverage from the list 2011-10-14 17:10:11 +02:00
Tuncer Ayaz
3e946a7d5c Fix cover_init call to use correct module list 2011-09-01 20:17:43 +02:00
Joseph Wayne Norton
b6f575c7fe Keep *_tests not automatically included by eunit 2011-09-01 19:23:46 +02:00
Alfonso De Gregorio
6f76d14499 Fix R13 compatibility (auto imported monitor/2) 2011-08-28 14:00:04 +02:00
Tuncer Ayaz
8376693a3f Fix Dialyzer warnings 2011-08-25 11:41:22 +02:00
Scott Lystig Fritchie
9832a5c5c6 Merge slf-eunit-process-isolation2 branch 2011-08-24 23:19:01 -05:00
Scott Lystig Fritchie
9c8b5e6c82 Check $ancestors for kernel OTP app processes to not kill 2011-08-24 12:11:48 -05:00
Scott Lystig Fritchie
0627075dd6 Add comments on pids not to kill 2011-08-23 17:32:07 -05:00
Scott Lystig Fritchie
b674ea19a4 Portability via filename:join/1 2011-08-23 14:22:04 -05:00
Scott Lystig Fritchie
f79290dc9c Replace sleep with pause_until_net_kernel_stopped() 2011-08-23 14:17:18 -05:00
Tuncer Ayaz
e6d1e13966 Apply Tidier suggestions 2011-08-20 18:33:36 +02:00
Scott Lystig Fritchie
34dd0ccdd9 EUnit: reset vm state after test run
Added new property to `eunit_opts` option list:

  reset_after_eunit::boolean() - default = true.
      If true, try to "reset" VM state to approximate state prior to
      running the EUnit tests:
          * Stop net_kernel if it was started
          * Stop OTP applications not running before EUnit tests were run
          * Kill processes not running before EUnit tests were run
          * Reset OTP application environment variables
2011-08-11 15:52:34 -05:00
David Reid
6736e3147e Fix handling of {already_started,Pid} from cover:start
Previous patch erroneously assumed that cover:start() returned
{already_started,Pid} in the cases where cover was already started. We
now turn {error,{already_started,Pid}} into {ok, Pid} and return
{error, Reason} if we encounter an error we do not know about, this
will cause a nice and violent badmatch to stop everything.
2011-08-10 18:32:58 +02:00
David Reid
0edf52b539 Redirect cover module output to .eunit/cover.log
The cover module calls io:format and io:fwrite directly for several types of
informational messages and warnings.  When using meck to mock covered modules
these warnings are triggered and can cause severe polution of the test output.

We can avoid this by starting cover explicitly then setting the group_leader
of that process to a file handle.
2011-08-05 10:04:14 -07:00
Andrew Thompson
2e654513dd Fix eunit regression (reported-by Alexander Dorofeev) 2011-04-23 17:17:49 +02:00