0
0
mirror of https://github.com/zeux/pugixml.git synced 2025-01-14 09:57:57 +08:00

Merge pull request #83 from ogdf/use-real-standards-only

Add cxxstd Makefile argument for testing C++ standards
This commit is contained in:
Arseny Kapoulkine 2016-01-26 20:28:10 -08:00
commit c3d27daf8e
3 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,6 @@
sudo: false
language: cpp
sudo: required
dist: trusty
os:
- linux
- osx
@ -10,5 +11,6 @@ env:
script:
- make test config=coverage defines=$DEFINES -j2
- make test config=release defines=$DEFINES -j2
- make test cxxstd=c++98 defines=$DEFINES -j2
after_success: bash <(curl -s https://codecov.io/bash) -f pugixml.cpp.gcov

View File

@ -3,8 +3,10 @@ MAKEFLAGS+=-r
config=debug
defines=standard
cxxstd=c++11
# set cxxstd=any to disable use of -std=...
BUILD=build/make-$(CXX)-$(config)-$(defines)
BUILD=build/make-$(CXX)-$(config)-$(defines)-$(cxxstd)
SOURCES=src/pugixml.cpp $(filter-out tests/fuzz_%,$(wildcard tests/*.cpp))
EXECUTABLE=$(BUILD)/test
@ -47,9 +49,8 @@ ifneq ($(findstring PUGIXML_NO_EXCEPTIONS,$(defines)),)
CXXFLAGS+=-fno-exceptions
endif
ifeq ($(findstring PUGIXML_NO_CXX11,$(defines)),)
# Can't use std=c++11 since Travis-CI has gcc 4.6.3
CXXFLAGS+=-std=c++0x
ifneq ($(cxxstd),any)
CXXFLAGS+=-std=$(cxxstd)
endif
OBJECTS=$(SOURCES:%=$(BUILD)/%.o)

View File

@ -1181,4 +1181,4 @@ TEST(parse_embed_pcdata)
CHECK_NODE_EX(doc, STR("<node>\n<key>value</key>\n<child>\n<inner1>value1</inner1>\n<inner2>value2</inner2>outer</child>\n<two>text<data />\n</two>\n</node>\n"), STR("\t"), 0);
CHECK_NODE_EX(doc, STR("<node>\n\t<key>value</key>\n\t<child>\n\t\t<inner1>value1</inner1>\n\t\t<inner2>value2</inner2>outer</child>\n\t<two>text<data />\n\t</two>\n</node>\n"), STR("\t"), format_indent);
}
}
}