From 0666bb22443d5e5e3c66025594894e56f162c77b Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 24 Mar 2024 18:09:29 -0400 Subject: [PATCH] rename target sunshine_tests to test_sunshine --- .github/workflows/CI.yml | 4 +- docker/debian-bookworm.dockerfile | 2 +- docker/debian-bullseye.dockerfile | 2 +- docker/fedora-38.dockerfile | 2 +- docker/fedora-39.dockerfile | 2 +- docker/ubuntu-20.04.dockerfile | 2 +- docker/ubuntu-22.04.dockerfile | 2 +- docs/source/contributing/testing.rst | 52 ++++++++++++++++--- packaging/linux/Arch/PKGBUILD | 2 +- .../linux/flatpak/dev.lizardbyte.sunshine.yml | 2 +- packaging/macos/Portfile | 2 +- tests/CMakeLists.txt | 2 +- 12 files changed, 56 insertions(+), 20 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 07852ca52ef..155494af200 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -490,7 +490,7 @@ jobs: export DISPLAY=:1 Xvfb ${DISPLAY} -screen 0 1024x768x24 & - ./sunshine_tests --gtest_color=yes + ./test_sunshine --gtest_color=yes - name: Generate gcov report # any except canceled or skipped @@ -1033,7 +1033,7 @@ jobs: shell: msys2 {0} working-directory: build/tests run: | - ./sunshine_tests.exe --gtest_color=yes + ./test_sunshine.exe --gtest_color=yes - name: Generate gcov report # any except canceled or skipped diff --git a/docker/debian-bookworm.dockerfile b/docker/debian-bookworm.dockerfile index 16b5444da78..7f49bb1a493 100644 --- a/docker/debian-bookworm.dockerfile +++ b/docker/debian-bookworm.dockerfile @@ -134,7 +134,7 @@ RUN <<_TEST set -e export DISPLAY=:1 Xvfb ${DISPLAY} -screen 0 1024x768x24 & -./sunshine_tests --gtest_color=yes +./test_sunshine --gtest_color=yes _TEST FROM scratch AS artifacts diff --git a/docker/debian-bullseye.dockerfile b/docker/debian-bullseye.dockerfile index 8c7c5a6ecaa..5e0667f0180 100644 --- a/docker/debian-bullseye.dockerfile +++ b/docker/debian-bullseye.dockerfile @@ -148,7 +148,7 @@ RUN <<_TEST set -e export DISPLAY=:1 Xvfb ${DISPLAY} -screen 0 1024x768x24 & -./sunshine_tests --gtest_color=yes +./test_sunshine --gtest_color=yes _TEST FROM scratch AS artifacts diff --git a/docker/fedora-38.dockerfile b/docker/fedora-38.dockerfile index 277f72c8c61..50d9fd66acb 100644 --- a/docker/fedora-38.dockerfile +++ b/docker/fedora-38.dockerfile @@ -129,7 +129,7 @@ RUN <<_TEST set -e export DISPLAY=:1 Xvfb ${DISPLAY} -screen 0 1024x768x24 & -./sunshine_tests --gtest_color=yes +./test_sunshine --gtest_color=yes _TEST FROM scratch AS artifacts diff --git a/docker/fedora-39.dockerfile b/docker/fedora-39.dockerfile index b855d2b81d5..eff8194877a 100644 --- a/docker/fedora-39.dockerfile +++ b/docker/fedora-39.dockerfile @@ -136,7 +136,7 @@ RUN <<_TEST set -e export DISPLAY=:1 Xvfb ${DISPLAY} -screen 0 1024x768x24 & -./sunshine_tests --gtest_color=yes +./test_sunshine --gtest_color=yes _TEST FROM scratch AS artifacts diff --git a/docker/ubuntu-20.04.dockerfile b/docker/ubuntu-20.04.dockerfile index e31403a5599..8a88d72bd91 100644 --- a/docker/ubuntu-20.04.dockerfile +++ b/docker/ubuntu-20.04.dockerfile @@ -184,7 +184,7 @@ RUN <<_TEST set -e export DISPLAY=:1 Xvfb ${DISPLAY} -screen 0 1024x768x24 & -./sunshine_tests --gtest_color=yes +./test_sunshine --gtest_color=yes _TEST FROM scratch AS artifacts diff --git a/docker/ubuntu-22.04.dockerfile b/docker/ubuntu-22.04.dockerfile index 624959a4727..65b8929c0c2 100644 --- a/docker/ubuntu-22.04.dockerfile +++ b/docker/ubuntu-22.04.dockerfile @@ -149,7 +149,7 @@ RUN <<_TEST set -e export DISPLAY=:1 Xvfb ${DISPLAY} -screen 0 1024x768x24 & -./sunshine_tests --gtest_color=yes +./test_sunshine --gtest_color=yes _TEST FROM scratch AS artifacts diff --git a/docs/source/contributing/testing.rst b/docs/source/contributing/testing.rst index 9fcfe3aa0cc..2d9f6290d3f 100644 --- a/docs/source/contributing/testing.rst +++ b/docs/source/contributing/testing.rst @@ -67,19 +67,55 @@ can be disabled by setting the `BUILD_TESTS` CMake option to `OFF`. To run the tests, execute the following command from the build directory: -.. code-block:: bash +.. tab:: Linux - pushd tests - sunshine_tests.exe - popd + .. code-block:: bash + + pushd tests + ./test_sunshine + popd + +.. tab:: macOS + + .. code-block:: bash + + pushd tests + ./test_sunshine + popd + +.. tab:: Windows + + .. code-block:: bash + + pushd tests + test_sunshine.exe + popd To see all available options, run the tests with the `--help` option. -.. code-block:: bash +.. tab:: Linux + + .. code-block:: bash + + pushd tests + ./test_sunshine --help + popd + +.. tab:: macOS + + .. code-block:: bash + + pushd tests + ./test_sunshine --help + popd + +.. tab:: Windows + + .. code-block:: bash - pushd tests - sunshine_tests.exe --help - popd + pushd tests + test_sunshine.exe --help + popd Some tests rely on Python to run. CMake will search for Python and enable the docs tests if it is found, otherwise cmake will fail. You can manually disable the tests by setting the `TESTS_ENABLE_PYTHON_TESTS` CMake option to diff --git a/packaging/linux/Arch/PKGBUILD b/packaging/linux/Arch/PKGBUILD index dab9ccbbb69..6fde7fe5a90 100644 --- a/packaging/linux/Arch/PKGBUILD +++ b/packaging/linux/Arch/PKGBUILD @@ -85,7 +85,7 @@ check() { export CXX=g++-12 cd "${srcdir}/build/tests" - ./sunshine_tests --gtest_color=yes + ./test_sunshine --gtest_color=yes } package() { diff --git a/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml b/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml index 58451da1d55..0e891dacf0e 100644 --- a/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml +++ b/packaging/linux/flatpak/dev.lizardbyte.sunshine.yml @@ -364,4 +364,4 @@ modules: run-tests: true test-rule: "" # empty to disable test-commands: - - xvfb-run tests/sunshine_tests --gtest_color=yes + - xvfb-run tests/test_sunshine --gtest_color=yes diff --git a/packaging/macos/Portfile b/packaging/macos/Portfile index d0b6c47b502..aacc3209fff 100644 --- a/packaging/macos/Portfile +++ b/packaging/macos/Portfile @@ -72,5 +72,5 @@ notes-append "See our documentation at 'https://docs.lizardbyte.dev/projects/sun test.run yes test.dir ${build.dir}/tests test.target "" -test.cmd ./sunshine_tests +test.cmd ./test_sunshine test.args --gtest_color=yes diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 81ad4eac749..e4583f9c6a5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.13) # https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md#foundational-c-support -project(sunshine_tests) +project(test_sunshine) set(PYTHON_PREFERRED_VERSION 3.11) set(PYTHON_MINIMUM_VERSION 3.9)