Skip to content

Commit

Permalink
try to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
p0358 committed Oct 24, 2024
1 parent 9e31447 commit fca9721
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ jobs:
path: build/

- name: Test
#working-directory: ${{ steps.strings.outputs.build-output-dir }}
working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
#run: ctest --build-config ${{ matrix.build_type }}
run: ./ci/test.ps1
run: ctest --build-config ${{ matrix.build_type }}
#run: ./ci/test.ps1
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,19 @@
# Generated documentation
/docs

# VSCode configs
# VS Code settings
/.vscode
/.cache

# Visual Studio work directory
/.vs/
# Visual Studio build directory
/out/

# CMake build directory
/build

# appimage executables
*.AppImage

/CMakeUserPresets.json
20 changes: 12 additions & 8 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set(PKG_TESTS_TFO_NEXON_SOURCES
"tfo/nexon/test_pkgindex.cpp"
"tfo/nexon/settings.hpp")

set(PKG_TESTS_SOURCES_BASE "test_main.cpp" "utils.cpp")
set(PKG_TESTS_SOURCES_BASE "utils.cpp")

set(PKG_TESTS_HEADERS_BASE "utils.hpp")

Expand All @@ -45,13 +45,7 @@ target_include_directories(pkg_test
target_include_directories(pkg_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

add_subdirectory(${PKG_LIB_CATCH_DIR} catch)
target_link_libraries(pkg_test Catch2::Catch2)

if(PKG_USE_CLANG_FSAPI)
target_link_libraries(pkg_test c++abi c++fs)
elseif(NOT MSVC)
target_link_libraries(pkg_test stdc++fs)
endif()
target_link_libraries(pkg_test Catch2::Catch2WithMain)

target_link_libraries(pkg_test uncso2)

Expand All @@ -63,3 +57,13 @@ file(GLOB PKG_TEST_REQUIRED_FILES "${CMAKE_CURRENT_SOURCE_DIR}/gamefiles/*")
foreach(file ${PKG_TEST_REQUIRED_FILES})
configure_file(${file} "${CMAKE_CURRENT_BINARY_DIR}/" COPYONLY)
endforeach()

add_custom_command(
TARGET pkg_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/../uncso2.dll
${CMAKE_CURRENT_BINARY_DIR})

include(CTest)
include(Catch)
catch_discover_tests(pkg_test)
2 changes: 1 addition & 1 deletion tests/cso2/nexon/test_encfile.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

#include <filesystem>
#include <fstream>
Expand Down
2 changes: 1 addition & 1 deletion tests/cso2/nexon/test_lzmatex.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

#include <filesystem>
#include <fstream>
Expand Down
2 changes: 1 addition & 1 deletion tests/cso2/nexon/test_pkgfile.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

#include <iostream>
#include <string_view>
Expand Down
2 changes: 1 addition & 1 deletion tests/cso2/nexon/test_pkgindex.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

#include <fstream>
#include <iostream>
Expand Down
2 changes: 0 additions & 2 deletions tests/test_main.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion tests/tfo/nexon/test_pkgfile.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

#include <iostream>
#include <string_view>
Expand Down
2 changes: 1 addition & 1 deletion tests/tfo/nexon/test_pkgindex.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_all.hpp>

#include <fstream>
#include <iostream>
Expand Down

0 comments on commit fca9721

Please sign in to comment.