mirror of https://gitlab.com/cppit/jucipp
4 changed files with 45 additions and 16 deletions
@ -0,0 +1,7 @@ |
|||||||
|
cmake_minimum_required(VERSION 2.8) |
||||||
|
|
||||||
|
project(cmake_project) |
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -Wall -Wextra") |
||||||
|
|
||||||
|
add_executable(cmake_project main.cpp) |
||||||
@ -1,7 +1,17 @@ |
|||||||
#include "test_suite.h" |
#include "test_suite.h" |
||||||
|
#include <iostream> |
||||||
|
|
||||||
int main() { |
int main() { |
||||||
suite test_suite("CMake_tests"); |
auto &config = Config::get(); |
||||||
py::module::import("cmake_test"); |
config.project.cmake.command = "cmake"; |
||||||
|
auto suite_name = "CMake_tests"; |
||||||
|
suite test_suite(suite_name); |
||||||
|
auto module = py::module::import("cmake_test"); |
||||||
|
|
||||||
|
try { |
||||||
|
module.attr("run")((test_suite.test_file_path / suite_name / "cmake_project").string()); |
||||||
test_suite.has_assertion = true; |
test_suite.has_assertion = true; |
||||||
|
} catch(const py::error_already_set &error){ |
||||||
|
std::cout << error.what(); |
||||||
|
} |
||||||
} |
} |
||||||
@ -1 +1,12 @@ |
|||||||
from Jucipp import CMake |
from Jucipp import CMake |
||||||
|
|
||||||
|
def run(project_path): |
||||||
|
cmake = CMake(project_path) |
||||||
|
assert project_path == cmake.project_path, "Construction of CMake failed" |
||||||
|
default_build_path = project_path + "/build" |
||||||
|
assert cmake.update_default_build(default_build_path) == True, "Update of default build failed" |
||||||
|
executable = cmake.get_executable(default_build_path, project_path) |
||||||
|
assert executable == default_build_path + "/cmake_project", "Invalid executable" |
||||||
|
default_debug_path = project_path + "/debug" |
||||||
|
assert cmake.update_debug_build(default_debug_path), "Update of debug build failed" |
||||||
|
executable = cmake.get_executable(default_debug_path, project_path) |
||||||
|
|||||||
Loading…
Reference in new issue