aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Jurewicz <[email protected]>2018-05-30 21:01:33 +0200
committerLoïc Hoguin <[email protected]>2018-05-31 16:09:38 +0200
commitdfe090d1b44771019a59cf79a14e0957d8d5fc16 (patch)
tree67ff7a0f1de03293b831fa14743e537c3662059e
parent9fff0a15b957e8dcf768475372e0c959e576d13b (diff)
downloaderlang.mk-dfe090d1b44771019a59cf79a14e0957d8d5fc16.tar.gz
erlang.mk-dfe090d1b44771019a59cf79a14e0957d8d5fc16.tar.bz2
erlang.mk-dfe090d1b44771019a59cf79a14e0957d8d5fc16.zip
Add $(TEST_DIR) to the default value of SHELL_PATHS
-rw-r--r--doc/src/guide/shell.asciidoc4
-rw-r--r--plugins/shell.mk2
-rw-r--r--test/plugin_shell.mk15
3 files changed, 20 insertions, 1 deletions
diff --git a/doc/src/guide/shell.asciidoc b/doc/src/guide/shell.asciidoc
index a527253..5484b9d 100644
--- a/doc/src/guide/shell.asciidoc
+++ b/doc/src/guide/shell.asciidoc
@@ -44,3 +44,7 @@ $ make shell
The shell can be stopped as usual with a double Ctrl+C or the
command `q().`.
+
+Note that the `shell` target does not build the application. To do it,
+use either the `app` target or, if you want to include also test
+modules, the `test-build` target. \ No newline at end of file
diff --git a/plugins/shell.mk b/plugins/shell.mk
index 00d2c52..c9e9975 100644
--- a/plugins/shell.mk
+++ b/plugins/shell.mk
@@ -7,7 +7,7 @@
# Configuration.
SHELL_ERL ?= erl
-SHELL_PATHS ?= $(CURDIR)/ebin $(APPS_DIR)/*/ebin $(DEPS_DIR)/*/ebin
+SHELL_PATHS ?= $(CURDIR)/ebin $(APPS_DIR)/*/ebin $(DEPS_DIR)/*/ebin $(TEST_DIR)
SHELL_OPTS ?=
ALL_SHELL_DEPS_DIRS = $(addprefix $(DEPS_DIR)/,$(SHELL_DEPS))
diff --git a/test/plugin_shell.mk b/test/plugin_shell.mk
index 0e9ee39..dea4ca1 100644
--- a/test/plugin_shell.mk
+++ b/test/plugin_shell.mk
@@ -28,3 +28,18 @@ shell-kjell: build clean
$i "Run the shell"
$t $(MAKE) -C $(APP) shell SHELL_OPTS="-eval 'halt()'" $v
+
+shell-test-dir: build clean
+
+ $i "Bootstrap a new OTP library named $(APP)"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
+
+ $i "Generate a module in TEST_DIR"
+ $t mkdir $(APP)/test
+ $t printf "%s\n" \
+ "-module(foo)." > $(APP)/test/foo.erl
+
+ $i "Check that the module is visible"
+ $t $(MAKE) -C $(APP) test-build shell SHELL_OPTS="-eval 'foo:module_info()' -eval 'halt()'" $v