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 15, 2022
1 parent bfe53aa commit 1a914d9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ 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()
use_test("OverlayTest")
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::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 @@ -21,7 +21,10 @@
#include <QtGui>
#include <QtNetwork>

#include <ctime>
#include <QWidget>
#include <QMainWindow>
#include <QApplication>


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 1a914d9

Please sign in to comment.