summaryrefslogtreecommitdiff
path: root/tests/test_header_only.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-01-09 19:29:23 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-01-09 23:22:57 -0800
commitf3e42969a5118247de548c059e9bed69cdf208bb (patch)
tree03542349d42842d76d0f6f67bdd113c72d921b33 /tests/test_header_only.cpp
parentff16dbdd4c63fa46cc1f38eda4cfb66f38047657 (diff)
Simplify header-only mode usage
It's sufficient to define PUGIXML_HEADER_ONLY anywhere now, source is included automatically. This is a second attempt; this time it includes a workaround for QMake bug that caused it to generate incorrect Makefile.
Diffstat (limited to 'tests/test_header_only.cpp')
-rw-r--r--tests/test_header_only.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_header_only.cpp b/tests/test_header_only.cpp
new file mode 100644
index 0000000..f1990dd
--- /dev/null
+++ b/tests/test_header_only.cpp
@@ -0,0 +1,16 @@
+#define PUGIXML_HEADER_ONLY
+#define pugi pugih
+
+#include "common.hpp"
+
+// Check header guards
+#include "../src/pugixml.hpp"
+#include "../src/pugixml.hpp"
+
+TEST(header_only)
+{
+ xml_document doc;
+ CHECK(doc.load_string(STR("<node/>")));
+ CHECK_STRING(doc.first_child().name(), STR("node"));
+ CHECK(doc.first_child() == doc.select_node(STR("//*")).node());
+}