Add basic tests

For now the only thing checked is that header files compile by
themselves, e.g. includes and forward declarations in them are
complete and they do not require extra includes
This commit is contained in:
Dmitry Marakasov 2014-02-03 01:48:38 +04:00
parent a8baa2df30
commit 3df16d40d1
10 changed files with 59 additions and 1 deletions

View File

@ -35,8 +35,9 @@ IF(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
ADD_LIBRARY(SDL2pp SHARED ${LIBRARY_SOURCES}) ADD_LIBRARY(SDL2pp SHARED ${LIBRARY_SOURCES})
TARGET_LINK_LIBRARIES(SDL2pp ${SDL2_LIBRARY}) TARGET_LINK_LIBRARIES(SDL2pp ${SDL2_LIBRARY})
# demos # demos and tests
ADD_SUBDIRECTORY(demos) ADD_SUBDIRECTORY(demos)
ADD_SUBDIRECTORY(tests)
ELSE(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) ELSE(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
MESSAGE(STATUS "libSDL2pp bundled build") MESSAGE(STATUS "libSDL2pp bundled build")

17
tests/CMakeLists.txt Normal file
View File

@ -0,0 +1,17 @@
# header tests: these just include specific headers to check if
# they are compilable (e.g., includes and forward declarations are
# complete and do not require extra includes)
SET(HEADER_TESTS
hdr_exception
hdr_point
hdr_rect
hdr_renderer
hdr_sdl
hdr_sdl2pp
hdr_texture
hdr_window
)
FOREACH(TEST ${HEADER_TESTS})
ADD_EXECUTABLE(${TEST} ${TEST}.cc)
ENDFOREACH(TEST ${TESTS})

5
tests/hdr_exception.cc Normal file
View File

@ -0,0 +1,5 @@
#include <SDL2pp/Exception.hh>
int main() {
return 0;
}

5
tests/hdr_point.cc Normal file
View File

@ -0,0 +1,5 @@
#include <SDL2pp/Point.hh>
int main() {
return 0;
}

5
tests/hdr_rect.cc Normal file
View File

@ -0,0 +1,5 @@
#include <SDL2pp/Rect.hh>
int main() {
return 0;
}

5
tests/hdr_renderer.cc Normal file
View File

@ -0,0 +1,5 @@
#include <SDL2pp/Renderer.hh>
int main() {
return 0;
}

5
tests/hdr_sdl.cc Normal file
View File

@ -0,0 +1,5 @@
#include <SDL2pp/SDL.hh>
int main() {
return 0;
}

5
tests/hdr_sdl2pp.cc Normal file
View File

@ -0,0 +1,5 @@
#include <SDL2pp/SDL2pp.hh>
int main() {
return 0;
}

5
tests/hdr_texture.cc Normal file
View File

@ -0,0 +1,5 @@
#include <SDL2pp/Texture.hh>
int main() {
return 0;
}

5
tests/hdr_window.cc Normal file
View File

@ -0,0 +1,5 @@
#include <SDL2pp/Window.hh>
int main() {
return 0;
}