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 "botan/botan.h"
10
11#include "unit_tests.hh"
12#include "sanity.hh"
13
14#include <set>
15#include <string>
16
17static bool clean_shutdown;
18void dumper()
19{
20 if (!clean_shutdown)
21 global_sanity.dump_buffer();
22 Botan::Init::deinitialize();
23}
24
25void clean_shutdown_dummy_test()
26{
27 clean_shutdown = true;
28}
29
30test_suite * init_unit_test_suite(int argc, char * argv[])
31{
32 Botan::Init::initialize();
33
34 clean_shutdown = false;
35 atexit(&dumper);
36 global_sanity.set_debug();
37
38 test_suite * suite = BOOST_TEST_SUITE("monotone unit tests");
39 I(suite);
40
41 std::set<std::string> t;
42 if (argc > 1)
43 t = std::set<std::string>(argv+1, argv+argc);
44
45 // call all the adders here
46
47 if (t.empty() || t.find("file_io") != t.end())
48 add_file_io_tests(suite);
49
50 if (t.empty() || t.find("key") != t.end())
51 add_key_tests(suite);
52
53 if (t.empty() || t.find("transform") != t.end())
54 add_transform_tests(suite);
55
56 if (t.empty() || t.find("vocab") != t.end())
57 add_vocab_tests(suite);
58
59 if (t.empty() || t.find("revision") != t.end())
60 add_revision_tests(suite);
61
62 if (t.empty() || t.find("change_set") != t.end())
63 add_change_set_tests(suite);
64
65 if (t.empty() || t.find("diff_patch") != t.end())
66 add_diff_patch_tests(suite);
67
68 if (t.empty() || t.find("xdelta") != t.end())
69 add_xdelta_tests(suite);
70
71 if (t.empty() || t.find("packet") != t.end())
72 add_packet_tests(suite);
73
74 if (t.empty() || t.find("netcmd") != t.end())
75 add_netcmd_tests(suite);
76
77 if (t.empty() || t.find("globish") != t.end())
78 add_globish_tests(suite);
79
80 if (t.empty() || t.find("crypto") != t.end())
81 add_crypto_tests(suite);
82
83 if (t.empty() || t.find("string_queue") != t.end())
84 add_string_queue_tests(suite);
85
86 if (t.empty() || t.find("paths") != t.end())
87 add_paths_tests(suite);
88
89 // all done, add our clean-shutdown-indicator
90 suite->add(BOOST_TEST_CASE(&clean_shutdown_dummy_test));
91
92 return suite;
93}

Archive Download this file

Branches

Tags

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