diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile | 2 | ||||
-rw-r--r-- | test/core_app.mk | 48 | ||||
-rw-r--r-- | test/core_deps.mk | 7 |
3 files changed, 54 insertions, 3 deletions
diff --git a/test/Makefile b/test/Makefile index dc11ccd..04b31af 100644 --- a/test/Makefile +++ b/test/Makefile @@ -192,7 +192,7 @@ pkg-$1: clean build $(eval @ = pkg-$1) # Get the real application's name. - $(eval APP_NAME = `sed '2!d;s/pkg_$1_name = //' ../index/$1.mk`) + $(eval APP_NAME := $(shell sed '2!d;s/pkg_$1_name = //' ../index/$1.mk)) $i "Bootstrap a new OTP library in packages/$1_pkg" $t mkdir -p packages/$1_pkg/ diff --git a/test/core_app.mk b/test/core_app.mk index f95d593..14720df 100644 --- a/test/core_app.mk +++ b/test/core_app.mk @@ -1,6 +1,6 @@ # Core: Building applications. -CORE_APP_CASES = asn1 auto-git-id erlc-exclude erlc-opts erlc-opts-filter error generate-erl generate-erl-include generate-erl-prepend hrl hrl-recursive mib no-app no-makedep pt pt-erlc-opts xrl xrl-include yrl yrl-include +CORE_APP_CASES = appsrc-change asn1 auto-git-id erlc-exclude erlc-opts erlc-opts-filter error generate-erl generate-erl-include generate-erl-prepend hrl hrl-recursive makefile-change mib no-app no-makedep pt pt-erlc-opts xrl xrl-include yrl yrl-include CORE_APP_TARGETS = $(addprefix core-app-,$(CORE_APP_CASES)) CORE_APP_CLEAN_TARGETS = $(addprefix clean-,$(CORE_APP_TARGETS)) @@ -13,6 +13,27 @@ $(CORE_APP_CLEAN_TARGETS): core-app: $(CORE_APP_TARGETS) +ifdef LEGACY +core-app-appsrc-change: build clean-core-app-appsrc-change + + $i "Bootstrap a new OTP application named $(APP)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v + + $i "Build the application" + $t $(MAKE) -C $(APP) $v + + $i "Touch the .app.src file; check that only the .app file gets rebuilt" + $t printf "%s\n" $(APP)/ebin/$(APP).app > $(APP)/EXPECT + $t $(SLEEP) + $t touch $(APP)/src/$(APP).app.src + $t $(SLEEP) + $t $(MAKE) -C $(APP) $v + $t find $(APP) -type f -newer $(APP)/src/$(APP).app.src | sort | diff $(APP)/EXPECT - + $t rm $(APP)/EXPECT +endif + core-app-asn1: build clean-core-app-asn1 $i "Bootstrap a new OTP library named $(APP)" @@ -738,6 +759,31 @@ endif [{module, M} = code:load_file(M) || M <- Mods], \ halt()" +core-app-makefile-change: build clean-core-app-makefile-change + + $i "Bootstrap a new OTP application named $(APP)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v + + $i "Build the application" + $t $(MAKE) -C $(APP) $v + + $i "Touch the Makefile; check that all files get rebuilt" + $t printf "%s\n" \ + $(APP)/$(APP).d \ + $(APP)/ebin/$(APP).app \ + $(APP)/ebin/$(APP)_app.beam \ + $(APP)/ebin/$(APP)_sup.beam \ + $(APP)/src/$(APP)_app.erl \ + $(APP)/src/$(APP)_sup.erl | sort > $(APP)/EXPECT + $t $(SLEEP) + $t touch $(APP)/Makefile + $t $(SLEEP) + $t $(MAKE) -C $(APP) $v + $t find $(APP) -type f -newer $(APP)/Makefile | sort | diff $(APP)/EXPECT - + $t rm $(APP)/EXPECT + core-app-mib: build clean-core-app-mib $i "Bootstrap a new OTP library named $(APP)" diff --git a/test/core_deps.mk b/test/core_deps.mk index aef7adb..e2e5be7 100644 --- a/test/core_deps.mk +++ b/test/core_deps.mk @@ -342,6 +342,9 @@ core-deps-apps-only: build clean-core-deps-apps-only $i "Create a new application my_app" $t $(MAKE) -C $(APP) new-app in=my_app $v + $i "Create a module my_server from gen_server template in my_app" + $t $(MAKE) -C $(APP) new t=gen_server n=my_server in=my_app $v + $i "Add Cowlib to the list of dependencies" $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\n"}' $(APP)/apps/my_app/Makefile @@ -353,12 +356,13 @@ core-deps-apps-only: build clean-core-deps-apps-only $t test -f $(APP)/apps/my_app/ebin/my_app.app $t test -f $(APP)/apps/my_app/ebin/my_app_app.beam $t test -f $(APP)/apps/my_app/ebin/my_app_sup.beam + $t test -f $(APP)/apps/my_app/ebin/my_server.beam $t test -d $(APP)/deps/cowlib/ $i "Check that the application was compiled correctly" $t $(ERL) -pa $(APP)/apps/*/ebin/ -eval " \ ok = application:load(my_app), \ - {ok, Mods = [my_app_app, my_app_sup]} = application:get_key(my_app, modules), \ + {ok, Mods = [my_app_app, my_app_sup, my_server]} = application:get_key(my_app, modules), \ [{module, M} = code:load_file(M) || M <- Mods], \ halt()" @@ -373,6 +377,7 @@ core-deps-apps-only: build clean-core-deps-apps-only $t test ! -e $(APP)/apps/my_app/ebin/my_app.app $t test ! -e $(APP)/apps/my_app/ebin/my_app_app.beam $t test ! -e $(APP)/apps/my_app/ebin/my_app_sup.beam + $t test ! -e $(APP)/apps/my_app/ebin/my_server.beam $i "Distclean the application" $t $(MAKE) -C $(APP) distclean $v |