-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added setup for unit tests and started adding some classes to manage the
tasks.
- Loading branch information
Showing
5 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
# EasyJobScheduler | ||
# EasyJobScheduler | ||
|
||
## Project dependencies | ||
- GTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |