updated testing
This commit is contained in:
parent
ef507352ff
commit
78fc2314c3
8
.gitignore
vendored
8
.gitignore
vendored
@ -1,4 +1,10 @@
|
||||
Makefile
|
||||
/CMakeFiles
|
||||
CMakeCache.txt
|
||||
cmake_install_cmake
|
||||
cmake_install.cmake
|
||||
fischl
|
||||
/test/CMakeFiles
|
||||
/test/cmake_install.cmake
|
||||
/test/CMakeCache.txt
|
||||
/test/Makefile
|
||||
run_tests
|
@ -11,9 +11,10 @@ include_directories(
|
||||
add_executable(fischl
|
||||
|
||||
# Header files
|
||||
|
||||
include/fischl.h
|
||||
lib/fischl.cpp
|
||||
lib/main.cpp
|
||||
|
||||
)
|
||||
|
||||
enable_testing()
|
||||
add_subdirectory(test)
|
||||
|
7
CTestTestfile.cmake
Normal file
7
CTestTestfile.cmake
Normal file
@ -0,0 +1,7 @@
|
||||
# CMake generated Testfile for
|
||||
# Source directory: /Users/factorialn/Projects/iloveos
|
||||
# Build directory: /Users/factorialn/Projects/iloveos
|
||||
#
|
||||
# This file includes the relevant testing commands required for
|
||||
# testing this directory and lists subdirectories to be tested as well.
|
||||
subdirs("test")
|
@ -37,6 +37,12 @@ if(NOT DEFINED CMAKE_OBJDUMP)
|
||||
set(CMAKE_OBJDUMP "/Library/Developer/CommandLineTools/usr/bin/objdump")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
|
||||
# Include the install script for each subdirectory.
|
||||
include("/Users/factorialn/Projects/iloveos/test/cmake_install.cmake")
|
||||
|
||||
endif()
|
||||
|
||||
if(CMAKE_INSTALL_COMPONENT)
|
||||
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
|
||||
else()
|
||||
|
@ -2,6 +2,6 @@ class fischl{
|
||||
|
||||
// declare
|
||||
public:
|
||||
void init();
|
||||
int init();
|
||||
|
||||
};
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
void fischl::init(){
|
||||
int fischl::init(){
|
||||
printf("Hello Fischl!");
|
||||
return 3;
|
||||
}
|
10
test/CMakeLists.txt
Normal file
10
test/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
set(TARGET_NAME run_tests)
|
||||
|
||||
|
||||
# add test sources here ...
|
||||
add_executable(${TARGET_NAME}
|
||||
|
||||
../lib/fischl.cpp
|
||||
testfischl.cpp
|
||||
|
||||
)
|
6
test/CTestTestfile.cmake
Normal file
6
test/CTestTestfile.cmake
Normal file
@ -0,0 +1,6 @@
|
||||
# CMake generated Testfile for
|
||||
# Source directory: /Users/factorialn/Projects/iloveos/test
|
||||
# Build directory: /Users/factorialn/Projects/iloveos/test
|
||||
#
|
||||
# This file includes the relevant testing commands required for
|
||||
# testing this directory and lists subdirectories to be tested as well.
|
13
test/testfischl.cpp
Normal file
13
test/testfischl.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include "fischl.h"
|
||||
#include <assert.h>
|
||||
|
||||
void testFischlInit(){
|
||||
fischl *F = new fischl;
|
||||
assert(F->init()==3);
|
||||
delete F;
|
||||
}
|
||||
|
||||
int main(){
|
||||
testFischlInit();
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user