summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml5
-rw-r--r--tests/Makefile.travis24
2 files changed, 29 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..95fa3e6
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,5 @@
+language: cpp
+compiler:
+ - clang
+ - gcc
+script: make -f tests/Makefile.travis test \ No newline at end of file
diff --git a/tests/Makefile.travis b/tests/Makefile.travis
new file mode 100644
index 0000000..02f22e7
--- /dev/null
+++ b/tests/Makefile.travis
@@ -0,0 +1,24 @@
+CXXFLAGS=-c -Wall -Wextra -Werror -pedantic
+
+BUILD=build/travis
+
+SOURCES=src/pugixml.cpp $(wildcard tests/*.cpp)
+OBJECTS=$(SOURCES:%=$(BUILD)/%.o)
+EXECUTABLE=$(BUILD)/test
+
+all: $(EXECUTABLE)
+
+test: $(EXECUTABLE)
+ ./$(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+ $(CXX) $(OBJECTS) $(LDFLAGS) -o $@
+
+$(BUILD)/%.cpp.o: %.cpp
+ mkdir -p $(dir $@)
+ $(CXX) $(CXXFLAGS) $< -o $@
+
+clean:
+ rm -rf $(BUILD)
+
+.PHONY: all test clean \ No newline at end of file