-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fixed unit tests on Windows. We will adapt them for other platforms as well. nntp and postprocessor tests do not pass. We will debug them later. - separated the tests from the application itself - using CMake to configure files for building tests. We will completely switch to CMake later. - deleted obsolete Autotools generated files - updated README
- Loading branch information
Showing
57 changed files
with
1,673 additions
and
28,925 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: windows tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- feature/* | ||
- develop | ||
- main | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: [self-hosted, windows] | ||
|
||
steps: | ||
|
||
- name: Prepare environment | ||
run: | | ||
"C:\Program Files\CMake\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build | ||
run: | | ||
cmake --version | ||
mkdir build | ||
cd build | ||
cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static | ||
cmake --build . --config Release -j 2 | ||
- name: Test | ||
run: | | ||
cd build | ||
ctest -C Release | ||
- name: Upload test artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: nzbget-windows-test-log | ||
path: build/Testing/Temporary/LastTest.log | ||
retention-days: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
cmake_minimum_required(VERSION 3.22) | ||
|
||
project( | ||
nzbget | ||
VERSION "22.0" | ||
DESCRIPTION "NZBGet is a binary downloader, which downloads files from Usenet" | ||
LANGUAGES C CXX | ||
) | ||
|
||
option(ENABLE_TESTS "Enable tests" ON) | ||
|
||
set(VERSION "22") | ||
set(PACKAGE "nzbget") | ||
add_compile_definitions(HAVE_CONFIG_H=1) | ||
|
||
configure_file( | ||
${CMAKE_SOURCE_DIR}/cmake_config.h.in | ||
${CMAKE_BINARY_DIR}/config.h | ||
) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_C_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_C_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
set(CMAKE_C_EXTENSIONS OFF) | ||
set(BUILD_SHARED_LIBS OFF) | ||
set(OPENSSL_USE_STATIC_LIBS ON) | ||
set(ZLIB_USE_STATIC_LIBS ON) | ||
set(Boost_USE_STATIC_LIBS ON) | ||
set(Boost_USE_MULTITHREADED ON) | ||
set(Boost_USE_STATIC_RUNTIME OFF) | ||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") | ||
|
||
find_package(OpenSSL REQUIRED) | ||
find_package(ZLIB REQUIRED) | ||
|
||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Weverything") | ||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall") | ||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /W4") | ||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} winmm.lib /NODEFAULTLIB:msvcrt.lib;libcmt.lib;msvcrtd.lib") | ||
endif() | ||
|
||
include_directories(lib/regex) | ||
include_directories(${CMAKE_BINARY_DIR}) | ||
add_subdirectory(lib) | ||
|
||
if (NOT WIN32) | ||
find_package(LibXml2 REQUIRED) | ||
include_directories(${LIBXML2_INCLUDE_DIR}) | ||
execute_process(COMMAND chmod +x ${CMAKE_SOURCE_DIR}/code_revision.sh) | ||
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/code_revision.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
execute_process(COMMAND mv ${CMAKE_SOURCE_DIR}/code_revision.cpp ${CMAKE_BINARY_DIR}) | ||
endif() | ||
|
||
if(ENABLE_TESTS) | ||
include(CTest) | ||
add_subdirectory(tests) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.