diff options
Diffstat (limited to 'test/core_app.mk')
-rw-r--r-- | test/core_app.mk | 78 |
1 files changed, 66 insertions, 12 deletions
diff --git a/test/core_app.mk b/test/core_app.mk index effc598..3eaf3bb 100644 --- a/test/core_app.mk +++ b/test/core_app.mk @@ -1,10 +1,10 @@ # Core: Building applications. -CORE_APP_TARGETS = $(call list_targets,core-app) +core_app_TARGETS = $(call list_targets,core-app) -.PHONY: core-app $(CORE_APP_TARGETS) +.PHONY: core-app $(core_app_TARGETS) -core-app: $(CORE_APP_TARGETS) +core-app: $(core_app_TARGETS) ifdef LEGACY core-app-appsrc-change: init @@ -235,7 +235,7 @@ core-app-auto-git-id: init $i "Make it a git repository" $t cd $(APP) && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -274,6 +274,59 @@ endif true = ID =/= [], \ halt()" +core-app-compile-first: init + + $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 .erl files" + $t echo "-module(boy)." > $(APP)/src/boy.erl + $t echo "-module(girl)." > $(APP)/src/girl.erl + $t echo "-module(first)." > $(APP)/src/first.erl + + $i "Define COMPILE_FIRST" + $t echo "COMPILE_FIRST = first" >> $(APP)/Makefile + + $i "Build the application" + $t $(MAKE) -C $(APP) $v + + $i "Check that the application was compiled correctly" + $t $(ERL) -pa $(APP)/ebin/ -eval " \ + ok = application:start($(APP)), \ + {ok, Mods = [boy, first, girl]} \ + = application:get_key($(APP), modules), \ + [{module, M} = code:load_file(M) || M <- Mods], \ + halt()" + +core-app-compile-first-sub-directory: init + + $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 .erl files" + $t echo "-module(boy)." > $(APP)/src/boy.erl + $t echo "-module(girl)." > $(APP)/src/girl.erl + $t mkdir $(APP)/src/sub/ + $t echo "-module(first)." > $(APP)/src/sub/first.erl + + $i "Define COMPILE_FIRST with a module in a sub-directory" + $t echo "COMPILE_FIRST = sub/first" >> $(APP)/Makefile + + $i "Build the application" + $t $(MAKE) -C $(APP) $v + + $i "Check that the application was compiled correctly" + $t $(ERL) -pa $(APP)/ebin/ -eval " \ + ok = application:start($(APP)), \ + {ok, Mods = [boy, first, girl]} \ + = application:get_key($(APP), modules), \ + [{module, M} = code:load_file(M) || M <- Mods], \ + halt()" + ifndef LEGACY core-app-env: init @@ -1262,7 +1315,7 @@ core-app-pt: init "-compile({parse_transform, my_pt})." > $(APP)/src/my_user.erl $i "Build the application; confirm the parse_transform is used" - $t $(MAKE) -C $(APP) | grep "Running my_pt parse_transform." + $t $(MAKE) -C $(APP) 2>&1 | grep "Running my_pt parse_transform." $i "Check that the application was compiled correctly" $t $(ERL) -pa $(APP)/ebin/ -eval " \ @@ -1302,7 +1355,7 @@ core-app-pt-erlc-opts: init $t echo "ERLC_OPTS += +'{parse_transform, my_pt}'" >> $(APP)/Makefile $i "Build the application; confirm the parse_transform is used" - $t $(MAKE) -C $(APP) | grep "Running my_pt parse_transform." + $t $(MAKE) -C $(APP) 2>&1 | grep "Running my_pt parse_transform." $i "Check that the application was compiled correctly" $t $(ERL) -pa $(APP)/ebin/ -eval " \ @@ -1442,11 +1495,11 @@ core-app-xrl-include: init $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v $i "Download a .xrl file with numerous includes from Gordon" - $t curl -s -o $(APP)/src/xfl_lexer.xrl https://raw.githubusercontent.com/hypernumbers/hypernumbers/master/lib/formula_engine-1.0/priv/xfl_lexer.xrl - $t curl -s -o $(APP)/src/errvals.hrl https://raw.githubusercontent.com/hypernumbers/hypernumbers/master/lib/hypernumbers-1.0/include/errvals.hrl - $t curl -s -o $(APP)/src/muin_proc_dict.hrl https://raw.githubusercontent.com/hypernumbers/hypernumbers/master/lib/hypernumbers-1.0/include/muin_proc_dict.hrl - $t curl -s -o $(APP)/src/muin_records.hrl https://raw.githubusercontent.com/hypernumbers/hypernumbers/master/lib/hypernumbers-1.0/include/muin_records.hrl - $t curl -s -o $(APP)/src/typechecks.hrl https://raw.githubusercontent.com/hypernumbers/hypernumbers/master/lib/hypernumbers-1.0/include/typechecks.hrl + $t curl -s -o $(APP)/src/xfl_lexer.xrl https://raw.githubusercontent.com/essen/hypernumbers/master/lib/formula_engine-1.0/priv/xfl_lexer.xrl + $t curl -s -o $(APP)/src/errvals.hrl https://raw.githubusercontent.com/essen/hypernumbers/master/lib/hypernumbers-1.0/include/errvals.hrl + $t curl -s -o $(APP)/src/muin_proc_dict.hrl https://raw.githubusercontent.com/essen/hypernumbers/master/lib/hypernumbers-1.0/include/muin_proc_dict.hrl + $t curl -s -o $(APP)/src/muin_records.hrl https://raw.githubusercontent.com/essen/hypernumbers/master/lib/hypernumbers-1.0/include/muin_records.hrl + $t curl -s -o $(APP)/src/typechecks.hrl https://raw.githubusercontent.com/essen/hypernumbers/master/lib/hypernumbers-1.0/include/typechecks.hrl $i "Generate unrelated .erl files" $t echo "-module(boy)." > $(APP)/src/boy.erl @@ -1699,7 +1752,8 @@ core-app-yrl-header: init $t echo "-export([forty_two/0])." > $(APP)/include/yecc_header.hrl # A bunch of gobbldygook we don't actually care about, they just # need to exist so we don't get errors. - $t echo "-export([yeccpars1/5, yeccerror/1, yeccpars2/7, yeccpars2_0/7, yeccpars2_1/7, yeccpars2_2/7, yeccpars2_3/7, yeccpars2_5/7, yeccpars2_6/7, yeccpars2_7/7, yeccpars2_9/7, yeccpars2_11/7, 'yeccgoto_\'E\''/7, 'yeccgoto_\'F\''/7, 'yeccgoto_\'T\''/7, yeccpars2_9_/1, yeccpars2_11_/1, yeccpars2_7_/1])." >> $(APP)/include/yecc_header.hrl + $t echo "-export([yeccpars1/5])." >> $(APP)/include/yecc_header.hrl + $t echo "-export([yeccerror/1])." >> $(APP)/include/yecc_header.hrl $t echo "yeccpars1(_,_,_,_,_) -> throw(not_implemented)." >> $(APP)/include/yecc_header.hrl $t echo "yeccerror(_) -> throw(not_implemented)." >> $(APP)/include/yecc_header.hrl # Required bits done, now part we'll actually test for. |