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)
19global_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_verbose();
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 if (t.empty() || t.find("file_io") != t.end())
42 add_file_io_tests(suite);
43
44 if (t.empty() || t.find("key") != t.end())
45 add_key_tests(suite);
46
47 if (t.empty() || t.find("transform") != t.end())
48 add_transform_tests(suite);
49
50 if (t.empty() || t.find("vocab") != t.end())
51 add_vocab_tests(suite);
52
53 if (t.empty() || t.find("packet") != t.end())
54 add_packet_tests(suite);
55
56 if (t.empty() || t.find("url") != t.end())
57 add_url_tests(suite);
58
59 if (t.empty() || t.find("diff_patch") != t.end())
60 add_diff_patch_tests(suite);
61
62 if (t.empty() || t.find("netcmd") != t.end())
63 add_netcmd_tests(suite);
64
65 if (t.empty() || t.find("xdelta") != t.end())
66 add_xdelta_tests(suite);
67
68 // all done, add our clean-shutdown-indicator
69 suite->add(BOOST_TEST_CASE(&clean_shutdown_dummy_test));
70
71 return suite;
72}

Archive Download this file

Branches

Tags

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