Add basic verification report.
[libdcp.git] / test / verify_report_test.cc
1 /*
2     Copyright (C) 2022 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21
22 #include "verify.h"
23 #include "verify_report.h"
24 #include <boost/test/unit_test.hpp>
25 #include "test.h"
26
27
28 BOOST_AUTO_TEST_CASE(verify_report_basically_ok)
29 {
30         dcp::HTMLFormatter formatter("build/test/verify_report_basically_ok.html");
31         dcp::verify_report(
32                 dcp::verify(
33                         { private_test / "TONEPLATES-SMPTE-PLAINTEXT_TST_F_XX-XX_ITL-TD_51-XX_2K_WOE_20111001_WOE_OV" },
34                         {},
35                         [](std::string, boost::optional<boost::filesystem::path>) {},
36                         [](float) {},
37                         {},
38                         xsd_test
39                         ),
40                 formatter
41                 );
42 }
43
44
45 BOOST_AUTO_TEST_CASE(text_formatter)
46 {
47         {
48                 dcp::TextFormatter fmt("build/test/text_formatter.txt");
49
50                 fmt.heading("Heading");
51                 fmt.subheading("Subheading");
52                 auto A = fmt.unordered_list();
53                 fmt.list_item("Foo");
54                 fmt.list_item("Bar");
55                 auto B = fmt.unordered_list();
56                 fmt.list_item("Fred");
57                 fmt.list_item("Jim");
58                 fmt.list_item("Sheila");
59         }
60
61 #ifdef LIBDCP_WINDOWS
62         check_file("test/data/text_formatter_windows.txt", "build/test/text_formatter.txt");
63 #else
64         check_file("test/data/text_formatter.txt", "build/test/text_formatter.txt");
65 #endif
66 }
67