Sunshine/tests/unit/test_video.cpp
ns6089 764ce03520
Some checks failed
CI / GitHub Env Debug (push) Waiting to run
CI / Setup Release (push) Waiting to run
CI / Setup Flatpak Matrix (push) Waiting to run
CI / Linux Flatpak (push) Blocked by required conditions
CI / Linux ${{ matrix.type }} (--appimage-build, 22.04, AppImage) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 12) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 13) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 14) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest, true) (push) Blocked by required conditions
CI / Macports (macOS-${{ matrix.os_version }}) (12, true) (push) Blocked by required conditions
CI / Macports (macOS-${{ matrix.os_version }}) (13) (push) Blocked by required conditions
CI / Macports (macOS-${{ matrix.os_version }}) (14) (push) Blocked by required conditions
CI / Windows (push) Blocked by required conditions
CI Docker / Check Dockerfiles (push) Waiting to run
CI Docker / Setup Release (push) Blocked by required conditions
CI Docker / Lint Dockerfile${{ matrix.tag }} (push) Blocked by required conditions
CI Docker / Docker${{ matrix.tag }} (push) Blocked by required conditions
CodeQL / Get language matrix (push) Waiting to run
CodeQL / Analyze (${{ matrix.name }}) (push) Blocked by required conditions
Build GH-Pages / update_pages (push) Waiting to run
localize / Update Localization (push) Has been cancelled
feat(tests): rework tests in numerous ways (#3059)
2024-08-22 16:48:24 -04:00

49 lines
1.1 KiB
C++

/**
* @file tests/unit/test_video.cpp
* @brief Test src/video.*.
*/
#include <src/video.h>
#include "../tests_common.h"
struct EncoderTest: PlatformTestSuite, testing::WithParamInterface<video::encoder_t *> {
void
SetUp() override {
auto &encoder = *GetParam();
if (!video::validate_encoder(encoder, false)) {
// Encoder failed validation,
// if it's software - fail (unless overriden with compile definition), otherwise skip
if (encoder.name == "software" && std::string(TESTS_SOFTWARE_ENCODER_UNAVAILABLE) == "fail") {
FAIL() << "Software encoder not available";
}
else {
GTEST_SKIP() << "Encoder not available";
}
}
}
};
INSTANTIATE_TEST_SUITE_P(
EncoderVariants,
EncoderTest,
testing::Values(
#if !defined(__APPLE__)
&video::nvenc,
#endif
#ifdef _WIN32
&video::amdvce,
&video::quicksync,
#endif
#ifdef __linux__
&video::vaapi,
#endif
#ifdef __APPLE__
&video::videotoolbox,
#endif
&video::software),
[](const auto &info) { return std::string(info.param->name); });
TEST_P(EncoderTest, ValidateEncoder) {
// todo:: test something besides fixture setup
}