]> granicus.if.org Git - ejabberd/commitdiff
Fix includes in eunit compilation flags
authorPaweł Chmielowski <pchmielowski@process-one.net>
Fri, 18 Nov 2016 13:02:47 +0000 (14:02 +0100)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Fri, 18 Nov 2016 13:02:47 +0000 (14:02 +0100)
rebar.config
rebar.config.script

index 966b746c1f54d6d6575e794307a27f7aee4d5fd7..f9af6a5685b76344c29c31b63f075d6a5611dfc1 100644 (file)
                    {if_var_false, elixir, "(\"Elixir.*\":_/_)"},
                    {if_var_false, redis, "(\"eredis\":_/_)"}]}.
 
-{eunit_compile_opts, [{i, "tools"}]}.
+{eunit_compile_opts, [{i, "tools"}, {i, "include"},
+                     {i, "deps/fast_xml/include"}]}.
 
 {if_version_above, "17", {cover_enabled, true}}.
 {cover_export_enabled, true}.
index ccafba7ec9d1a0a941d42452fd031fa612d7ce34..2a924d26cceeb82f3db749a7b9b337b754b01a8d 100644 (file)
@@ -119,12 +119,18 @@ TestConfig = case file:read_file_info(TestConfigFile) of
                      "-userconfig ct_config_plain " ++ TestConfigFile ++ " ";
                  _ ->
                      ""
-             end,
-
-Conf2 = [{ct_extra_params, "-ct_hooks cth_surefire "
-         ++ TestConfig
-         ++ "-include "
-         ++ filename:join([Cwd, "tools"])} | Conf1],
+            end,
+
+CtIncludes = case lists:keyfind(eunit_compile_opts, 1, Conf1) of
+                false ->
+                    [];
+                {_, EunitCompOpts} ->
+                    [[" -include ", filename:join([Cwd, IncPath])]
+                     || {i, IncPath} <- EunitCompOpts]
+            end,
+
+Conf2 = [{ct_extra_params, lists:flatten(["-ct_hooks cth_surefire ", TestConfig,
+                                         CtIncludes])} | Conf1],
 
 Conf3 = case lists:keytake(xref_exclusions, 1, Conf2) of
             {value, {_, Items2}, Rest2} ->