From b20474107ea823e8030b80e1d8872c18df6134c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Tomic=CC=8Cevic=CC=81?= Date: Thu, 18 Jun 2015 14:53:58 +0200 Subject: [PATCH] added test framework --- test/Makefile | 24 ++++++++++++++++++++++++ test/all.cpp | 2 ++ test/install.sh | 7 +++++++ 3 files changed, 33 insertions(+) create mode 100644 test/Makefile create mode 100644 test/all.cpp create mode 100755 test/install.sh diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 000000000..912226508 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,24 @@ +TARGET = tests +LIBS = -lm +CC = c++ +CFLAGS = -g -Wall + +.PHONY: default all clean + +default: $(TARGET) +all: default + +OBJECTS = $(patsubst %.cpp, %.o, $(wildcard *.cpp)) +HEADERS = $(wildcard *.hpp) + +%.o: %.cpp $(HEADERS) + $(CC) $(CFLAGS) -c $< -o $@ + +.PRECIOUS: $(TARGET) $(OBJECTS) + +$(TARGET): $(OBJECTS) + $(CC) $(OBJECTS) -Wall $(LIBS) -o $@ + +clean: + -rm -f *.o + -rm -f $(TARGET) diff --git a/test/all.cpp b/test/all.cpp new file mode 100644 index 000000000..0c7c351f4 --- /dev/null +++ b/test/all.cpp @@ -0,0 +1,2 @@ +#define CATCH_CONFIG_MAIN +#include "catch.hpp" diff --git a/test/install.sh b/test/install.sh new file mode 100755 index 000000000..77b031fee --- /dev/null +++ b/test/install.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +echo "Installing Catch..." + +wget https://raw.githubusercontent.com/philsquared/Catch/develop/single_include/catch.hpp + +echo "All done!"