diff options
author | Alexander Shorin <kxepal@apache.org> | 2014-06-12 02:47:15 +0400 |
---|---|---|
committer | Alexander Shorin <kxepal@apache.org> | 2014-06-17 02:50:25 +0400 |
commit | bf97dc00e53d6b1fa32332881569733cefbbb492 (patch) | |
tree | 5f8fa6c90a10033a815a173d1df6ef5dd05106fe | |
parent | 6eac98de0a0fb9427994ba80cfca5760ca55e8be (diff) | |
download | couchdb-bf97dc00e53d6b1fa32332881569733cefbbb492.tar.gz |
Port couch_replicator/01-load.t etap test suite to eunit
-rw-r--r-- | src/couch_replicator/Makefile.am | 2 | ||||
-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..cea4cc2a4 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("../../../test/couchdb/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))}. |