Skip to content

Commit 733228a

Browse files
author
Christian Feldmann
committed
Try testing with QGuiApplication and QT_QPA_PLATFORM set to offscreen.
1 parent 53e4dc1 commit 733228a

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

.github/workflows/Build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
make -j$(nproc)
3131
- name: Run Unittests
3232
run: $GITHUB_WORKSPACE/build/YUViewUnitTest/YUViewUnitTest
33+
env:
34+
QT_QPA_PLATFORM: 'offscreen'
3335
build-mac-native:
3436
runs-on: ${{ matrix.os }}
3537
strategy:
@@ -51,6 +53,8 @@ jobs:
5153
make -j $(sysctl -n hw.logicalcpu)
5254
- name: Run Unittests
5355
run: $GITHUB_WORKSPACE/build/YUViewUnitTest/YUViewUnitTest
56+
env:
57+
QT_QPA_PLATFORM: 'offscreen'
5458
build-linux-mac:
5559
runs-on: ${{ matrix.os }}
5660
strategy:
@@ -105,6 +109,8 @@ jobs:
105109
make -j 4
106110
- name: Run Unittests
107111
run: $GITHUB_WORKSPACE/build/YUViewUnitTest/YUViewUnitTest
112+
env:
113+
QT_QPA_PLATFORM: 'offscreen'
108114
- name: Build App (Mac)
109115
if: runner.os == 'macOS'
110116
run: |
@@ -184,6 +190,8 @@ jobs:
184190
jom
185191
- name: Run Unittests
186192
run: ${{ github.workspace }}\build\YUViewUnitTest\YUViewUnitTest
193+
env:
194+
QT_QPA_PLATFORM: 'offscreen'
187195
- name: WindeployQT
188196
run: |
189197
mkdir deploy

YUViewUnitTest/YUViewUnitTest.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ INCLUDEPATH += $$top_srcdir/submodules/googletest/googletest/include \
1717
$$top_srcdir/YUViewUnitTest/common \
1818
$$top_builddir/YUViewLib
1919
LIBS += -L$$top_builddir/submodules/googletest-qmake/gtest -lgtest
20-
LIBS += -L$$top_builddir/submodules/googletest-qmake/gtest_main -lgtest_main
2120
LIBS += -L$$top_builddir/YUViewLib -lYUViewLib
2221

2322
#win32-msvc* {

YUViewUnitTest/main.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/* This file is part of YUView - The YUV player with advanced analytics toolset
2+
* <https://github.com/IENT/YUView>
3+
* Copyright (C) 2015 Institut für Nachrichtentechnik, RWTH Aachen University, GERMANY
4+
*
5+
* This program is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation; either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* In addition, as a special exception, the copyright holders give
11+
* permission to link the code of portions of this program with the
12+
* OpenSSL library under certain conditions as described in each
13+
* individual source file, and distribute linked combinations including
14+
* the two.
15+
*
16+
* You must obey the GNU General Public License in all respects for all
17+
* of the code used other than OpenSSL. If you modify file(s) with this
18+
* exception, you may extend this exception to your version of the
19+
* file(s), but you are not obligated to do so. If you do not wish to do
20+
* so, delete this exception statement from your version. If you delete
21+
* this exception statement from all source files in the program, then
22+
* also delete it here.
23+
*
24+
* This program is distributed in the hope that it will be useful,
25+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
26+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27+
* GNU General Public License for more details.
28+
*
29+
* You should have received a copy of the GNU General Public License
30+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
31+
*/
32+
33+
#include <QGuiApplication>
34+
#include <gtest/gtest.h>
35+
36+
int main(int argc, char **argv)
37+
{
38+
testing::InitGoogleTest(&argc, argv);
39+
QGuiApplication app(argc, argv);
40+
return RUN_ALL_TESTS();
41+
}

0 commit comments

Comments
 (0)