File: testutil.h

package info (click to toggle)
texstudio 2.8.4%2Bdebian-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 39,108 kB
  • ctags: 13,390
  • sloc: cpp: 84,770; xml: 10,109; ansic: 6,865; sh: 150; makefile: 82
file content (31 lines) | stat: -rw-r--r-- 1,034 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef TESTUTIL_H
#define TESTUTIL_H
#ifndef QT_NO_DEBUG
#include <QtTest/QtTest>
#include <QMessageBox>
#include <QObject>
//#define QSVERIFY(a,b) QVERIFY(a)
#define QSVERIFY2(a,b) QVERIFY2(a, qPrintable(QString("%1").arg(b)))
#define QEQUAL(a,b) QSVERIFY2((a)==(b), QString("equal failed: got \"%1\" !=expected \"%2\" ").arg(a).arg(b))
#define QEQUAL2(a,b,m) QSVERIFY2((a)==(b), QString("equal failed: got \"%1\" !=expected \"%2\"  reason:%3").arg(a).arg(b).arg(m))

#define Q__POSITION__ QString(__FILE__ ": %1").arg(__LINE__)

namespace QTest{
class MessageBoxCloser:public QObject{
	Q_OBJECT
public:
	MessageBoxCloser(bool mustExists=false, QMessageBox::StandardButton button=QMessageBox::NoButton);
private:
	bool m_mustExists;
	QMessageBox::StandardButton m_button;
private slots: 
	void closeNow();
};
void closeMessageBoxLater(bool mustExists=false, QMessageBox::StandardButton button=QMessageBox::NoButton);
void messageBoxShouldBeClose();
}

extern bool globalExecuteAllTests;
#endif
#endif