Also ditched glog.
--- /dev/null
+language: cpp
+compiler:
+ - clang
+ - gcc
+before_install:
+ - sudo apt-add-repository -y ppa:jkeiren/ppa
+ - if test $CC = gcc; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
+ - sudo apt-get update -qq
+ - sudo apt-get upgrade -y
+ - sudo apt-get install -y boost1.48
+ - if test $CC = gcc; then sudo apt-get install gcc-4.7 g++-4.7; fi
+ - if test $CC = gcc; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 20; fi
+ - if test $CC = gcc; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 20; fi
+ - if test $CC = gcc; then sudo update-alternatives --config gcc; fi
+ - if test $CC = gcc; then sudo update-alternatives --config g++; fi
+
+script: cmake -DBUILD_TESTING=1 && make && make test
project(EntityX)
include_directories(${CMAKE_CURRENT_LIST_DIR})
+set(RUN_BENCHMARKS false CACHE BOOL "Run benchmarks")
+
include(${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
# C++11 feature checks
include(CheckCXX11Features.cmake)
target_link_libraries(
${TARGET_NAME}
entityx
- glog
gtest
gtest_main
${Boost_LIBRARIES}
target_link_libraries(
entityx_shared
${Boost_SIGNALS_LIBRARY}
- glog
)
set_target_properties(entityx_shared PROPERTIES OUTPUT_NAME entityx)
create_test(component_test entityx/Components_test.cc)
create_test(event_test entityx/Event_test.cc)
create_test(system_test entityx/System_test.cc)
- create_test(benchmarks_test entityx/Benchmarks_test.cc)
+ if (RUN_BENCHMARKS)
+ message("-- Running benchmarks")
+ create_test(benchmarks_test entityx/Benchmarks_test.cc)
+ else ()
+ message("-- Not running benchmarks (use -DRUN_BENCHMARKS=1 to enable)")
+ endif ()
endif (BUILD_TESTING)
file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/entityx/*.h")
#include <vector>
#include <boost/shared_ptr.hpp>
-#include <glog/logging.h>
#include "entityx/Event.h"
namespace entityx {
* Emits EntityDestroyedEvent.
*/
void destroy(Entity::Id entity) {
- CHECK(entity < entity_component_mask_.size()) << "Entity::Id ID outside entity vector range";
+ assert(entity < entity_component_mask_.size() && "Entity::Id ID outside entity vector range");
event_manager_.emit<EntityDestroyedEvent>(Entity(this, entity));
for (auto &components : entity_components_) {
components.at(entity).reset();
#include <string>
#include <vector>
#include <boost/ref.hpp>
-#include <glog/logging.h>
#include <gtest/gtest.h>
#include "entityx/Entity.h"
#include <string>
#include <vector>
-#include <glog/logging.h>
#include <gtest/gtest.h>
#include "entityx/Event.h"
#include <stdint.h>
+#include <cassert>
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/unordered_map.hpp>
-#include <glog/logging.h>
#include "entityx/Entity.h"
#include "entityx/Event.h"
template <typename S>
boost::shared_ptr<S> system() {
auto it = systems_.find(S::family());
- CHECK(it != systems_.end());
+ assert(it != systems_.end());
return it == systems_.end()
? boost::shared_ptr<S>()
: boost::static_pointer_cast<S>(it->second);
*/
template <typename S>
void update(double dt) {
- CHECK(initialized_) << "SystemManager::configure() not called";
+ assert(initialized_ && "SystemManager::configure() not called");
boost::shared_ptr<S> s = system<S>();
s->update(entities_, events_, dt);
}
#include <string>
#include <vector>
-#include <glog/logging.h>
#include <gtest/gtest.h>
#include "entityx/Manager.h"
#include "entityx/System.h"
bool list_tests_;
String output_;
bool print_time_;
- bool pretty_;
internal::Int32 random_seed_;
internal::Int32 repeat_;
bool shuffle_;