diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-04-15 22:40:47 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-04-15 22:40:47 +0100 |
commit | bd9fce6b63d3180fa97f8e2504afcbf82125f3e1 (patch) | |
tree | 30b74a9ff3693b9b9a8153ea0930c5bf9ee17402 | |
parent | 348cb17ccc87f85f014675d0aea849fd2c34e3c3 (diff) | |
download | Arider-bd9fce6b63d3180fa97f8e2504afcbf82125f3e1.tar.gz Arider-bd9fce6b63d3180fa97f8e2504afcbf82125f3e1.zip |
Added test bench
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | CMakeLists.txt | 56 | ||||
m--------- | YAGE | 0 | ||||
-rw-r--r-- | include/ariderconfig.hpp | 4 | ||||
-rw-r--r-- | include/physics.hpp | 10 | ||||
-rw-r--r-- | src/block.cpp | 14 | ||||
-rw-r--r-- | test/test001.cpp | 10 | ||||
-rw-r--r-- | test/test002.cpp | 10 | ||||
-rw-r--r-- | test/test003.cpp | 10 |
9 files changed, 86 insertions, 31 deletions
@@ -2,15 +2,16 @@ bin/ build/ CMakeFiles/ +Testing/ # extensions to ignore *.o *.out *.a +*.cmake # general files to ignore CMakeCache.txt -cmake_install.cmake Makefile # specific directories to ignore diff --git a/CMakeLists.txt b/CMakeLists.txt index 0034e05..50d7ed5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,10 +3,10 @@ project(arider) # set version number set(ARIDER_MAJOR_VERSION 0) -set(ARIDER_MINOR_VERSION 1) +set(ARIDER_MINOR_VERSION 2) set(ARIDER_PATCH_VERSION 0) set(ARIDER_VERSION - ${ARIDER_MAJOR_VERSION}.${ARIDERn_MINOR_VERSION}${ARIDER_PATCH_VERSION}) + ${ARIDER_MAJOR_VERSION}.${ARIDER_MINOR_VERSION}${ARIDER_PATCH_VERSION}) # set standard set(CMAKE_CXX_STANDARD 14) @@ -14,12 +14,15 @@ set(CMAKE_CXX_STANDARD 14) # set include directories set(ARIDER_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/include) +# set source directory +set(ARIDER_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src) +set(ARIDER_TEST_DIR ${CMAKE_SOURCE_DIR}/test) + # setting right output directory set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) - set(YAGE_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/YAGE/include/) -set(YAGE_LIBRARIES YAGE) +set(YAGE_LIBRARIES yage) # setting up configuration header configure_file ( @@ -29,13 +32,20 @@ configure_file ( # adding my executable add_executable(${PROJECT_NAME} - ${CMAKE_SOURCE_DIR}/src/animation.cpp - ${CMAKE_SOURCE_DIR}/src/block.cpp - ${CMAKE_SOURCE_DIR}/src/character.cpp - ${CMAKE_SOURCE_DIR}/src/game.cpp - ${CMAKE_SOURCE_DIR}/src/level.cpp - ${CMAKE_SOURCE_DIR}/src/main.cpp - ${CMAKE_SOURCE_DIR}/src/player.cpp) + ${ARIDER_SOURCE_DIR}/animation.cpp + ${ARIDER_SOURCE_DIR}/block.cpp + ${ARIDER_SOURCE_DIR}/character.cpp + ${ARIDER_SOURCE_DIR}/game.cpp + ${ARIDER_SOURCE_DIR}/level.cpp + ${ARIDER_SOURCE_DIR}/main.cpp + ${ARIDER_SOURCE_DIR}/player.cpp) + +add_executable(test001 + ${ARIDER_TEST_DIR}/test001.cpp) +add_executable(test002 + ${ARIDER_TEST_DIR}/test002.cpp) +add_executable(test003 + ${ARIDER_TEST_DIR}/test003.cpp) # adding sdl2 library include(FindPkgConfig) @@ -58,3 +68,27 @@ target_link_libraries(${CMAKE_PROJECT_NAME} ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} ${SDL2_LIBRARIES}) + +target_link_libraries(test001 + ${YAGE_LIBRARIES} + ${OPENGL_LIBRARIES} + ${GLEW_LIBRARIES} + ) + +target_link_libraries(test002 + ${YAGE_LIBRARIES} + ${OPENGL_LIBRARIES} + ${GLEW_LIBRARIES} + ) + +target_link_libraries(test003 + ${YAGE_LIBRARIES} + ${OPENGL_LIBRARIES} + ${GLEW_LIBRARIES} + ) + +enable_testing() + +add_test(test1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test001) +add_test(test2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test002) +add_test(test3 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test003) diff --git a/YAGE b/YAGE -Subproject daa032e2f6c86da16902f654055d8b040d7670b +Subproject a8bf22bf263762c56546751fcfcae181d574582 diff --git a/include/ariderconfig.hpp b/include/ariderconfig.hpp index f71fe78..5b1a857 100644 --- a/include/ariderconfig.hpp +++ b/include/ariderconfig.hpp @@ -1,5 +1,5 @@ // the configured options and settings for Arider #define ARIDER_MAJOR_VERSION 0 -#define ARIDER_MINOR_VERSION 1 +#define ARIDER_MINOR_VERSION 2 #define ARIDER_PATCH_VERSION 0 -#define ARIDER_VERSION 0..0 +#define ARIDER_VERSION 0.20 diff --git a/include/physics.hpp b/include/physics.hpp deleted file mode 100644 index 55267ca..0000000 --- a/include/physics.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef PHYSICS_HPP -#define PHYSICS_HPP - -class Physics -{ -public: - static void calculateNewPosition(); -}; - -#endif diff --git a/src/block.cpp b/src/block.cpp index c1aeb68..e93b569 100644 --- a/src/block.cpp +++ b/src/block.cpp @@ -3,19 +3,19 @@ #include <YAGE/vertex.hpp> Block::Block(const std::string &texture, int x, int y, int width, int height): - x_(x), y_(y), - width_(width), height_(height) + x_(x), y_(y), + width_(width), height_(height) { - animation_.pushFrame(AnimationState::STILL, texture); + animation_.pushFrame(AnimationState::STILL, texture); } Block::Block(Animation animation, int x, int y, int width, int height) : - animation_(animation), - x_(x), y_(y), - width_(width), height_(height) + animation_(animation), + x_(x), y_(y), + width_(width), height_(height) {} void Block::render(yage::SpriteBatch &sprite_batch, float depth) const { - sprite_batch.draw(glm::vec4(x_, y_, width_, height_), glm::vec4(0.f, 0.f, 1.f, 1.f), animation_.currentFrame().id, yage::Color(255, 255, 255, 255), depth); + sprite_batch.draw(glm::vec4(x_, y_, width_, height_), glm::vec4(0.f, 0.f, 1.f, 1.f), animation_.currentFrame().id, yage::Color(255, 255, 255, 255), depth); } diff --git a/test/test001.cpp b/test/test001.cpp new file mode 100644 index 0000000..cf65115 --- /dev/null +++ b/test/test001.cpp @@ -0,0 +1,10 @@ +#include <YAGE/spritebatch.hpp> + +#include <iostream> + +int main(int, char**) +{ + yage::SpriteBatch sp; + std::cout<<"Hello World!\n"; + return 0; +} diff --git a/test/test002.cpp b/test/test002.cpp new file mode 100644 index 0000000..3e8164f --- /dev/null +++ b/test/test002.cpp @@ -0,0 +1,10 @@ +#include <YAGE/spritebatch.hpp> + +#include <iostream> + +int main(int, char**) +{ + yage::SpriteBatch sp; + std::cout<<"Hello World 1!\n"; + return 1; +} diff --git a/test/test003.cpp b/test/test003.cpp new file mode 100644 index 0000000..3357618 --- /dev/null +++ b/test/test003.cpp @@ -0,0 +1,10 @@ +#include <YAGE/spritebatch.hpp> + +#include <iostream> + +int main(int, char**) +{ + yage::SpriteBatch sp; + std::cout<<"Hello World! 2\n"; + return 2; +} |