Changeset 33


Ignore:
Timestamp:
06/24/08 14:33:47 (4 years ago)
Author:
dom
Message:

Tester now runs fixtured tests

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/fix/eg_test_fix.erl

    r24 r33  
    1212 
    1313fixture (Tests) -> 
    14     [Test ("data") || Test <- Tests]. 
     14    [M: F ("data") || {M, F} <- Tests]. 
  • trunk/fix/eg_test_fix_nofix.erl

    r24 r33  
    1111 
    1212fixture (Tests) -> 
    13     [Test ("data") || Test <- Tests]. 
     13    [M: F ("data") || {M, F} <- Tests]. 
  • trunk/src/shells.erl

    r32 r33  
    2828    ok = tester_test: reruns_a_test_when_given_module (Test_node), 
    2929    ok = tester_test: runs_given_tests (Test_node), 
     30    ok = tester_test: runs_a_fixtured_test (Test_node), 
    3031    Caller ! {Caller, done}. 
    3132     
  • trunk/src/tester_test.erl

    r32 r33  
    1 %%% Copyright (c) 2008 Dominic Williams 
     1%%% Copyright (c) 2008 Dominic Williams, Nicolas Charpentier 
    22%%% All rights reserved. 
    33%%% See file COPYING. 
     
    66-export ([runs_a_test/1, reruns_a_test_when_given_module/1]). 
    77-export ([runs_given_tests/1]). 
     8-export ([runs_a_fixtured_test/1]). 
    89-test ([{nodes_fix, test_node, [runs_a_test, runs_given_tests]}]). 
    910-test ([{nodes_fix, test_node, [reruns_a_test_when_given_module]}]). 
     
    4445    [{3, 0, 0}, {3, 1, 1}, _, {3, 2, 1}, {3, 3, 2}] = Result, 
    4546    ok. 
    46      
     47 
     48runs_a_fixtured_test (Node) -> 
     49    Tester = start_tester (Node), 
     50    [{1, 0, 0}, {1, 1, 1}] = send (eg_test_fix, Tester), 
     51    ok. 
     52 
    4753receive_all (Ms) -> 
    4854    receive 
     
    5460 
    5561%%% Test to be added: 
    56 %%% with fixtures 
    5762%%% tests that never end (e.g. infinite loop) 
    5863%%% Code loading and re-running all tests when one of many is refreshed 
  • trunk/src/tests.erl

    r28 r33  
    2121    filter_by_attribute (Module, Binary, Tail, [Funs | Tests]); 
    2222filter_by_attribute (Module, Binary, [{M, F, Ts} | Tail], Tests) -> 
    23     Funs = [fun (Fix) -> Module:T (Fix) end || T <- Ts], 
    24     filter_by_attribute (Module, Binary, Tail, [{M, F, Funs} | Tests]); 
     23    Funs = [{Module, T} || T <- Ts], 
     24    filter_by_attribute (Module, Binary, Tail, [{M, F, [Funs]} | Tests]); 
    2525filter_by_attribute (Module, _, [], Tests) -> 
    2626    {Module, lists: flatten (Tests)}. 
  • trunk/src/tests_test.erl

    r28 r33  
    3131filtering_fixtured_tests_returns_list_of_fixture_fun_tuples () -> 
    3232    File_name = "../fix/eg_test_fix.erl", 
    33     Test = fun ([{Module, Fixture, Tests}]) -> 
     33    Test = fun ([{Module, Fixture, [Tests]}]) -> 
    3434                   [ok] = Module: Fixture (Tests) 
    3535           end, 
     
    3838filtering_understands_mixed_export_and_fixtured_tests () -> 
    3939    File_name = "../fix/eg_test_fix_nofix.erl", 
    40     Test = fun ([{Module, Fixture, With}, Without]) -> 
     40    Test = fun ([{Module, Fixture, [With]}, Without]) -> 
    4141                   {Wo_m, Wo_f, Wo_a} = Without, 
    4242                   {'EXIT', {Reason, _}} = (catch apply (Wo_m, Wo_f, Wo_a)), 
Note: See TracChangeset for help on using the changeset viewer.