summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Shorin <kxepal@apache.org>2014-06-12 02:47:15 +0400
committerAlexander Shorin <kxepal@apache.org>2015-12-03 00:52:10 +0300
commit1bc015a5fcdcc1d4b355c5b778b1d066dad670ec (patch)
treed76a73f8c0b15b416e94b54b5d98047d6f324eec
parente3ab316ba18e04abd9677fe904de6bb17a44983f (diff)
downloadcouchdb-1bc015a5fcdcc1d4b355c5b778b1d066dad670ec.tar.gz
Port couch_replicator/01-load.t etap test suite to eunit
-rw-r--r--src/couch_replicator/Makefile.am2
-rw-r--r--src/couch_replicator/test/couch_replicator_modules_load_tests.erl (renamed from src/couch_replicator/test/01-load.t)27
2 files changed, 16 insertions, 13 deletions
diff --git a/src/couch_replicator/Makefile.am b/src/couch_replicator/Makefile.am
index 2dcd47dfd..4f0aab21a 100644
--- a/src/couch_replicator/Makefile.am
+++ b/src/couch_replicator/Makefile.am
@@ -36,7 +36,7 @@ source_files = \
src/couch_replicator.erl
test_files = \
- test/01-load.t \
+ test/couch_replicator_modules_load_tests.erl \
test/02-httpc-pool.t \
test/03-replication-compact.t \
test/04-replication-large-atts.t \
diff --git a/src/couch_replicator/test/01-load.t b/src/couch_replicator/test/couch_replicator_modules_load_tests.erl
index 8bd82ddc7..7107b9e49 100644
--- a/src/couch_replicator/test/01-load.t
+++ b/src/couch_replicator/test/couch_replicator_modules_load_tests.erl
@@ -1,6 +1,3 @@
-#!/usr/bin/env escript
-%% -*- erlang -*-
-
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
@@ -13,10 +10,19 @@
% License for the specific language governing permissions and limitations under
% the License.
-% Test that we can load each module.
+-module(couch_replicator_modules_load_tests).
+
+-include("couch_eunit.hrl").
+
+
+modules_load_test_() ->
+ {
+ "Verify that all modules loads",
+ should_load_modules()
+ }.
+
-main(_) ->
- test_util:init_code_path(),
+should_load_modules() ->
Modules = [
couch_replicator_api_wrap,
couch_replicator_httpc,
@@ -28,10 +34,7 @@ main(_) ->
couch_replicator_utils,
couch_replicator_job_sup
],
+ [should_load_module(Mod) || Mod <- Modules].
- etap:plan(length(Modules)),
- lists:foreach(
- fun(Module) ->
- etap:loaded_ok(Module, lists:concat(["Loaded: ", Module]))
- end, Modules),
- etap:end_tests().
+should_load_module(Mod) ->
+ {atom_to_list(Mod), ?_assertMatch({module, _}, code:load_file(Mod))}.