diff options
author | Loïc Hoguin <[email protected]> | 2018-11-30 18:57:21 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-11-30 18:57:21 +0100 |
commit | 5ae9661dca352f16576860dad7eaaad45290312c (patch) | |
tree | 423f61456030a71f86202293942b2c1b11750696 /test | |
parent | f53fd8b42729937213a813622f6d4b54ebc09f4e (diff) | |
download | erlang.mk-5ae9661dca352f16576860dad7eaaad45290312c.tar.gz erlang.mk-5ae9661dca352f16576860dad7eaaad45290312c.tar.bz2 erlang.mk-5ae9661dca352f16576860dad7eaaad45290312c.zip |
Fix Dialyzer when a project has and uses parse transforms
Diffstat (limited to 'test')
-rw-r--r-- | test/core_app.mk | 3 | ||||
-rw-r--r-- | test/plugin_dialyzer.mk | 23 |
2 files changed, 23 insertions, 3 deletions
diff --git a/test/core_app.mk b/test/core_app.mk index 953603b..4c32178 100644 --- a/test/core_app.mk +++ b/test/core_app.mk @@ -1198,9 +1198,6 @@ core-app-pt: build clean "-module(my_user)." \ "-compile({parse_transform, my_pt})." > $(APP)/src/my_user.erl - $i "Compile my_pt first" - $t echo "COMPILE_FIRST += my_pt" >> $(APP)/Makefile - $i "Build the application; confirm the parse_transform is used" $t $(MAKE) -C $(APP) | grep "Running my_pt parse_transform." diff --git a/test/plugin_dialyzer.mk b/test/plugin_dialyzer.mk index 60dce34..c0229eb 100644 --- a/test/plugin_dialyzer.mk +++ b/test/plugin_dialyzer.mk @@ -303,3 +303,26 @@ dialyzer-plt-swallow-warnings: build clean $i "Create the PLT file" $t $(DIALYZER_MUTEX) $(MAKE) -C $(APP) plt $v + +dialyzer-pt: 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 parse_transform module" + $t printf "%s\n" \ + "-module(my_pt)." \ + "-export([parse_transform/2])." \ + "parse_transform(Forms, _) ->" \ + " io:format(\"# Running my_pt parse_transform.~n\")," \ + " Forms." > $(APP)/src/my_pt.erl + + $i "Generate a .erl file that uses the my_pt parse_transform" + $t printf "%s\n" \ + "-module(my_user)." \ + "-compile({parse_transform, my_pt})." > $(APP)/src/my_user.erl + + $i "Run Dialyzer" + $t $(DIALYZER_MUTEX) $(MAKE) -C $(APP) dialyze $v |