Merge pull request #41 from tuncer/ci-dialyze

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ddcf8dd..c29e0e3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,10 +22,9 @@
 
 .build_job_template: &build_job_definition
   stage: build
+  image: erlang:20-alpine
   script:
-    - make
-    - ./rebar check-plt || ./rebar -vv build-plt
-    - ./rebar -vv dialyze
+    - ./rebar compile
     - rm .rebar/erlcinfo
 
 .artifact_paths_template: &artifact_paths_defitinion
@@ -35,17 +34,15 @@
 
 default-build:
   <<: *build_job_definition
-  image: erlang:17
   artifacts:
     name: "$CI_PROJECT_NAME-ci-${CI_BUILD_REF_NAME}"
     <<: *artifact_paths_defitinion
-    # Temporary artifacts for non-release builds are removed after a week
+    # Temporary artifacts for non-release builds are removed after a month
     # because they are just for use in test jobs.
-    expire_in: 1 week
+    expire_in: 1 month
 
 release:
   <<: *build_job_definition
-  image: erlang:17
   artifacts:
     name: "$CI_PROJECT_NAME-${CI_BUILD_REF_NAME}"
     <<: *artifact_paths_defitinion
@@ -55,9 +52,7 @@
 .test_job_template: &test_job_definition
   stage: test
   script:
-    - make eunit
-  dependencies:
-    - default-build
+    - ./rebar eunit
 
 test:17:
   <<: *test_job_definition
@@ -73,4 +68,12 @@
 
 test:20:
   <<: *test_job_definition
-  image: erlang:20
+  image: erlang:20-alpine
+
+test:dialyze:
+  stage: test
+  image: erlang:20-alpine
+  script:
+    - ./rebar compile
+    - ./rebar check-plt || ./rebar -vv build-plt
+    - ./rebar -vv dialyze
diff --git a/src/triq_autoexport.erl b/src/triq_autoexport.erl
index ead133d..1152a20 100644
--- a/src/triq_autoexport.erl
+++ b/src/triq_autoexport.erl
@@ -35,12 +35,12 @@
     F = fun (Form, Set) ->
                 t_form(Form, Set, PropPrefix)
         end,
-    Exports = sets:to_list(lists:foldl(F, sets:new(), Forms)),
+    PropExports = sets:to_list(lists:foldl(F, sets:new(), Forms)),
     EUnit = maybe_gen_eunit(PropPrefix, Forms),
-    Forms1 = t_rewrite(Forms, Exports),
+    EUnitExports = lists:map(fun ({function, _, Name, 0, _}) -> {Name, 0} end, EUnit),
+    Forms1 = t_rewrite(Forms, PropExports ++ EUnitExports),
     add_eunit(Forms1, EUnit).
 
-
 t_form({function, _L, Name, 0, _Cs}, S, PropPrefix) ->
     N = atom_to_list(Name),
     case lists:prefix(PropPrefix, N) of