Skip to content

Instantly share code, notes, and snippets.

@mitchcurtis
Last active March 27, 2021 17:25
Show Gist options
  • Save mitchcurtis/d67cf9736597e99412081a0095296275 to your computer and use it in GitHub Desktop.
Save mitchcurtis/d67cf9736597e99412081a0095296275 to your computer and use it in GitHub Desktop.
Qt Quick Auto Test (QML)
#include <QtQuickTest/quicktest.h>
QUICK_TEST_MAIN(untitled)
TEMPLATE = app
TARGET = tst_example
CONFIG += warn_on qmltestcase
SOURCES += tst_untitled.cpp
import QtQuick 2.6
import QtTest 1.0
TestCase {
name: "Untitled"
function test_math() {
compare(2 + 2, 4, "2 + 2 = 4")
}
function test_fail() {
compare(2 + 2, 5, "2 + 2 = 5")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment