diff options
author | Alexander Shorin <kxepal@apache.org> | 2014-06-11 01:29:11 +0400 |
---|---|---|
committer | Alexander Shorin <kxepal@apache.org> | 2015-12-03 00:52:04 +0300 |
commit | a3ffe05290d4ee8e46ddb6c6ac18729bc9aeae2e (patch) | |
tree | 5b6327faf113f06d21c1b25b9c077c7ca3bfb4a8 | |
parent | 215bb006f500127a4d82696a3c496fcddea41d1c (diff) | |
download | couchdb-a3ffe05290d4ee8e46ddb6c6ac18729bc9aeae2e.tar.gz |
Port couch_mrview/01-load.t etap test suite to eunit
-rw-r--r-- | src/couch_mrview/Makefile.am | 2 | ||||
-rw-r--r-- | src/couch_mrview/test/couch_mrview_modules_load_tests.erl (renamed from src/couch_mrview/test/01-load.t) | 27 |
2 files changed, 16 insertions, 13 deletions
diff --git a/src/couch_mrview/Makefile.am b/src/couch_mrview/Makefile.am index 2b9ef86fa..d12b745d2 100644 --- a/src/couch_mrview/Makefile.am +++ b/src/couch_mrview/Makefile.am @@ -33,7 +33,7 @@ source_files = \ src/couch_mrview_util.erl test_files = \ - test/01-load.t \ + test/couch_mrview_modules_load_tests.erl \ test/02-map-views.t \ test/03-red-views.t \ test/04-index-info.t \ diff --git a/src/couch_mrview/test/01-load.t b/src/couch_mrview/test/couch_mrview_modules_load_tests.erl index a57c1a775..bfab646dd 100644 --- a/src/couch_mrview/test/01-load.t +++ b/src/couch_mrview/test/couch_mrview_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_mrview_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_mrview, couch_mrview_compactor, @@ -25,10 +31,7 @@ main(_) -> couch_mrview_updater, couch_mrview_util ], + [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))}. |