fix up tests to reflect the actual NOTEST variable DEV_ONLY

This commit is contained in:
Eric Merritt 2013-10-14 14:10:25 -07:00
parent 4973a0fb8f
commit 16b441f0e3
10 changed files with 23 additions and 25 deletions

View file

@ -227,7 +227,7 @@ colorize_(Color, Bold, Msg) when is_integer(Color), is_integer(Bold)->
%%% Test Functions %%% Test Functions
%%%=================================================================== %%%===================================================================
-ifndef(NOTEST). -ifdef(DEV_ONLY).
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
should_test() -> should_test() ->

View file

@ -33,7 +33,7 @@
is_true/1, is_true/1,
is_false/1]). is_false/1]).
-ifndef(NOTEST). -ifdef(DEV_ONLY).
-include_lib("proper/include/proper.hrl"). -include_lib("proper/include/proper.hrl").
-endif. -endif.
@ -218,10 +218,10 @@ to_atom(X) ->
to_atom(to_list(X)). to_atom(to_list(X)).
%%%=================================================================== %%%===================================================================
%%% API %%% Tests
%%%=================================================================== %%%===================================================================
-ifndef(NOTEST). -ifdef(DEV_ONLY).
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
force_proper_test_() -> force_proper_test_() ->

View file

@ -671,14 +671,14 @@ pad2(X) when is_float(X) ->
ltoi(X) -> ltoi(X) ->
list_to_integer(X). list_to_integer(X).
%% %%%===================================================================
%% TEST FUNCTIONS %%% Tests
%% %%%===================================================================
%% c(dh_date,[{d,'TEST'}]).
%%-define(NOTEST, 1).
-ifdef(DEV_ONLY).
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
-define(DATE, {{2001,3,10},{17,16,17}}). -define(DATE, {{2001,3,10},{17,16,17}}).
-define(DATEMS, {{2001,3,10},{17,16,17,123456}}). -define(DATEMS, {{2001,3,10},{17,16,17,123456}}).
-define(DATE_NOON, {{2001,3,10},{12,0,0}}). -define(DATE_NOON, {{2001,3,10},{12,0,0}}).
@ -938,3 +938,4 @@ zulu_test_() ->
?_assertEqual(format("Y-m-d\\TH:i:s",nparse("2001-03-10T15:16:17-04:00")), ?_assertEqual(format("Y-m-d\\TH:i:s",nparse("2001-03-10T15:16:17-04:00")),
"2001-03-10T19:16:17") "2001-03-10T19:16:17")
]. ].
-endif.

View file

@ -298,7 +298,7 @@ sub_files(From) ->
%%% Test Functions %%% Test Functions
%%%=================================================================== %%%===================================================================
-ifndef(NOTEST). -ifdef(DEV_ONLY).
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
setup_test() -> setup_test() ->

View file

@ -154,7 +154,7 @@ keys(Data) ->
%%%=================================================================== %%%===================================================================
-ifndef(NOTEST). -ifdef(DEV_ONLY).
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
%% For me unit testing initially is about covering the obvious case. A %% For me unit testing initially is about covering the obvious case. A

View file

@ -68,7 +68,7 @@ fetch(Fun, List) when is_list(List), is_function(Fun) ->
%%% Test Functions %%% Test Functions
%%%=================================================================== %%%===================================================================
-ifndef(NOTEST). -ifdef(DEV_ONLY).
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
find1_test() -> find1_test() ->

View file

@ -314,7 +314,7 @@ internal_pes(Vsn, LVsn) ->
%%% Test Functions %%% Test Functions
%%%=================================================================== %%%===================================================================
-ifndef(NOTEST). -ifdef(DEV_ONLY).
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
eql_test() -> eql_test() ->

View file

@ -43,8 +43,6 @@
type/0, type/0,
supported/0]). supported/0]).
-include_lib("eunit/include/eunit.hrl").
%%============================================================================ %%============================================================================
%% Types %% Types
%%============================================================================ %%============================================================================
@ -202,6 +200,9 @@ get_string(String) ->
%%%==================================================================== %%%====================================================================
%%% tests %%% tests
%%%==================================================================== %%%====================================================================
-ifdef(DEV_ONLY).
-include_lib("eunit/include/eunit.hrl").
general_test_() -> general_test_() ->
[?_test(42 == get_integer("42")), [?_test(42 == get_integer("42")),
?_test(500211 == get_integer("500211")), ?_test(500211 == get_integer("500211")),
@ -216,3 +217,5 @@ general_test_() ->
?_test(false == get_boolean("False")), ?_test(false == get_boolean("False")),
?_test(false == get_boolean("No")), ?_test(false == get_boolean("No")),
?_test(false == get_boolean("no"))]. ?_test(false == get_boolean("no"))].
-endif.

View file

@ -1,6 +1,8 @@
%%% @copyright Erlware, LLC. %%% @copyright Erlware, LLC.
-module(ec_plists_tests). -module(ec_plists_tests).
-ifdef(DEV_ONLY).
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
%%%=================================================================== %%%===================================================================
@ -73,3 +75,5 @@ ftmap_bad_test() ->
lists:seq(1, 5)), lists:seq(1, 5)),
?assertMatch([{value, 1}, {error,{throw,test_exception}}, {value, 3}, ?assertMatch([{value, 1}, {error,{throw,test_exception}}, {value, 3},
{value, 4}, {value, 5}] , Results). {value, 4}, {value, 5}] , Results).
-endif.

View file

@ -1,10 +0,0 @@
-module(mock).
-export([new_dictionary/0]).
new_dictionary() ->
meck:new(ec_dictionary_proper),
meck:expect(ec_dictionary_proper, dictionary, fun() ->
proper_types:union([ec_dict])
end).