monotone

monotone Mtn Source Tree

Root/unit_tests.cc

1// Copyright (C) 2002 Graydon Hoare <graydon@pobox.com>
2//
3// This program is made available under the GNU GPL version 2.0 or
4// greater. See the accompanying file COPYING for details.
5//
6// This program is distributed WITHOUT ANY WARRANTY; without even the
7// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8// PURPOSE.
9
10#include <stdlib.h>
11
12#include "botan/botan.h"
13
14#include "unit_tests.hh"
15#include "sanity.hh"
16
17#include <set>
18#include <string>
19
20using std::set;
21using std::string;
22
23static bool clean_shutdown;
24void dumper()
25{
26 if (!clean_shutdown)
27 global_sanity.dump_buffer();
28 Botan::Init::deinitialize();
29}
30
31void clean_shutdown_dummy_test()
32{
33 clean_shutdown = true;
34}
35
36test_suite * init_unit_test_suite(int argc, char * argv[])
37{
38 Botan::Init::initialize();
39
40 clean_shutdown = false;
41 atexit(&dumper);
42 global_sanity.set_debug();
43
44 test_suite * suite = BOOST_TEST_SUITE("monotone unit tests");
45 I(suite);
46
47 set<string> t;
48 if (argc > 1)
49 t = set<string>(argv+1, argv+argc);
50
51 // call all the adders here
52
53 if (t.empty() || t.find("file_io") != t.end())
54 add_file_io_tests(suite);
55
56 if (t.empty() || t.find("key") != t.end())
57 add_key_tests(suite);
58
59 if (t.empty() || t.find("transform") != t.end())
60 add_transform_tests(suite);
61
62 if (t.empty() || t.find("charset") != t.end())
63 add_charset_tests(suite);
64
65 if (t.empty() || t.find("simplestring_xform") != t.end())
66 add_simplestring_xform_tests(suite);
67
68 if (t.empty() || t.find("vocab") != t.end())
69 add_vocab_tests(suite);
70
71 if (t.empty() || t.find("revision") != t.end())
72 add_revision_tests(suite);
73
74 if (t.empty() || t.find("cset") != t.end())
75 add_cset_tests(suite);
76
77 if (t.empty() || t.find("diff_patch") != t.end())
78 add_diff_patch_tests(suite);
79
80 if (t.empty() || t.find("xdelta") != t.end())
81 add_xdelta_tests(suite);
82
83 if (t.empty() || t.find("packet") != t.end())
84 add_packet_tests(suite);
85
86 if (t.empty() || t.find("netcmd") != t.end())
87 add_netcmd_tests(suite);
88
89 if (t.empty() || t.find("globish") != t.end())
90 add_globish_tests(suite);
91
92 if (t.empty() || t.find("crypto") != t.end())
93 add_crypto_tests(suite);
94
95 if (t.empty() || t.find("pipe") != t.end())
96 add_pipe_tests(suite);
97
98 if (t.empty() || t.find("string_queue") != t.end())
99 add_string_queue_tests(suite);
100
101 if (t.empty() || t.find("paths") != t.end())
102 add_paths_tests(suite);
103
104 if (t.empty() || t.find("roster") != t.end())
105 add_roster_tests(suite);
106
107 if (t.empty() || t.find("roster_merge") != t.end())
108 add_roster_merge_tests(suite);
109
110 if (t.empty() || t.find("restrictions") != t.end())
111 add_restrictions_tests(suite);
112
113 if (t.empty() || t.find("uri") != t.end())
114 add_uri_tests(suite);
115
116 if (t.empty() || t.find("refiner") != t.end())
117 add_refiner_tests(suite);
118
119 // all done, add our clean-shutdown-indicator
120 suite->add(BOOST_TEST_CASE(&clean_shutdown_dummy_test));
121
122 return suite;
123}
124
125// Local Variables:
126// mode: C++
127// fill-column: 76
128// c-file-style: "gnu"
129// indent-tabs-mode: nil
130// End:
131// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:

Archive Download this file

Branches

Tags

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