feature/integrate-jenkins-code-coverage #3

Merged
torsten merged 19 commits from feature/integrate-jenkins-code-coverage into main 2026-10-22 20:59:05 +00:00
3 changed files with 36 additions and 50 deletions
Showing only changes of commit 468e18560f - Show all commits

No files matched your search

@@ -61,7 +61,6 @@ enable_testing()
# Add test executable
add_executable(Qt6MigratedBenchmarkTest
tests/test_main.cpp
tests/test_mainwindow.cpp
MainWindow.h
MainWindow.cpp
)
@@ -1,3 +1,5 @@
#include "MainWindow.h"
#include <QtTest/QtTest>
class TestMainWindow : public QObject
@@ -9,6 +11,10 @@ class TestMainWindow : public QObject
void testValidateInputInvalid();
void testValidateInputEmpty();
void testValidateInputMixedCase();
void testMainWindowCreation();
void testWindowTitle();
void testValidateInputMethod();
void testGetScreenInfo();
};
void TestMainWindow::testValidateInputValid()
@@ -47,6 +53,36 @@ void TestMainWindow::testValidateInputMixedCase()
QVERIFY(pattern.match("aBcDeF999").hasMatch());
}
void TestMainWindow::testMainWindowCreation()
{
MainWindow window;
QVERIFY(!window.windowTitle().isEmpty());
}
void TestMainWindow::testWindowTitle()
{
MainWindow window;
QCOMPARE(window.windowTitle(), QStringLiteral("Qt6 Legacy Migration Benchmark"));
}
void TestMainWindow::testValidateInputMethod()
{
MainWindow window;
QVERIFY(window.validateInput(QStringLiteral("Test123")));
QVERIFY(window.validateInput(QStringLiteral("abc456")));
QVERIFY(!window.validateInput(QStringLiteral("123Test")));
QVERIFY(!window.validateInput(QStringLiteral("")));
}
void TestMainWindow::testGetScreenInfo()
{
MainWindow window;
QString info = window.getScreenInfo();
QVERIFY(!info.isEmpty());
QVERIFY(info.contains(QStringLiteral("Screen:")));
}
QTEST_MAIN(TestMainWindow)
#include "test_main.moc"
@@ -1,49 +0,0 @@
#include "MainWindow.h"
#include <QApplication>
#include <QtTest/QtTest>
class TestMainWindowWidget : public QObject
{
Q_OBJECT
private slots:
void testMainWindowCreation();
void testWindowTitle();
void testValidateInputMethod();
void testGetScreenInfo();
};
void TestMainWindowWidget::testMainWindowCreation()
{
MainWindow window;
QVERIFY(!window.windowTitle().isEmpty());
}
void TestMainWindowWidget::testWindowTitle()
{
MainWindow window;
QCOMPARE(window.windowTitle(), QStringLiteral("Qt6 Legacy Migration Benchmark"));
}
void TestMainWindowWidget::testValidateInputMethod()
{
MainWindow window;
QVERIFY(window.validateInput(QStringLiteral("Test123")));
QVERIFY(window.validateInput(QStringLiteral("abc456")));
QVERIFY(!window.validateInput(QStringLiteral("123Test")));
QVERIFY(!window.validateInput(QStringLiteral("")));
}
void TestMainWindowWidget::testGetScreenInfo()
{
MainWindow window;
QString info = window.getScreenInfo();
QVERIFY(!info.isEmpty());
QVERIFY(info.contains(QStringLiteral("Screen:")));
}
QTEST_MAIN(TestMainWindowWidget)
#include "test_mainwindow.moc"