Commit graph

52 commits

Author SHA1 Message Date
Vlad Dumitrescu
797d2b6937 add tests for 'compiler keep_going' 2015-04-02 16:55:48 +02:00
Mark Anderson
e211afdce6 Change env var delimiter to match non-word
If I pass an expression like: "$PWD/deps/local/lib" in the port env
string, it expands to "/deps/local/lib", (variable is expanded to the
empty string) but if I pass "${PWD}/deps/local/lib" it expands
properly. I found that confusing.

This was because we require environment vars to end with whitespace,
while I think requiring a non-word character would be sufficient, since
the variables can only contain word characters.

This changes the expansion system to recognize variables that are
terminated by non word characters.

This includes some fixes as per some comments by tuncer.

Fixes rebar/rebar#457
2015-02-23 19:11:51 -08:00
Roberto Aloi
0d5416218b Exit with proper status code if 'eval' fails 2015-01-23 08:31:58 +01:00
Сергей Прохоров
0a1961fb0d Fixed #133. Release upgrade handle long and short names properly.
Implemented, by moving upgrade functionality from install_upgrade.escript
to nodetool, which already supports both short and long names.
Make install_upgrade.escript as wrapper for nodetool for backward compatibility.
2015-01-20 10:18:10 +03:00
Vlad Dumitrescu
aa5b8ac772 add Emacs/vi header to non-dummy test modules 2014-12-02 10:52:45 +01:00
Tuncer Ayaz
a4c5f3357f Treat vsn mismatch as warning if -k/--keep-going
Fixes #319.
2014-11-25 18:44:21 +01:00
Fred Hebert
c54d496030 Additional fixes and modification
- Updating documentation to be more accurate
- Style fixes
- More precise error messages
2014-11-21 10:11:13 -05:00
Fred Hebert
b41086ba98 Merge branch 'fix_upgrade_error' of https://github.com/terrencehan/rebar into terrencehan-fix_upgrade_error 2014-11-21 09:59:46 -05:00
Roberto Aloi
93ccbf936c Implement eval command via nodetool 2014-10-21 14:22:37 +02:00
Adam Lindberg
ec6ff3597d Escape more characters in path (fix #367) 2014-10-14 12:29:40 +02:00
Evan Vigil-McClanahan
ba466e2d38 Manually clean up paths
Using code:set_path/1 with very large paths is very slow on larger
projects.  On my mid-sized project, it seems to take around .4s per
call.  Emulating the call with direct path removal (using
code:del_path/1) seems to be quite a lot faster.
2014-08-18 13:56:19 -07:00
Tuncer Ayaz
38934da869 Follow-up typo fixes for #327 2014-07-17 22:20:51 +02:00
Tuncer Ayaz
9b060f2de9 rebar_utils:otp_release/0: handle vsn like x.y.z**
As mentioned in the OTP documentation, licensed customers may use
patched OTP installations where the otp_patch_apply tool adds a '**'
suffix as a flag saying the system consists of application versions from
multiple OTP versions. When we get such a version string, we drop the
suffix, as we cannot obtain relevant information from it as far as
tooling is concerned.
2014-07-17 21:18:43 +02:00
Tuncer Ayaz
873d236ce9 Adapt arch string to versioning scheme changes (>= 17.x) 2014-07-17 18:53:58 +02:00
terrencehan
a17ee35004 Fix upgrade error 2014-06-20 16:32:26 +08:00
Sergey Savenko
93689703c1 Add qualified name tests specification (see #118)
Augment 'tests' option of 'rebar eunit' command with ability to specify
tests to run using module-qualified names. This change also forced me
to change the way modules for coverage and for testing itself are
selected - module-qualified tests specifications are now taken into
consideration. Extend tests to cover new functionality. Update
dialyzer_reference accordingly.
2014-05-29 22:38:14 +04:00
Tuncer Ayaz
e1eec02c80 file_utils: properly report errors (fix #95)
While at it, improve the error message printed by rebar_utils:sh/2.
2014-04-11 15:01:26 +02:00
Joseph Wayne Norton
def6b8c98d Add partial support for Erlang/OTP 17
Allow rebar to compile applications using Erlang/OTP 17 and older
versions.  This patch only provides partial support since the rebar
tool itself must be compiled using an Erlang/OTP version that is older
than 17.
2014-03-29 23:22:47 -05:00
Dave Smith
a5be40c969 Merge branch 'xref_20130130' of git://github.com/spilgames/rebar into spg-xref
Conflicts:
	src/rebar_xref.erl
2013-06-17 16:31:09 -06:00
Dave Smith
c5e8671ef6 Merge pull request #53 from oferrigni/unit_test_file_handling_fix
Fix file handling on windows for tests
2013-06-16 06:23:54 -07:00
Tuncer Ayaz
500b62a890 Sync test/upgrade_project/rel/files with priv/templates 2013-06-12 17:01:57 +02:00
olgeni
505458eecb Use "pwd -P" to get the current physical path.
It is a portable version of the realpath(1) utility that you can find on
Mac OS X and FreeBSD (see also The Open Group Base Specifications Issue
6, IEEE Std 1003.1).

Without the -P flag, pwd(1) might return different values when the
current path contains one or more symlinks, depending on how you got
into the current directory.

In simplenode.runner, this may cause PIPE_DIR to have different values
on each use, which will make it impossible to connect to the running
node unless you guess the correct path yourself.
2013-06-10 22:15:49 +02:00
Dennis Docter
61e79afd80 Add standard xref checks and improved suppression
* Allow the following predefined analyses :
   undefined_function_calls, undefined_functions, locals_not_used,
   exports_not_used, deprecated_function_calls, deprecated_functions

* Trap some possible errors in case module information is not
    available

* ignore_xref works on all checks and can take {M,F,A} tuples.
  (Automatic behaviour export suppression still only works on
  exports_not_used)
2013-01-30 15:26:01 +01:00
Oliver Ferrigni
d893708563 Fix file handling on windows for tests
Running tests on windows creates false positive due to setup failures
not executing all tests.  Checking for tmp_dir was failing on
subsequent runs.  Added cases to tmp_dir creation to delete preexisting
tmp_dirs in .eunit directory.
2013-01-14 15:16:13 -06:00
Shunichi Shinohara
22b703efa8 eunit: analyze coverage only for cover compiled modules
This change fixes #310.
2012-09-13 22:30:30 +02:00
Tuncer Ayaz
3c0d97bf2c Cleanup and comment 2012-08-20 13:55:55 +02:00
Roberto Ostinelli
60516dc406 Fix tests= option not running generator tests 2012-08-20 12:58:34 +02:00
Roberto Ostinelli
fa6618f2b4 Add experimental tests= filter without eunit suites 2012-08-20 12:58:31 +02:00
Roberto Ostinelli
69dc9ec933 Add experimental tests= filter for eunit suites 2012-08-11 23:08:21 +02:00
Tuncer Ayaz
e47d643ea3 Use separate dirs for eunit and qc 2012-08-09 18:37:26 +02:00
Tuncer Ayaz
e75a97ad33 Add 'qc' cmd and rename eunit-compile to test-compile 2012-07-23 16:22:06 +02:00
Slava Yurin
22dec4cbb7 Fix test/rebar_eunit_tests.erl 2012-06-29 12:41:22 +02:00
joewilliams
d726e598b5 Add support for using -remsh via runner script 2012-04-23 11:08:19 -07:00
joewilliams
26e1252250 add more info to readme 2012-03-31 13:05:02 -07:00
joewilliams
b7bcf5528b Handle vm.args properly while building upgrades
This patch corrects the vm.args behavior while building upgrade tarballs
by copying the file from the release into the upgrade. Additionally it
patches the dummy runner script in the upgrade test project to work
properly.
2011-10-05 20:23:07 -07:00
joewilliams
cb5056b2e3 Get rid of app.config
app.config has been a long standing erroneous file in rebar. Erlang/OTP
documentation suggests a sys.config file instead. This file is stored in
the releases/VSN directory. This does a few things but most importantly
it ensures your config (contained in the application environment)
survives a hot upgrade. It also has the advantage of allowing the
configuration of the application to be versioned along side the
application code. This patch flips rebar to use sys.config rather than
app.config.

Additionally it makes this flip to vm.args as well, making them
versioned just like sys.config.

This patch also includes runner script changes to support the old
etc/app.config config file location and support for Windows.

Thanks to mokele for the initial work and kick in the pants to make this
finially happen.
2011-09-20 09:44:41 -07:00
Tuncer Ayaz
4f41e742d3 rebar_eunit_tests: avoid repetition 2011-08-07 16:21:43 +02:00
Tuncer Ayaz
e3fe1c6903 rebar_eunit_tests: check return values 2011-08-07 16:21:40 +02:00
Tuncer Ayaz
5f2930b701 Fix whitespace errors in unit tests 2011-08-05 01:52:33 +02:00
Tuncer Ayaz
e21166ae6f Sync rel/files in dummy project with templates 2011-07-18 18:58:20 +02:00
Tuncer Ayaz
25c0226ab9 Update runner script in test project 2011-03-04 19:39:45 +01:00
joewilliams
11bf6b4aab Add 'generate-appups' command
To further support OTP releases I have added support for generating
application appup files. These include instructions that systools uses
to generate a relup file which contains the low level instructions
needed to perform a hot code upgrade. My goal with this module is to
produce "good enough" appup files or at least a skeleton to help one get
started with something more complex. If an appup file already exists for
an application this command will not attempt to create a new one.

Usage:
$ rebar generate-appups previous_release=/path/to/old/version

Generally this command will be run just before 'generate-upgrade'.
2011-02-15 18:33:18 +01:00
Tuncer Ayaz
c466076ffb Clean up emacs file local variables 2011-01-31 17:55:36 +01:00
Tuncer Ayaz
1ee21c523f Update nodetool in upgrade_project 2011-01-31 17:55:02 +01:00
Tuncer Ayaz
b18194e24d Fix file existence checks 2011-01-29 17:37:15 +01:00
joewilliams
5298e93a18 Add 'generate-upgrade' command
To support OTP release upgrades I have added support for building
upgrade packages. Support for this is included in the
rebar_upgrade module, specifically generate_upgrade/2. It requires
one variable to be set on the command line 'previous_release' which
is the absolute path or relative path from 'rel/' to the previous
release one is upgrading from. Running an upgrade will create the
needed files, including a relup and result in a tarball containing
the upgrade being written to 'rel/'. When done it cleans up the
temporary files systools created.

Usage:
$ rebar generate-upgrade previous_release=/path/to/old/version

This also includes a dummy application that can be used to test
upgrades as well as an example.

Special thanks to Daniel Reverri, Jesper Louis Andersen and
Richard Jones for comments and patches.
2011-01-27 18:37:39 +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
Juhani Rankimies
80c065191f Port rebar_eunit_tests to Windows 2010-10-27 11:39:12 -06:00
Juhani Rankimies
fd5ebe69a4 Port rebar_file_utils to Windows
Modify rm_rf and cp_r to work when {win32,_} = os:type().
Simplify rm_rf to only accept one filename, directoryname or wildcard.
Add unit tests to ensure a similar behaviour on windows and unix.

Thanks to tuncer for guidance and feedback.
2010-10-27 11:39:12 -06:00