You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2015/12/03 00:02:31 UTC
[31/50] couchdb commit: updated refs/heads/1.x.x to 921006f
Port couch_mrview/01-load.t etap test suite to eunit
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/a3ffe052
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/a3ffe052
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/a3ffe052
Branch: refs/heads/1.x.x
Commit: a3ffe05290d4ee8e46ddb6c6ac18729bc9aeae2e
Parents: 215bb00
Author: Alexander Shorin <kx...@apache.org>
Authored: Wed Jun 11 01:29:11 2014 +0400
Committer: Alexander Shorin <kx...@apache.org>
Committed: Thu Dec 3 00:52:04 2015 +0300
----------------------------------------------------------------------
src/couch_mrview/Makefile.am | 2 +-
src/couch_mrview/test/01-load.t | 34 ------------------
.../test/couch_mrview_modules_load_tests.erl | 37 ++++++++++++++++++++
3 files changed, 38 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/a3ffe052/src/couch_mrview/Makefile.am
----------------------------------------------------------------------
diff --git a/src/couch_mrview/Makefile.am b/src/couch_mrview/Makefile.am
index 2b9ef86..d12b745 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 \
http://git-wip-us.apache.org/repos/asf/couchdb/blob/a3ffe052/src/couch_mrview/test/01-load.t
----------------------------------------------------------------------
diff --git a/src/couch_mrview/test/01-load.t b/src/couch_mrview/test/01-load.t
deleted file mode 100644
index a57c1a7..0000000
--- a/src/couch_mrview/test/01-load.t
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/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
-%
-% http://www.apache.org/licenses/LICENSE-2.0
-%
-% Unless required by applicable law or agreed to in writing, software
-% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-% License for the specific language governing permissions and limitations under
-% the License.
-
-% Test that we can load each module.
-
-main(_) ->
- test_util:init_code_path(),
- Modules = [
- couch_mrview,
- couch_mrview_compactor,
- couch_mrview_http,
- couch_mrview_index,
- couch_mrview_updater,
- couch_mrview_util
- ],
-
- etap:plan(length(Modules)),
- lists:foreach(
- fun(Module) ->
- etap:loaded_ok(Module, lists:concat(["Loaded: ", Module]))
- end, Modules),
- etap:end_tests().
http://git-wip-us.apache.org/repos/asf/couchdb/blob/a3ffe052/src/couch_mrview/test/couch_mrview_modules_load_tests.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview/test/couch_mrview_modules_load_tests.erl b/src/couch_mrview/test/couch_mrview_modules_load_tests.erl
new file mode 100644
index 0000000..bfab646
--- /dev/null
+++ b/src/couch_mrview/test/couch_mrview_modules_load_tests.erl
@@ -0,0 +1,37 @@
+% 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
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(couch_mrview_modules_load_tests).
+
+-include("couch_eunit.hrl").
+
+
+modules_load_test_() ->
+ {
+ "Verify that all modules loads",
+ should_load_modules()
+ }.
+
+
+should_load_modules() ->
+ Modules = [
+ couch_mrview,
+ couch_mrview_compactor,
+ couch_mrview_http,
+ couch_mrview_index,
+ couch_mrview_updater,
+ couch_mrview_util
+ ],
+ [should_load_module(Mod) || Mod <- Modules].
+
+should_load_module(Mod) ->
+ {atom_to_list(Mod), ?_assertMatch({module, _}, code:load_file(Mod))}.