monotone

monotone Mtn Source Tree

Root/unit_tests.cc

1
2// copyright (C) 2002, 2003 graydon hoare <graydon@pobox.com>
3// all rights reserved.
4// licensed to the public under the terms of the GNU GPL (>= 2)
5// see the file COPYING for details
6
7#include <stdlib.h>
8
9#include "unit_tests.hh"
10#include "sanity.hh"
11
12#include <set>
13#include <string>
14
15static bool clean_shutdown;
16void dumper()
17{
18 if (!clean_shutdown)
19 global_sanity.dump_buffer();
20}
21
22void clean_shutdown_dummy_test()
23{
24 clean_shutdown = true;
25}
26
27test_suite * init_unit_test_suite(int argc, char * argv[])
28{
29 clean_shutdown = false;
30 atexit(&dumper);
31 global_sanity.set_debug();
32
33 test_suite * suite = BOOST_TEST_SUITE("monotone unit tests");
34 I(suite);
35
36 std::set<std::string> t;
37 if (argc > 1)
38 t = std::set<std::string>(argv+1, argv+argc);
39
40 // call all the adders here
41
42 if (t.empty() || t.find("file_io") != t.end())
43 add_file_io_tests(suite);
44
45 if (t.empty() || t.find("key") != t.end())
46 add_key_tests(suite);
47
48 if (t.empty() || t.find("transform") != t.end())
49 add_transform_tests(suite);
50
51 if (t.empty() || t.find("vocab") != t.end())
52 add_vocab_tests(suite);
53
54 if (t.empty() || t.find("revision") != t.end())
55 add_revision_tests(suite);
56
57 if (t.empty() || t.find("change_set") != t.end())
58 add_change_set_tests(suite);
59
60 if (t.empty() || t.find("diff_patch") != t.end())
61 add_diff_patch_tests(suite);
62
63 if (t.empty() || t.find("xdelta") != t.end())
64 add_xdelta_tests(suite);
65
66 if (t.empty() || t.find("packet") != t.end())
67 add_packet_tests(suite);
68
69 if (t.empty() || t.find("netcmd") != t.end())
70 add_netcmd_tests(suite);
71
72 if (t.empty() || t.find("netcmd") != t.end())
73 add_path_component_tests(suite);
74
75
76 // all done, add our clean-shutdown-indicator
77 suite->add(BOOST_TEST_CASE(&clean_shutdown_dummy_test));
78
79 return suite;
80}

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status