From 70936cd51f743fd0150394b8d6bd2f9e33227710 Mon Sep 17 00:00:00 2001 From: Kresten Krab Thorup Date: Thu, 20 Nov 2014 23:08:14 +0100 Subject: [PATCH] Make tests run again We had a bad regression with #31 due to the tests not being run automatically. --- src/hanoidb.erl | 2 ++ test/hanoidb_drv.erl | 3 --- test/hanoidb_merger_tests.erl | 3 --- test/hanoidb_tests.erl | 27 ++++++++++++++++----------- test/hanoidb_writer_tests.erl | 3 --- 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/hanoidb.erl b/src/hanoidb.erl index 6666887..b4d7fcc 100644 --- a/src/hanoidb.erl +++ b/src/hanoidb.erl @@ -443,6 +443,8 @@ do_transact(TransactionSpec, State=#state{ nursery=Nursery, top=Top }) -> {ok, State#state{ nursery=Nursery2 }}. start_app() -> + application:start(syntax_tools), + application:start(plain_fsm), case application:start(?MODULE) of ok -> ok; diff --git a/test/hanoidb_drv.erl b/test/hanoidb_drv.erl index 0649801..bfa9cb6 100644 --- a/test/hanoidb_drv.erl +++ b/test/hanoidb_drv.erl @@ -25,8 +25,6 @@ %% @doc Drive a set of LSM BTrees -module(hanoidb_drv). --ifdef(QC_PROPER). - -behaviour(gen_server). %% API @@ -143,4 +141,3 @@ terminate(_Reason, _State) -> code_change(_OldVsn, State, _Extra) -> {ok, State}. --endif. %% -ifdef(QC_PROPER). diff --git a/test/hanoidb_merger_tests.erl b/test/hanoidb_merger_tests.erl index 45ee773..6bb11e1 100644 --- a/test/hanoidb_merger_tests.erl +++ b/test/hanoidb_merger_tests.erl @@ -24,8 +24,6 @@ -module(hanoidb_merger_tests). --ifdef(QC_PROPER). - -ifdef(TEST). -include_lib("eunit/include/eunit.hrl"). -endif. @@ -63,4 +61,3 @@ merge_test() -> ok. --endif. %% -ifdef(QC_PROPER). diff --git a/test/hanoidb_tests.erl b/test/hanoidb_tests.erl index 2e7f088..ef7e4af 100644 --- a/test/hanoidb_tests.erl +++ b/test/hanoidb_tests.erl @@ -24,8 +24,6 @@ -module(hanoidb_tests). --ifdef(QC_PROPER). - -include("include/hanoidb.hrl"). -include("src/hanoidb.hrl"). @@ -63,15 +61,23 @@ full_test_() -> ?_test(test_tree_simple_5()) ]}. -longer_test_() -> +longer_tree_test_() -> {setup, - spawn, - fun () -> ok end, - fun (_) -> ok end, - [ - {timeout, 300, ?_test(test_tree())}, - {timeout, 120, ?_test(test_qc())} - ]}. + spawn, + fun () -> ok end, + fun (_) -> ok end, + [ + {timeout, 300, ?_test(test_tree())} + ]}. + +longer_qc_test_() -> + {setup, + spawn, + fun () -> ok end, + fun (_) -> ok end, + [ + {timeout, 120, ?_test(test_qc())} + ]}. -ifdef(TRIQ). test_qc() -> @@ -428,4 +434,3 @@ dict_range_query(Dict, Range) -> [{K, V} || {K, V} <- dict:to_list(Dict), ?KEY_IN_RANGE(K, Range)]. --endif. %% -ifdef(QC_PROPER). diff --git a/test/hanoidb_writer_tests.erl b/test/hanoidb_writer_tests.erl index 024b177..f01ac20 100644 --- a/test/hanoidb_writer_tests.erl +++ b/test/hanoidb_writer_tests.erl @@ -24,8 +24,6 @@ -module(hanoidb_writer_tests). --ifdef(QC_PROPER). - -ifdef(TEST). -ifdef(TEST). -ifdef(TRIQ). @@ -118,4 +116,3 @@ simple1_test() -> ok = hanoidb_reader:close(IN). --endif. %% -ifdef(QC_PROPER).