From e71785a0c9f4226022d47d43b750900cf1e2abc2 Mon Sep 17 00:00:00 2001 From: okaestne Date: Wed, 23 Sep 2020 18:53:19 +0200 Subject: [PATCH] add test --- .gitignore | 2 +- Makefile | 6 +++++- test.cpp | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 test.cpp diff --git a/.gitignore b/.gitignore index cd42eac..1530978 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -Log.o \ No newline at end of file +*.o \ No newline at end of file diff --git a/Makefile b/Makefile index 3f99f42..03553b8 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,16 @@ TARGET = Log.o +TEST = test CFLAGS = -O2 -std=c++11 -Wall -Wextra -pedantic-errors -g .PHONY: all clean all: $(TARGET) +test: $(TARGET) $(TEST).o + $(CXX) -o test $^ + %.o: %.cpp $(CXX) -c -o $@ $(CFLAGS) $^ clean: - $(RM) $(TARGET) + $(RM) $(TARGET) $(TEST) $(TEST).o diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..7d0976d --- /dev/null +++ b/test.cpp @@ -0,0 +1,19 @@ +#include "Log.h" + +int main() { + Log::init(); + Log::setColoredOutput(true); + + Log::fatal << "test: fatal"; + Log::error << "test: error"; + Log::warn << "test: warn"; + Log::note << "test: note"; + Log::info << "test: info"; + Log::debug << "test: debug"; + Log::trace << "test: trace"; + + Log::fatal << "test: fatal" << 2; + Log::error << "test: error" << 3 << '!'; + + // Log::stop(); +} \ No newline at end of file