Permalink
Browse files

Updated tests to run with rabbit

  • Loading branch information...
1 parent 37262c2 commit dbf64d01911c5463e2cdd80a49f2441b4504e07e @auser committed Sep 8, 2009
Showing with 25 additions and 26 deletions.
  1. +6 −6 Emakefile
  2. +10 −4 Makefile
  3. +3 −1 src/utils/rabint.erl
  4. +4 −14 test/src/rabint_tests.erl
  5. +2 −1 test/src/test_suite.erl
View
@@ -5,9 +5,9 @@
]}.
% Tests
-% { [ 'test/src/*'
-% ], [
-% {i, "include"},
-% {outdir, "test/ebin"},
-% debug_info
-% ]}.
+{ [ 'test/src/*'
+ ], [
+ {i, "include"},
+ {outdir, "test/ebin"},
+ debug_info
+]}.
View
@@ -9,6 +9,8 @@ EBIN_DIRS = $(wildcard deps/*/ebin)
WEB_DIR = web/
WONDERLAND_DIR = $(WEB_DIR)/wonderland
APP = alice
+TEST_DIR = test
+TEST_EBIN_DIR = $(TEST_DIR)/ebin
all: mochi ebin compile
all_boot: all boot
@@ -33,14 +35,18 @@ edoc:
boot:
(cd ebin; $(ERL) -pa ebin -noshell -run make_boot write_scripts alice)
-test: test_ebin compile
- $(ERL) -noshell -pa $(EBIN) -pa test/ebin -s test_suite test -s init stop
+test: $(TEST_EBIN_DIR) compile
+ $(ERL) -noshell -pa $(EBIN) \
+ -pa deps/*/ebin \
+ -pa $(TEST_EBIN_DIR) \
+ -s test_suite test \
+ -s init stop
ebin:
@(mkdir ebin)
-test_ebin:
- @(mkdir test/ebin)
+$(TEST_EBIN_DIR):
+ @mkdir $(TEST_EBIN_DIR)
clean:
rm -rf ebin/*.beam ebin/erl_crash.dump erl_crash.dump ebin/*.boot ebin/*.rel ebin/*.script
@@ -29,7 +29,9 @@ rabbit_node(Hostname) -> case Hostname of
Else -> list_to_atom(Else)
end.
-ping_rabbit() -> net_adm:ping(rabbit_node()).
+ping_rabbit() ->
+ ?INFO("Pinging: ~p~n", [rabbit_node()]),
+ net_adm:ping(rabbit_node()).
% TAKEN RIGHT FROM rabbitmq-server/rabbit_misc
@@ -2,17 +2,7 @@
-include ("alice.hrl").
-include_lib("eunit/include/eunit.hrl").
-setup() ->
- ok.
-
-teardown(_S) ->
- ok.
-
-test_rabbit_node_test_() ->
- {setup,
- fun setup/0, fun teardown/1,
- fun() ->
- ?assertEqual(rabbit@nohost, rabint:rabbit_node()),
- ?assertEqual('random.host', rabint:rabbit_node("random.host"))
- end
- }.
+rabbit_node_test_() ->
+ ?assertEqual(rabbit@nohost, rabint:rabbit_node()),
+ ?assertEqual('user@somedomain.com', rabint:rabbit_node("user@somedomain.com")),
+ ?assertEqual('random.host', rabint:rabbit_node("random.host")).
@@ -1,8 +1,9 @@
-module (test_suite).
--include ("alice.hrl").
+
-include_lib("eunit/include/eunit.hrl").
all_test_() ->
[
+ % {module, hermes_logger_test},
{module, rabint_tests}
].

0 comments on commit dbf64d0

Please sign in to comment.