Private
Public Access
2
0

tests: add initial unit test env

This commit is contained in:
Brendan Le Foll
2014-04-10 11:07:05 +01:00
parent b7d42d470f
commit 8b715745fc
4 changed files with 32 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.6) cmake_minimum_required (VERSION 2.8)
project (maa) project (maa)
set(SWIG_EXECUTABLE /usr/bin/swig) set(SWIG_EXECUTABLE /usr/bin/swig)
@@ -7,6 +7,13 @@ INCLUDE(${SWIG_USE_FILE})
SET(CMAKE_SWIG_FLAGS "") SET(CMAKE_SWIG_FLAGS "")
option(test "Build all tests." OFF)
add_subdirectory (src) add_subdirectory (src)
add_subdirectory (api) add_subdirectory (api)
add_subdirectory (examples) add_subdirectory (examples)
if (test)
enable_testing ()
add_subdirectory (tests)
endif()

5
README
View File

@@ -32,6 +32,11 @@ make
Install is currently unsuported. Javascript and python modules will be in Install is currently unsuported. Javascript and python modules will be in
build/src/{javascript, python} build/src/{javascript, python}
=== DEVELOPMENT ===
Unit tests for all features must be completed prior to implementations, please
run `ctest -V` from the build dir in order to see current implementation status
=== USING === === USING ===
see examples/ see examples/

11
tests/CMakeLists.txt Normal file
View File

@@ -0,0 +1,11 @@
find_package (GTest REQUIRED)
set(PROJECT_TEST_NAME "${PROJECT_NAME}_test")
set(COMMON_INCLUDES ${PROJECT_SOURCE_DIR}/src)
include_directories(${GTEST_INCLUDE_DIRS} ${COMMON_INCLUDES})
add_executable(${PROJECT_TEST_NAME} "maa_test.cxx")
target_link_libraries(${PROJECT_TEST_NAME} ${PROJECT_NAME_STR} ${GTEST_BOTH_LIBRARIES} maa pthread)
add_test(Basic ${PROJECT_TEST_NAME})

8
tests/maa_test.cxx Normal file
View File

@@ -0,0 +1,8 @@
#include "maa.h"
#include "gtest/gtest.h"
using namespace maa;
TEST (basic, GetVersion) {
ASSERT_EQ(get_version(), 1);
}