Skip to content

Commit

Permalink
Added setup for unit tests and started adding some classes to manage the
Browse files Browse the repository at this point in the history
tasks.
  • Loading branch information
amng committed Jul 1, 2020
1 parent 76e39ce commit 8724e90
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 5 deletions.
39 changes: 35 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,42 @@
cmake_minimum_required(VERSION 3.0.0)
project(EasyJobScheduler VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "-Wno-deprecated-declarations")

include(CTest)
enable_testing()

add_executable(EasyJobScheduler main.cpp)
add_executable(EasyJobScheduler src/main.cpp)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)



################################
# GTest
################################

# ===============================
# Download and install GoogleTest
# ===============================
include(ExternalProject)
ExternalProject_Add(gtest URL https://github.com/google/googletest/archive/release-1.7.0.zip
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libs/gtest
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(gtest source_dir binary_dir)


# Define a test
add_executable(EasyJobScheduler_tests tests/unit_tests.cpp)

add_dependencies(EasyJobScheduler_tests gtest)
include_directories(${source_dir}/include)
target_link_libraries(EasyJobScheduler_tests ${binary_dir}/libgtest.a ${binary_dir}/libgtest_main.a)

##################################
# Just make the test runnable with
# $ make test

enable_testing()
add_test(NAME EasyJobScheduler_tests
COMMAND EasyJobScheduler_tests)
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# EasyJobScheduler
# EasyJobScheduler

## Project dependencies
- GTest
15 changes: 15 additions & 0 deletions includes/Task.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once

#include <string>

class Task
{
private:
std::string name;
std::string command;
std::vector<std::string> dependencies;

public:


};
File renamed without changes.
5 changes: 5 additions & 0 deletions tests/unit_tests.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "gtest/gtest.h"

TEST(blaTest, test1) {
EXPECT_EQ (1, 1);
}

0 comments on commit 8724e90

Please sign in to comment.