Skip to content

Commit

Permalink
Merge pull request zeux#83 from ogdf/use-real-standards-only
Browse files Browse the repository at this point in the history
Add cxxstd Makefile argument for testing C++ standards
  • Loading branch information
zeux committed Jan 27, 2016
2 parents e133764 + e017a22 commit c3d27da
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sudo: false
language: cpp
sudo: required
dist: trusty
os:
- linux
- osx
Expand All @@ -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
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit c3d27da

Please sign in to comment.