diff --git a/appveyor.yml b/appveyor.yml index 30aef618..824d54e7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,6 +31,8 @@ build_script: msbuild /p:Configuration=Release /p:Platform=$cmakePlatform /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" PACKAGE.vcxproj .\light\Release\testlight.exe + + .\qbsp\Release\testqbsp.exe artifacts: - path: cmakebuild\*.zip deploy: diff --git a/build-linux-64.sh b/build-linux-64.sh index 7ced463e..7f92e21e 100755 --- a/build-linux-64.sh +++ b/build-linux-64.sh @@ -14,10 +14,12 @@ tar xf embree.tgz cmake .. -DCMAKE_BUILD_TYPE=Release -Dembree_DIR="$(pwd)/embree-2.15.0.x86_64.linux" make -j8 VERBOSE=1 make -j8 VERBOSE=1 testlight +make -j8 VERBOSE=1 testqbsp cpack # run tests ./light/testlight || exit 1 +./qbsp/testqbsp || exit 1 # check rpath readelf -d ./light/light diff --git a/build-osx.sh b/build-osx.sh index 29b6e006..9c1ebfe6 100755 --- a/build-osx.sh +++ b/build-osx.sh @@ -19,7 +19,9 @@ EMBREE_CMAKE_DIR="$(pwd)/$EMBREE_DIR_NAME" cmake .. -DCMAKE_BUILD_TYPE=Release -Dembree_DIR="$EMBREE_CMAKE_DIR" make -j8 make -j8 testlight +make -j8 testqbsp cpack # run tests ./light/testlight || exit 1 +./qbsp/testqbsp || exit 1 diff --git a/qbsp/CMakeLists.txt b/qbsp/CMakeLists.txt index 6a1fbeb5..a539a35b 100644 --- a/qbsp/CMakeLists.txt +++ b/qbsp/CMakeLists.txt @@ -6,3 +6,20 @@ add_definitions(-DDOUBLEVEC_T) add_executable(qbsp ${QBSP_SOURCES} main.cc) target_link_libraries(qbsp ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS qbsp RUNTIME DESTINATION bin) + +# test (copied from light/CMakeLists.txt) + +set(GOOGLETEST_SOURCES ${CMAKE_SOURCE_DIR}/3rdparty/googletest/src/gtest-all.cc) +include_directories(${CMAKE_SOURCE_DIR}/3rdparty/googletest/include) +include_directories(${CMAKE_SOURCE_DIR}/3rdparty/googletest) + +set(QBSP_TEST_SOURCE + ${QBSP_SOURCES} + ${GOOGLETEST_SOURCES} + test.cc + test_qbsp.cc) + +add_executable(testqbsp EXCLUDE_FROM_ALL ${QBSP_TEST_SOURCE}) +add_test(testqbsp testqbsp) + +target_link_libraries (testqbsp ${CMAKE_THREAD_LIBS_INIT}) diff --git a/qbsp/test.cc b/qbsp/test.cc new file mode 100644 index 00000000..4483c91a --- /dev/null +++ b/qbsp/test.cc @@ -0,0 +1,6 @@ +#include "gtest/gtest.h" + +int main(int argc, char **argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/qbsp/test_qbsp.cc b/qbsp/test_qbsp.cc new file mode 100644 index 00000000..0ba6c766 --- /dev/null +++ b/qbsp/test_qbsp.cc @@ -0,0 +1,10 @@ +#include "gtest/gtest.h" + +#include + +using namespace std; + +TEST(qbsp, test) { + FAIL(); +} +