GCC Middle and Back End API Reference
selftest-xml.h
Go to the documentation of this file.
1/* Selftest support for XML.
2 Copyright (C) 2025 Free Software Foundation, Inc.
3 Contributed by David Malcolm <dmalcolm@redhat.com>.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_SELFTEST_XML_H
22#define GCC_SELFTEST_XML_H
23
24#include "xml.h"
25
26/* The selftest code should entirely disappear in a production
27 configuration, hence we guard all of it with #if CHECKING_P. */
28
29#if CHECKING_P
30
31namespace selftest {
32
33/* Assert that NODE written with indentation as xml source
34 equals EXPECTED_VALUE.
35 Use LOC for any failures. */
36
37void
38assert_xml_print_eq (const location &loc,
39 const xml::node &node,
40 const char *expected_value);
41#define ASSERT_XML_PRINT_EQ(XML_NODE, EXPECTED_VALUE) \
42 assert_xml_print_eq ((SELFTEST_LOCATION), \
43 (XML_NODE), \
44 (EXPECTED_VALUE))
45
46} // namespace selftest
47
48#endif /* #if CHECKING_P */
49
50#endif /* GCC_SELFTEST_XML_H */
Definition dump-context.h:31