[Kde-bindings] KDE/kdebindings/ruby/qttest
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Fri Nov 13 19:10:22 UTC 2009
SVN commit 1048695 by rdale:
* Add some 'macro-like' methods to Qt::Test to make it work like the C++
version. For instance, QVERIFY can be used like this:
def myFirstTest()
QVERIFY('1 == 1')
qDebug("myFirstTest()")
end
CCMAIL: kde-bindings at kde.org
CCMAIL: pilz at osp-dd.de
M +25 -0 qttest.rb
--- trunk/KDE/kdebindings/ruby/qttest/qttest.rb #1048694:1048695
@@ -31,3 +31,28 @@
end
end
end
+
+module Qt
+ class Base
+ def QVERIFY(statement)
+ Qt::Test.qVerify(eval(statement), statement, "", __FILE__, __LINE__)
+ end
+
+ def QFAIL(message)
+ Qt::Test.qFail(message, __FILE__, __LINE__)
+ end
+
+ def QVERIFY2(statement, description)
+ Qt::Test.qVerify(eval(statement), statement, description, __FILE__, __LINE__)
+ end
+
+ def QCOMPARE(actual, expected)
+ Qt::Test.qCompare(eval(actual), eval(expected), actual, expected, __FILE__, __LINE__)
+ end
+
+ def QSKIP(statement, mode)
+ Qt::Test.qSkip(statement, mode, __FILE__, __LINE__)
+ end
+ end
+end
+
More information about the Kde-bindings
mailing list