Commit graph

60 commits

Author SHA1 Message Date
Igor Savchuk
d5d691d7f7 Fix app.config argument passing when using ct_run (take 2)
ct_run has changed its config key from -ct_config to -config,
thus, -config key, used to specify app.config now must be
placed after -erl_args
2014-12-22 21:36:41 +03:00
Fred Hebert
ae7a7aae18 Revert "Merge branch 'kittee-ct_appconfig_fix'"
This reverts commit 3c0f420c2a, reversing
changes made to 8f64e13184.
2014-12-21 15:25:00 -05:00
Fred Hebert
440d73825b Merge branch 'ct_appconfig_fix' of https://github.com/kittee/rebar into kittee-ct_appconfig_fix
Conflicts:
	THANKS
2014-12-21 15:17:03 -05:00
stwind
a83c80d4c0 Fix deps path check in rebar_ct:collect_glob/3
Since rebar_deps:get_deps_dir/1 returns an absolute path,
lists:member(Deps, Parts2) will always return false, thus .test.spec
files in deps/ will not be ignored.
2014-12-11 11:59:40 +08:00
Igor Savchuk
bc46b501d0 Fix app.config argument passing when using ct_run
ct_run has changed its config key from -ct_config to -config,
thus, -config key, used to specify app.config now must be
placed after -erl_args
2014-11-28 16:48:47 +03:00
Fred Hebert
dcfa6daf30 Merge branch 'erl-args-to-end' of https://github.com/NineFX/rebar into NineFX-erl-args-to-end
Conflicts:
	THANKS
2014-07-15 08:20:29 -04:00
varnerac-ubnt
35ee457176 Fix bug 271
Moves ct_extra_params to the end of the generated ct_run command.
This allows users to pass commands to the underlying emulator
using -erl_args. The included rt test demonstrates that it is
possible to pass an addtional option to ct_run and -erl_args at
the same time. Finally, the test executes in regular and verbose
modes because rebar constructs the ct_run command differently in
verbose mode.
2014-06-27 15:35:56 -05:00
YAMAMOTO Takashi
5e91322e4a use the effective deps dir instead of hardcoding "deps"
suggested by @tuncer
2014-05-30 14:48:15 +09:00
YAMAMOTO Takashi
ad588a70b7 fix double "the" in a comment
noted by @tuncer
2014-05-30 14:38:39 +09:00
YAMAMOTO Takashi
9713dafcb5 Fix spec file look up
When trying to skip spec files under deps/ directory,
ignore "deps" component which is also included in Cwd.
For example, "/home/deps/src/myapp/test/cover.spec"
contains "deps" component but should not be skipped if
Cwd is "/home/deps/src/myapp/".
2014-05-30 14:37:37 +09:00
YAMAMOTO Takashi
7fd5a2d630 Fix a format of a debug output 2014-05-30 14:37:37 +09:00
Andrew J. Stone
cc72cd8fce allow suite[s] or test[s] as options for eunit and ct 2014-02-05 16:56:44 -05:00
Tuncer Ayaz
277a10cd3b Fix is_verbose/1 helper function 2013-12-06 21:39:53 +01:00
Björn Bylander
1dfe56b3c6 Change rebar_ct:check_log/3 to use double quotes
The call to the grep program in rebar_ct:check_log/3 used single
quotation marks around the strings grep should search for. This works
well in most cases but fails on Windows 7 using GNU grep 2.5.4 as
installed by the Chocolatey package GnuWin 0.6.3.1 with the follow
message:

ERROR: cmd /q /c grep -e 'TEST COMPLETE' -e '{error,make_failed}'
ct/raw.log
failed with error: 2 and output:
grep: COMPLETE': No such file or directory

This commit changes the single quotation marks to double quotation
marks. I've tested this using GNU grep 2.5.3 on a Debian Linux machine
and it works well.
2013-09-20 15:12:21 +02:00
Dave Smith
96c7bd7338 Make sure to run ct_run w/ -noshell 2013-06-25 16:33:34 -06:00
Dave Smith
9cf7cf7cb0 Use ct_run if available; fixes strange issues with getting erl/ct to stop 2013-06-25 15:59:19 -06:00
Tuncer Ayaz
edd835510b rebar_ct: fix Dialyzer warning caused by bcc57e9b
Also fix a single line exceeding max column.
2013-06-24 21:46:24 +02:00
Fred Hebert
bcc57e9b04 Handle ct_run exit codes in R15B02 and later
Since R15B02, ct_run returns a non-zero exit code when some tests
failed or were auto-skipped. (See ticket OTP-9865.)

This fix makes it so a non-0 code doesn't cause an instant failure, but
still prompts for log verification before doing so. Given the behaviour
was acceptable for pre-R15B02, it should be valid with it with
post-R15B02.

The fix should also be backwards compatible.
2013-04-18 22:45:46 -04:00
Tuncer Ayaz
4b8c81fb53 Implement 'rebar help CMD1 CMD2' and extend common 'rebar help' msg
* allow plugins to print help message for implemented commands
* append core rebar.config options to common 'rebar help' message
2012-12-31 20:45:11 +01:00
Tuncer Ayaz
abb319d10a rebar_ct: fix wording in comments 2012-11-18 23:36:59 +01:00
Arjan Scherpenisse
cc67814b65 ct: skip instead of halt on missing/unknown suite
This allows `rebar ct suites=abc` to consider all suites when
you have a rebar setup with multiple sub_dirs.

Previously, rebar halted after it could not find the suite in the
first dir. But the suite might be present in another dir (when
sub_dirs contains multiple dirs).

This commit makes it so instead of halting, it prints a warning and
continues with looking for the suite in the other `sub_dir`s.

Note -- This uses try/catch to cause the test to be skipped because
otherwise I needed to adjust the return values of 4 functions, the
code path is pretty deeply nested here. Otherwise the whole call chain
needed to be adjusted for this return value:

`run_test -> make_cmd -> get_suites -> find_suite_path`

IMHO, I think for exceptional cases like this it is fine to use throw;
specially since only the {skip} is catched and nothing else.
2012-10-31 20:37:42 -06:00
Tuncer Ayaz
d22a2bb81f rebar_ct: ?DEBUG log ct_run command 2012-09-03 11:40:53 +02:00
Tuncer Ayaz
f460eb14bc rebar_ct: do not export variable from case 2012-09-02 21:30:59 +02:00
Tuncer Ayaz
f528c397f8 Fix whitespace errors in rebar_ct and rebar_eunit 2012-08-22 19:14:35 +02:00
Tuncer Ayaz
9dd8e7f2ee Fix #295 (consider *_SUITE.beam in ct skip check) 2012-08-19 15:25:13 +02:00
DeadZen
f1d35f9d06 Add ct_log_dir option, skip test dir with no SUITE
When rebar ct executes with its default common test directory of "test",
it will generate a hardcoded "logs" directory in every application with
a test directory present, causing an overlap with eunit's test framework
so even test directories with only eunit tests will be processed by ct.
2012-08-07 14:22:59 +02:00
Tuncer Ayaz
636c02f0be Fix R13B03 build (Reported-by: Sergey Nartimov) 2012-07-28 19:51:57 +02:00
Tuncer Ayaz
c0644dc195 Finalize app=, skip_app=, suite= deprecations 2012-07-23 16:48:15 +02:00
Tuncer Ayaz
252757c753 Do not use application:set_env 2012-07-23 13:17:11 +02:00
Tuncer Ayaz
b9c6888883 rebar_ct: rename function for clarity 2012-06-21 00:06:40 +02:00
Dave Smith
9ec6f37444 Merge pull request #230 from hyperthunk/ct-name
Support ct_run using short name
2012-06-08 07:11:00 -07:00
Dave Smith
c86c99940d Remove ?FAIL in favor of ?ABORT 2012-06-08 07:06:15 -06:00
Tim Watson
bebd9d2ae6 Support ct_run using short name
Not every system under test can be run with long names, and this makes
rebar's common_test support useless in those environments, as it
currently uses long names (test@hostname.domain) by default, without
recourse to change them.

This patch adds support for a {ct_use_short_names, boolean()} config
variable, which allows the user to specify whether short or long names
are required.
2012-05-22 15:50:26 +01:00
Tuncer Ayaz
015e58201c Support different log levels 2012-01-17 17:04:07 +01:00
Magnus Klaar
4db90bafef Deprecate ct suite= option for suites= option 2012-01-06 20:40:46 +01:00
Tim Watson
286a2a88a4 Add support for customising common test directory
This patch allows users to specify the directory in which common_test
source files can be found. Most common_test suites are integration,
rather than unit tests and keeping the sources apart from test sources
for other frameworks such as eunit and PropEr is a useful feature.
2011-12-28 12:41:36 +01:00
Tuncer Ayaz
8c89a388bf Universally support apps=/skip_apps= 2011-12-12 21:20:34 +01:00
Jan Klötzke
3f9b346dec Fix the 'ct' target to work on Windows with MSYS 2011-10-20 16:27:35 +02:00
Tino Breddin
578ba06ad9 Add awareness of 'app' parameter to ct module 2011-08-04 18:38:49 +02:00
Tuncer Ayaz
4e0ab4065f Fix grep portability (Reported-by: Andrew Thompson) 2011-07-14 13:03:54 +02:00
Tim Watson
2d385970bf Pass extra params to ct (thanks Mickael Remond)
This patch adds a `ct_extra_params` option to rebar.config, the value
of which is appended to the shell command when executing common test.
2011-04-06 20:11:13 +02:00
Tuncer Ayaz
2ee4899d24 Fix code clarity and formatting 2011-03-22 11:12:57 +01:00
Shunichi Shinohara
cd3653616b Fix ct include option prefix 2011-03-22 11:08:45 +01:00
Tim Watson
3db8f585f1 Add -spec support to rebar_ct command line
This change adds support for executing ct test runs based on test
specificiations, which was missing previously. The rebar_ct module
now looks for any number of files with a name ending in `test.spec`
and if it finds one or more, passes these after the `-spec` argument
to ct_run instead of explicitly configuring the config, user config
and coverage config variables.

When no specifications are found, then the module behaves as it did
before this change, and both the ct1 and (new) ct2 integration tests
appear to show this is a backwards compatible patch.
2011-02-21 15:08:24 +01:00
Tuncer Ayaz
63de05d914 Clean up code 2011-02-06 17:41:04 +01:00
Tuncer Ayaz
c466076ffb Clean up emacs file local variables 2011-01-31 17:55:36 +01:00
Tuncer Ayaz
bb6731208e Fix indentation in rebar_ct 2011-01-13 17:39:14 +01:00
Tuncer Ayaz
e4036cbe56 Apply Tidier suggestions 2011-01-13 17:39:14 +01:00
Juhani Rankimies
52ca7795fe Unify executable invocation
Add flags to rebar_utils:sh to control output and error handling.
Replace calls to os:cmd with calls to rebar_utils:sh.
2011-01-06 15:02:19 +01:00
Benjamin Nortier
ab4e0a32ab Add rebar code path to common test code path 2010-12-09 00:20:54 +01:00