From 99fe270e59b44526b43f2b8d93d51b20d45b62d3 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sun, 20 Apr 2014 11:59:41 +0200 Subject: Fix #267 (code path regression) Since the introduction of -r/--recursive, deps were not properly added to the code path when running ct, eunit, etc. To fix that, pass a flag down to process_dir1 and conditionalize execution of the command. This moves the decision into process_dir1 where we can decide to invoke preprocess/2 and postprocess/2 but not execute the command. Without this fix, you'd have to, for example, invoke 'rebar -r ct skip_deps=true', if you wanted to run base_dir's ct suites with deps on the code path (while skipping all non-base_dir ct suites). So, with this patch applied, if you run $ rebar ct deps will be on the code path, and only base_dir's ct suites will be tested. If you want to test ct suites in base_dir and sub_dirs, you have to run $ rebar -r ct skip_deps=true If you want to test ct suites in all dirs, you have to run $ rebar -r ct The fix is not specific to ct and applies to all commands. To be able to add inttest/code_path_no_recurse/deps, I had to fix .gitignore. While at it, I've updated and fixed all entries. --- inttest/code_path_no_recurse/deps/bazdep/src/bazdep.app.src | 12 ++++++++++++ inttest/code_path_no_recurse/deps/bazdep/src/bazdep.erl | 6 ++++++ .../code_path_no_recurse/deps/bazdep/test/bazdep_tests.erl | 5 +++++ inttest/code_path_no_recurse/deps/foodep/rebar.config | 1 + inttest/code_path_no_recurse/deps/foodep/src/foodep.app.src | 12 ++++++++++++ inttest/code_path_no_recurse/deps/foodep/src/foodep.erl | 6 ++++++ .../code_path_no_recurse/deps/foodep/test/foodep_tests.erl | 5 +++++ .../deps/unuseddep/src/unuseddep.app.src | 12 ++++++++++++ .../code_path_no_recurse/deps/unuseddep/src/unuseddep.erl | 6 ++++++ 9 files changed, 65 insertions(+) create mode 100644 inttest/code_path_no_recurse/deps/bazdep/src/bazdep.app.src create mode 100644 inttest/code_path_no_recurse/deps/bazdep/src/bazdep.erl create mode 100644 inttest/code_path_no_recurse/deps/bazdep/test/bazdep_tests.erl create mode 100644 inttest/code_path_no_recurse/deps/foodep/rebar.config create mode 100644 inttest/code_path_no_recurse/deps/foodep/src/foodep.app.src create mode 100644 inttest/code_path_no_recurse/deps/foodep/src/foodep.erl create mode 100644 inttest/code_path_no_recurse/deps/foodep/test/foodep_tests.erl create mode 100644 inttest/code_path_no_recurse/deps/unuseddep/src/unuseddep.app.src create mode 100644 inttest/code_path_no_recurse/deps/unuseddep/src/unuseddep.erl (limited to 'inttest/code_path_no_recurse/deps') diff --git a/inttest/code_path_no_recurse/deps/bazdep/src/bazdep.app.src b/inttest/code_path_no_recurse/deps/bazdep/src/bazdep.app.src new file mode 100644 index 0000000..7f7b3f9 --- /dev/null +++ b/inttest/code_path_no_recurse/deps/bazdep/src/bazdep.app.src @@ -0,0 +1,12 @@ +{application, bazdep, + [ + {description, ""}, + {vsn, "1"}, + {registered, []}, + {applications, [ + kernel, + stdlib + ]}, + {mod, {bazdep, []}}, + {env, []} + ]}. diff --git a/inttest/code_path_no_recurse/deps/bazdep/src/bazdep.erl b/inttest/code_path_no_recurse/deps/bazdep/src/bazdep.erl new file mode 100644 index 0000000..aef4cf3 --- /dev/null +++ b/inttest/code_path_no_recurse/deps/bazdep/src/bazdep.erl @@ -0,0 +1,6 @@ +-module(bazdep). + +-export([bazdep/0]). + +bazdep() -> + bazdep. diff --git a/inttest/code_path_no_recurse/deps/bazdep/test/bazdep_tests.erl b/inttest/code_path_no_recurse/deps/bazdep/test/bazdep_tests.erl new file mode 100644 index 0000000..b5190f6 --- /dev/null +++ b/inttest/code_path_no_recurse/deps/bazdep/test/bazdep_tests.erl @@ -0,0 +1,5 @@ +-module(bazdep_tests). +-include_lib("eunit/include/eunit.hrl"). + +bazdep_test() -> + ?assert(bazdep:bazdep() =:= bazdep). diff --git a/inttest/code_path_no_recurse/deps/foodep/rebar.config b/inttest/code_path_no_recurse/deps/foodep/rebar.config new file mode 100644 index 0000000..cdaf168 --- /dev/null +++ b/inttest/code_path_no_recurse/deps/foodep/rebar.config @@ -0,0 +1 @@ +{deps, [{bazdep, "1"}]}. diff --git a/inttest/code_path_no_recurse/deps/foodep/src/foodep.app.src b/inttest/code_path_no_recurse/deps/foodep/src/foodep.app.src new file mode 100644 index 0000000..c0642fb --- /dev/null +++ b/inttest/code_path_no_recurse/deps/foodep/src/foodep.app.src @@ -0,0 +1,12 @@ +{application, foodep, + [ + {description, ""}, + {vsn, "1"}, + {registered, []}, + {applications, [ + kernel, + stdlib + ]}, + {mod, {foodep, []}}, + {env, []} + ]}. diff --git a/inttest/code_path_no_recurse/deps/foodep/src/foodep.erl b/inttest/code_path_no_recurse/deps/foodep/src/foodep.erl new file mode 100644 index 0000000..3d43d0e --- /dev/null +++ b/inttest/code_path_no_recurse/deps/foodep/src/foodep.erl @@ -0,0 +1,6 @@ +-module(foodep). + +-export([foodep/0]). + +foodep() -> + bazdep:bazdep() =:= bazdep. diff --git a/inttest/code_path_no_recurse/deps/foodep/test/foodep_tests.erl b/inttest/code_path_no_recurse/deps/foodep/test/foodep_tests.erl new file mode 100644 index 0000000..66d7b8b --- /dev/null +++ b/inttest/code_path_no_recurse/deps/foodep/test/foodep_tests.erl @@ -0,0 +1,5 @@ +-module(foodep_tests). +-include_lib("eunit/include/eunit.hrl"). + +foodep_test() -> + ?assert(foodep:foodep()). diff --git a/inttest/code_path_no_recurse/deps/unuseddep/src/unuseddep.app.src b/inttest/code_path_no_recurse/deps/unuseddep/src/unuseddep.app.src new file mode 100644 index 0000000..d0bc233 --- /dev/null +++ b/inttest/code_path_no_recurse/deps/unuseddep/src/unuseddep.app.src @@ -0,0 +1,12 @@ +{application, unuseddep, + [ + {description, ""}, + {vsn, "1"}, + {registered, []}, + {applications, [ + kernel, + stdlib + ]}, + {mod, {unuseddep, []}}, + {env, []} + ]}. diff --git a/inttest/code_path_no_recurse/deps/unuseddep/src/unuseddep.erl b/inttest/code_path_no_recurse/deps/unuseddep/src/unuseddep.erl new file mode 100644 index 0000000..a990345 --- /dev/null +++ b/inttest/code_path_no_recurse/deps/unuseddep/src/unuseddep.erl @@ -0,0 +1,6 @@ +-module(unuseddep). + +-export([unuseddep/0]). + +unuseddep() -> + unuseddep. -- cgit v1.1