diff options
author | bunnei <bunneidev@gmail.com> | 2016-05-21 16:15:13 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2016-05-21 16:15:13 +0200 |
commit | 5edff287b6da2821424e94d0ec48a00db2f7d944 (patch) | |
tree | 8236ee8438948f3612bf9fd9f7932449fff1567b | |
parent | Merge pull request #1816 from JayFoxRox/refactor-tev-dump (diff) | |
parent | Tests: Run tests on CI (diff) | |
download | yuzu-5edff287b6da2821424e94d0ec48a00db2f7d944.tar yuzu-5edff287b6da2821424e94d0ec48a00db2f7d944.tar.gz yuzu-5edff287b6da2821424e94d0ec48a00db2f7d944.tar.bz2 yuzu-5edff287b6da2821424e94d0ec48a00db2f7d944.tar.lz yuzu-5edff287b6da2821424e94d0ec48a00db2f7d944.tar.xz yuzu-5edff287b6da2821424e94d0ec48a00db2f7d944.tar.zst yuzu-5edff287b6da2821424e94d0ec48a00db2f7d944.zip |
-rw-r--r-- | .gitmodules | 3 | ||||
-rwxr-xr-x | .travis-build.sh | 9 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | appveyor.yml | 9 | ||||
m--------- | externals/catch | 0 | ||||
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/tests/CMakeLists.txt | 16 | ||||
-rw-r--r-- | src/tests/tests.cpp | 9 |
8 files changed, 47 insertions, 2 deletions
diff --git a/.gitmodules b/.gitmodules index db0905b3d..1f0b80768 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "soundtouch"] path = externals/soundtouch url = https://github.com/citra-emu/ext-soundtouch.git +[submodule "catch"] + path = externals/catch + url = https://github.com/philsquared/Catch.git diff --git a/.travis-build.sh b/.travis-build.sh index e06a4299b..511df04ac 100755 --- a/.travis-build.sh +++ b/.travis-build.sh @@ -18,9 +18,16 @@ if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then mkdir build && cd build cmake -DCITRA_FORCE_QT4=ON .. make -j4 + + ctest -VV -C Release elif [ "$TRAVIS_OS_NAME" = "osx" ]; then + set -o pipefail + export Qt5_DIR=$(brew --prefix)/opt/qt5 + mkdir build && cd build cmake .. -GXcode - xcodebuild -configuration Release | xcpretty -c && exit ${PIPESTATUS[0]} + xcodebuild -configuration Release | xcpretty -c + + ctest -VV -C Release fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f2898973..f7b0af115 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,6 +255,8 @@ endif() add_subdirectory(externals/soundtouch) +enable_testing() + add_subdirectory(src) # Install freedesktop.org metadata files, following those specifications: diff --git a/appveyor.yml b/appveyor.yml index 1edd7041f..b2b0ae28b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,7 +22,14 @@ before_build: - cmake -G "Visual Studio 14 2015 Win64" -DCITRA_USE_BUNDLED_QT=1 -DCITRA_USE_BUNDLED_SDL2=1 .. - cd .. -after_build: +build: + project: build/citra.sln + parallel: true + +test_script: + - cd build && ctest -VV -C Release + +on_success: # copying the needed QT Dlls is now done post build. See the CMakeLists.txt file in the citra-qt folder - ps: > if (!"$env:APPVEYOR_PULL_REQUEST_TITLE" -and ("$env:APPVEYOR_REPO_BRANCH" -eq "master")) diff --git a/externals/catch b/externals/catch new file mode 160000 +Subproject c984fc3ecde60b59efa2203e82261acac8ac850 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index de4fe716a..1e1245160 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,6 +5,7 @@ add_subdirectory(common) add_subdirectory(core) add_subdirectory(video_core) add_subdirectory(audio_core) +add_subdirectory(tests) if (ENABLE_SDL2) add_subdirectory(citra) endif() diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt new file mode 100644 index 000000000..457c55571 --- /dev/null +++ b/src/tests/CMakeLists.txt @@ -0,0 +1,16 @@ +set(SRCS + tests.cpp + ) + +set(HEADERS + ) + +create_directory_groups(${SRCS} ${HEADERS}) + +include_directories(../../externals/catch/single_include/) + +add_executable(tests ${SRCS} ${HEADERS}) +target_link_libraries(tests core video_core audio_core common) +target_link_libraries(tests ${PLATFORM_LIBRARIES}) + +add_test(NAME tests COMMAND $<TARGET_FILE:tests>) diff --git a/src/tests/tests.cpp b/src/tests/tests.cpp new file mode 100644 index 000000000..73978676f --- /dev/null +++ b/src/tests/tests.cpp @@ -0,0 +1,9 @@ +// Copyright 2016 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#define CATCH_CONFIG_MAIN +#include <catch.hpp> + +// Catch provides the main function since we've given it the +// CATCH_CONFIG_MAIN preprocessor directive. |