diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..7807c597542eb943e1aeedcf63209e1ec0c72f78
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,18 @@
+# use MPCDF module environment
+image: gitlab-registry.mpcdf.mpg.de/mpcdf/module-image
+
+default:
+  before_script:
+    - module load cmake git
+
+test-gcc9:
+  script:
+    - module load gcc/9
+    - CC=gcc CXX=g++ CXXFLAGS="-std=c++11" ./get_gtest.sh
+    - make CC=gcc CXX=g++ CXXFLAGS="-std=c++11 -I$PWD/googletest/install/include" LDFLAGS="-L$PWD/googletest/install/lib64"
+
+test-intel19:
+  script:
+    - module load intel/19.0.4
+    - CC=icc CXX=icpc CXXFLAGS="-std=c++11" ./get_gtest.sh
+    - make CC=icc CXX=icpc CXXFLAGS="-std=c++11 -I$PWD/googletest/install/include" LDFLAGS="-L$PWD/googletest/install/lib64"
diff --git a/Makefile b/Makefile
index dbb728767c690b48128feae6e4626a3bffd39d74..30af201980416c88e14bc7b43b11b5e34ba21111 100644
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,24 @@
 SRC=src/main.cpp
-TESTS=tests
 COV=coverage
 OUT_T=test_output
 OUT_E=expected_output
 APP=program
 CXX=g++
 BROWSER=google-chrome
+TESTS=tests
+TEST_APP=runTests
+TEST_SRC=$(TESTS)/test_funcs.cpp
+LDFLAGS_GTEST=-lgtest -lpthread
 
 # Default
 all: distclean compile test
 
 # Compiling section
 compile:
-	$(CXX) -o $(APP) $(SRC)
+	$(CXX) $(CXXFLAGS) -o $(APP) $(SRC)
 
 compile_coverage:
-	$(CXX) -o $(APP) --coverage $(SRC)
+	$(CXX) $(CXXFLAGS) -o $(APP) --coverage $(SRC)
 
 # Testing section
 test: simple_tests regression_test unit_tests
@@ -31,8 +34,9 @@ regression_test:
 	diff $(OUT_T) $(OUT_E)
 
 unit_tests:
-	cd $(TESTS) && cmake CMakeLists.txt && make
-	./$(TESTS)/runTests
+	$(CXX) $(CXXFLAGS) -o test_funcs.o -c $(TEST_SRC)
+	$(CXX) $(CXXFLAGS) test_funcs.o -o $(TEST_APP) $(LDFLAGS) $(LDFLAGS_GTEST)
+	./$(TEST_APP)
 
 # Coverage section
 coverage: clean clean_coverage compile_coverage simple_tests
@@ -50,7 +54,7 @@ clean:
 	rm -f $(APP)
 
 clean_tests:
-	rm -rf $(TESTS)/CMakeFiles $(TESTS)/CMakeCache.txt $(TESTS)/cmake_install.cmake $(TESTS)/CMakeFiles $(TESTS)/runTests $(OUT_E) $(OUT_T)
+	rm -rf $(TESTS)/CMakeFiles $(TESTS)/CMakeCache.txt $(TESTS)/cmake_install.cmake $(TESTS)/CMakeFiles $(TESTS)/runTests $(OUT_E) $(OUT_T) $(TEST_APP) *.o
 
 clean_coverage:
 	rm -rf *.gcno *.gcda $(APP).info $(COV)
diff --git a/get_gtest.sh b/get_gtest.sh
new file mode 100755
index 0000000000000000000000000000000000000000..16385fae7ef152d8b425dc8cfb6d59a90a2dca17
--- /dev/null
+++ b/get_gtest.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# already there
+[[ -d googletest ]] && exit 0
+
+# otherwise download and build
+git clone https://github.com/google/googletest.git
+mkdir -p googletest/build
+cd googletest/build
+cmake .. -DCMAKE_INSTALL_PREFIX=../install
+make && make install
diff --git a/src/main.cpp b/src/main.cpp
index 702da9d3d1ba15eca83143727ab447ecae42122f..24cb08553bc970d138fdc1b021318b28753329d7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,3 +1,5 @@
+#include <stdio.h>
+#include <stdlib.h>
 #include "funcs.cpp"
 using namespace std;
 
diff --git a/tests/Makefile b/tests/Makefile
deleted file mode 100644
index 3757ec24f42f871cb8210dc930dfe5f9d98ecea2..0000000000000000000000000000000000000000
--- a/tests/Makefile
+++ /dev/null
@@ -1,178 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.12
-
-# Default target executed when no arguments are given to make.
-default_target: all
-
-.PHONY : default_target
-
-# Allow only one "make -f Makefile2" at a time, but pass parallelism.
-.NOTPARALLEL:
-
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-
-# Remove some rules from gmake that .SUFFIXES does not remove.
-SUFFIXES =
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-
-# Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-
-# A target that is always out of date.
-cmake_force:
-
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/bin/cmake
-
-# The command to remove a file.
-RM = /usr/bin/cmake -E remove -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /home/sluka/Work/testing_example/tests
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/sluka/Work/testing_example/tests
-
-#=============================================================================
-# Targets provided globally by CMake.
-
-# Special rule for the target rebuild_cache
-rebuild_cache:
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
-	/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : rebuild_cache
-
-# Special rule for the target rebuild_cache
-rebuild_cache/fast: rebuild_cache
-
-.PHONY : rebuild_cache/fast
-
-# Special rule for the target edit_cache
-edit_cache:
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
-	/usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : edit_cache
-
-# Special rule for the target edit_cache
-edit_cache/fast: edit_cache
-
-.PHONY : edit_cache/fast
-
-# The main all target
-all: cmake_check_build_system
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/sluka/Work/testing_example/tests/CMakeFiles /home/sluka/Work/testing_example/tests/CMakeFiles/progress.marks
-	$(MAKE) -f CMakeFiles/Makefile2 all
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/sluka/Work/testing_example/tests/CMakeFiles 0
-.PHONY : all
-
-# The main clean target
-clean:
-	$(MAKE) -f CMakeFiles/Makefile2 clean
-.PHONY : clean
-
-# The main clean target
-clean/fast: clean
-
-.PHONY : clean/fast
-
-# Prepare targets for installation.
-preinstall: all
-	$(MAKE) -f CMakeFiles/Makefile2 preinstall
-.PHONY : preinstall
-
-# Prepare targets for installation.
-preinstall/fast:
-	$(MAKE) -f CMakeFiles/Makefile2 preinstall
-.PHONY : preinstall/fast
-
-# clear depends
-depend:
-	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
-.PHONY : depend
-
-#=============================================================================
-# Target rules for targets named runTests
-
-# Build rule for target.
-runTests: cmake_check_build_system
-	$(MAKE) -f CMakeFiles/Makefile2 runTests
-.PHONY : runTests
-
-# fast build rule for target.
-runTests/fast:
-	$(MAKE) -f CMakeFiles/runTests.dir/build.make CMakeFiles/runTests.dir/build
-.PHONY : runTests/fast
-
-test_funcs.o: test_funcs.cpp.o
-
-.PHONY : test_funcs.o
-
-# target to build an object file
-test_funcs.cpp.o:
-	$(MAKE) -f CMakeFiles/runTests.dir/build.make CMakeFiles/runTests.dir/test_funcs.cpp.o
-.PHONY : test_funcs.cpp.o
-
-test_funcs.i: test_funcs.cpp.i
-
-.PHONY : test_funcs.i
-
-# target to preprocess a source file
-test_funcs.cpp.i:
-	$(MAKE) -f CMakeFiles/runTests.dir/build.make CMakeFiles/runTests.dir/test_funcs.cpp.i
-.PHONY : test_funcs.cpp.i
-
-test_funcs.s: test_funcs.cpp.s
-
-.PHONY : test_funcs.s
-
-# target to generate assembly for a file
-test_funcs.cpp.s:
-	$(MAKE) -f CMakeFiles/runTests.dir/build.make CMakeFiles/runTests.dir/test_funcs.cpp.s
-.PHONY : test_funcs.cpp.s
-
-# Help Target
-help:
-	@echo "The following are some of the valid targets for this Makefile:"
-	@echo "... all (the default if no target is provided)"
-	@echo "... clean"
-	@echo "... depend"
-	@echo "... rebuild_cache"
-	@echo "... runTests"
-	@echo "... edit_cache"
-	@echo "... test_funcs.o"
-	@echo "... test_funcs.i"
-	@echo "... test_funcs.s"
-.PHONY : help
-
-
-
-#=============================================================================
-# Special targets to cleanup operation of make.
-
-# Special rule to run CMake to check the build system integrity.
-# No rule that depends on this can have commands that come from listfiles
-# because they might be regenerated.
-cmake_check_build_system:
-	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
-.PHONY : cmake_check_build_system
-