From 6e5163ba3e47cc95c3ce6f34a39643b973ca11f7 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 6 Oct 2015 07:26:24 -0700 Subject: tests: Add a copy of header-only test This makes sure we get linking errors whenever a symbol is not marked as inline in header-only mode. --- tests/test_header_only.cpp | 19 ------------------- tests/test_header_only_1.cpp | 19 +++++++++++++++++++ tests/test_header_only_2.cpp | 19 +++++++++++++++++++ 3 files changed, 38 insertions(+), 19 deletions(-) delete mode 100644 tests/test_header_only.cpp create mode 100644 tests/test_header_only_1.cpp create mode 100644 tests/test_header_only_2.cpp diff --git a/tests/test_header_only.cpp b/tests/test_header_only.cpp deleted file mode 100644 index 17cafca..0000000 --- a/tests/test_header_only.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#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(""))); - CHECK_STRING(doc.first_child().name(), STR("node")); - -#ifndef PUGIXML_NO_XPATH - CHECK(doc.first_child() == doc.select_node(STR("//*")).node()); -#endif -} diff --git a/tests/test_header_only_1.cpp b/tests/test_header_only_1.cpp new file mode 100644 index 0000000..e33fd78 --- /dev/null +++ b/tests/test_header_only_1.cpp @@ -0,0 +1,19 @@ +#define PUGIXML_HEADER_ONLY +#define pugi pugih + +#include "common.hpp" + +// Check header guards +#include "../src/pugixml.hpp" +#include "../src/pugixml.hpp" + +TEST(header_only_1) +{ + xml_document doc; + CHECK(doc.load_string(STR(""))); + CHECK_STRING(doc.first_child().name(), STR("node")); + +#ifndef PUGIXML_NO_XPATH + CHECK(doc.first_child() == doc.select_node(STR("//*")).node()); +#endif +} diff --git a/tests/test_header_only_2.cpp b/tests/test_header_only_2.cpp new file mode 100644 index 0000000..220c807 --- /dev/null +++ b/tests/test_header_only_2.cpp @@ -0,0 +1,19 @@ +#define PUGIXML_HEADER_ONLY +#define pugi pugih + +#include "common.hpp" + +// Check header guards +#include "../src/pugixml.hpp" +#include "../src/pugixml.hpp" + +TEST(header_only_2) +{ + xml_document doc; + CHECK(doc.load_string(STR(""))); + CHECK_STRING(doc.first_child().name(), STR("node")); + +#ifndef PUGIXML_NO_XPATH + CHECK(doc.first_child() == doc.select_node(STR("//*")).node()); +#endif +} -- cgit v1.2.3