added test framework

This commit is contained in:
Dominik Tomičević 2015-06-18 14:53:58 +02:00
parent 2745a618f1
commit b20474107e
3 changed files with 33 additions and 0 deletions

24
test/Makefile Normal file
View File

@ -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)

2
test/all.cpp Normal file
View File

@ -0,0 +1,2 @@
#define CATCH_CONFIG_MAIN
#include "catch.hpp"

7
test/install.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
echo "Installing Catch..."
wget https://raw.githubusercontent.com/philsquared/Catch/develop/single_include/catch.hpp
echo "All done!"