Skip to content

Commit 8c12a9a

Browse files
chore: use lizardbyte-common in c++ (#221)
1 parent ee7ab0b commit 8c12a9a

29 files changed

Lines changed: 75 additions & 46 deletions

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
url = https://github.com/FFmpeg/FFmpeg.git
99
branch = release/8.1
1010
shallow = true
11-
[submodule "third-party/googletest"]
12-
path = third-party/googletest
13-
url = https://github.com/google/googletest.git
14-
shallow = true
1511
[submodule "third-party/lizardbyte-common"]
1612
path = third-party/lizardbyte-common
1713
url = https://github.com/LizardByte/lizardbyte-common.git

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
# Moonlight-XboxOG
2-
3-
[![GitHub stars](https://img.shields.io/github/stars/lizardbyte/moonlight-xboxog.svg?logo=github&style=for-the-badge)](https://github.com/LizardByte/Moonlight-XboxOG)
4-
[![GitHub Releases](https://img.shields.io/github/downloads/lizardbyte/moonlight-xboxog/total.svg?style=for-the-badge&logo=github)](https://github.com/LizardByte/Moonlight-XboxOG/releases/latest)
5-
[![GitHub Workflow Status (CI)](https://img.shields.io/github/actions/workflow/status/lizardbyte/moonlight-xboxog/ci.yml.svg?branch=master&label=CI%20build&logo=github&style=for-the-badge)](https://github.com/LizardByte/Moonlight-XboxOG/actions/workflows/CI.yml?query=branch%3Amaster)
6-
[![Codecov](https://img.shields.io/codecov/c/gh/LizardByte/Moonlight-XboxOG?token=DoIh5pkEzA&style=for-the-badge&logo=codecov&label=codecov)](https://codecov.io/gh/LizardByte/Moonlight-XboxOG)
7-
8-
Port of Moonlight for the Original Xbox.
1+
<div align="center">
2+
<img
3+
src="moonlight-logo.svg"
4+
alt="Moonlight icon"
5+
width="256"
6+
/>
7+
<h1 align="center">Moonlight-XboxOG</h1>
8+
<h4 align="center">Port of Moonlight for the Original Xbox.</h4>
9+
</div>
10+
11+
<div align="center">
12+
<a href="https://github.com/LizardByte/Moonlight-XboxOG"><img src="https://img.shields.io/github/stars/lizardbyte/Moonlight-XboxOG.svg?logo=github&style=for-the-badge" alt="GitHub stars"></a>
13+
<a href="https://github.com/LizardByte/Moonlight-XboxOG/actions/workflows/ci.yml?query=branch%3Amaster"><img src="https://img.shields.io/github/actions/workflow/status/lizardbyte/Moonlight-XboxOG/ci.yml.svg?branch=master&label=CI%20build&logo=github&style=for-the-badge" alt="GitHub Workflow Status (CI)"></a>
14+
<a href="https://codecov.io/gh/LizardByte/Moonlight-XboxOG"><img src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fapp.lizardbyte.dev%2Fdashboard%2Fshields%2Fcodecov%2FMoonlight-XboxOG.json&style=for-the-badge&logo=codecov" alt="Codecov"></a>
15+
<a href="https://sonarcloud.io/project/overview?id=Moonlight-XboxOG"><img src="https://img.shields.io/sonar/quality_gate/LizardByte_Moonlight-XboxOG.svg?server=https%3A%2F%2Fsonarcloud.io&style=for-the-badge&logo=sonarqubecloud&label=sonarcloud" alt="SonarCloud"></a>
16+
</div>
17+
18+
# Overview
919

1020
![Splash Screen](./docs/images/screenshots/01-splash.png)
1121
![Hosts Screen](./docs/images/screenshots/02-hosts.png)
1222
![Apps Screen](./docs/images/screenshots/03-apps.png)
1323

1424

15-
## Build
25+
## 🛠️ Build
1626

1727
### Prerequisites
1828

@@ -195,7 +205,7 @@ scripts\setup-xemu.cmd --skip-support-files
195205
> You can set Xemu to use widescreen mode by using https://github.com/Ernegien/XboxEepromEditor
196206
> but 1080i does not work in Xemu.
197207
198-
## Todo
208+
## 📋 Todo
199209

200210
- Build
201211
- [x] Build in GitHub CI

docs/Doxyfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
DOCSET_BUNDLE_ID = dev.lizardbyte.Moonlight-XboxOG
2626
DOCSET_PUBLISHER_ID = dev.lizardbyte.Moonlight-XboxOG.documentation
2727
PROJECT_BRIEF = "Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console."
28+
PROJECT_ICON = ../moonlight-logo.svg
29+
PROJECT_LOGO = ../moonlight-logo.svg
2830
PROJECT_NAME = Moonlight-XboxOG
2931

3032
# project specific settings

moonlight-logo.svg

Lines changed: 5 additions & 0 deletions
Loading

tests/CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@ if(NOT DEFINED MOONLIGHT_HOST_TESTABLE_SOURCES)
1010
message(FATAL_ERROR "tests/CMakeLists.txt must be configured from the top-level CMake project")
1111
endif()
1212

13-
set(GTEST_SOURCE_DIR "${CMAKE_SOURCE_DIR}/third-party/googletest")
13+
set(GTEST_SOURCE_DIR "${CMAKE_SOURCE_DIR}/third-party/lizardbyte-common/third-party/googletest")
1414
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
1515
set(INSTALL_GMOCK OFF CACHE BOOL "" FORCE)
1616
add_subdirectory("${GTEST_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/googletest" EXCLUDE_FROM_ALL)
1717

18+
set(LIZARDBYTE_COMMON_BUILD_TEST_SUPPORT ON CACHE BOOL "Build lizardbyte-common GoogleTest support helpers" FORCE)
19+
if(NOT TARGET lizardbyte::common)
20+
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/lizardbyte-common"
21+
"${CMAKE_CURRENT_BINARY_DIR}/lizardbyte-common"
22+
EXCLUDE_FROM_ALL)
23+
elseif(NOT TARGET lizardbyte::test_support)
24+
message(FATAL_ERROR "Moonlight tests require lizardbyte::test_support")
25+
endif()
1826
if(NOT TARGET moonlight-common-c OR NOT TARGET Moonlight::OpenSSL)
1927
message(FATAL_ERROR
2028
"tests/CMakeLists.txt requires the shared Moonlight dependency targets from the top-level configure")
@@ -52,7 +60,8 @@ target_include_directories(${PROJECT_NAME}
5260
target_link_libraries(${PROJECT_NAME}
5361
PRIVATE
5462
gtest_main
55-
Moonlight::OpenSSL)
63+
Moonlight::OpenSSL
64+
lizardbyte::test_support)
5665
target_compile_definitions(${PROJECT_NAME}
5766
PRIVATE
5867
TOML_EXCEPTIONS=0

tests/unit/app/client_state_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "src/app/client_state.h"
77

88
// lib includes
9-
#include <gtest/gtest.h>
9+
#include <lizardbyte/common/testing.h>
1010
#include <string>
1111

1212
// test includes

tests/unit/app/host_records_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <vector>
1010

1111
// lib includes
12-
#include <gtest/gtest.h>
12+
#include <lizardbyte/common/testing.h>
1313

1414
// test includes
1515
#include "tests/support/network_test_constants.h"

tests/unit/app/pairing_flow_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "src/app/pairing_flow.h"
77

88
// lib includes
9-
#include <gtest/gtest.h>
9+
#include <lizardbyte/common/testing.h>
1010

1111
// test includes
1212
#include "tests/support/network_test_constants.h"

tests/unit/app/settings_storage_test.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <string_view>
1212

1313
// lib includes
14-
#include <gtest/gtest.h>
14+
#include <lizardbyte/common/testing.h>
1515

1616
// test includes
1717
#include "tests/support/filesystem_test_utils.h"
@@ -25,18 +25,20 @@ namespace {
2525
ASSERT_EQ(std::fclose(file), 0);
2626
}
2727

28-
class SettingsStorageTest: public ::testing::Test { // NOSONAR(cpp:S3656) protected members are required by gtest
28+
class SettingsStorageTest: public BaseTest { // NOSONAR(cpp:S3656) protected members are required by gtest
2929
protected:
3030
std::string testDirectory = "settings-storage-test";
3131
std::string settingsPath = test_support::join_path(testDirectory, "moonlight.toml");
3232

3333
void SetUp() override {
34+
BaseTest::SetUp();
3435
ASSERT_TRUE(test_support::create_directory(testDirectory));
3536
}
3637

3738
void TearDown() override {
3839
test_support::remove_if_present(settingsPath);
3940
test_support::remove_directory_if_present(testDirectory);
41+
BaseTest::TearDown();
4042
}
4143
};
4244

tests/unit/input/navigation_input_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "src/input/navigation_input.h"
77

88
// lib includes
9-
#include <gtest/gtest.h>
9+
#include <lizardbyte/common/testing.h>
1010

1111
namespace {
1212

0 commit comments

Comments
 (0)