Skip to content

Commit

Permalink
TEST(overlay): adds build files for OverlayTest
Browse files Browse the repository at this point in the history
adds a test application that connects to MumbleOverlayPipe and displays the overlay as configured
  • Loading branch information
carlocastoldi committed Nov 14, 2022
1 parent bfe53aa commit 4213b41
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/mumble/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,12 @@ else()
target_compile_definitions(mumble_client_object_lib PUBLIC "RESTRICT=__restrict__")
endif()

target_sources(mumble_client_object_lib
PRIVATE
"SharedMemory.h"
"SharedMemory.cpp"
)

if(WIN32)
target_sources(mumble_client_object_lib PRIVATE
"GlobalShortcut_win.cpp"
Expand Down Expand Up @@ -883,6 +889,8 @@ if(overlay)
"OverlayUserGroup.h"
"PathListWidget.cpp"
"PathListWidget.h"
"SharedMemory.h"
"SharedMemory.cpp"
)

if(WIN32)
Expand Down
3 changes: 3 additions & 0 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ if(client)
# For some reason Qt segfaults when executing this test on FreeBSD without a display (even when using the offscreen plugin)
use_test("TestSettingsJSONSerialization")
endif()
if(overlay)
use_test("OverlayTest")
endif()
endif()

if(server)
Expand Down
15 changes: 15 additions & 0 deletions src/tests/OverlayTest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2020-2022 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.

add_executable(OverlayTest OverlayTest.cpp)

set_target_properties(OverlayTest PROPERTIES AUTOMOC ON)

find_pkg(Qt5 COMPONENTS Gui Widgets REQUIRED)

target_link_libraries(OverlayTest PRIVATE mumble_client_object_lib)
target_link_libraries(OverlayTest PRIVATE shared Qt5::Gui Qt5::Test Qt5::Widgets)

add_test(NAME OverlayTest COMMAND $<TARGET_FILE:OverlayTest>)
7 changes: 5 additions & 2 deletions src/tests/OverlayTest/OverlayTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
#include <QtCore>
#include <QtGui>
#include <QtNetwork>
#include <QWidget>
#include <QElapsedTimer>
#include <QMainWindow>
#include <QApplication>

#include <ctime>

class OverlayWidget : public QWidget {
Q_OBJECT
Expand All @@ -33,7 +36,7 @@ class OverlayWidget : public QWidget {
SharedMemory2 *smMem;
QTimer *qtTimer;
QRect qrActive;
QTime qtWall;
QElapsedTimer qtWall;

unsigned int iFrameCount;
int iLastFpsUpdate;
Expand Down

0 comments on commit 4213b41

Please sign in to comment.