diff --git a/tests/auto/debugger/debugger.pro b/tests/auto/debugger/debugger.pro index a9947dfcc8218df1bdd6f20985a7b0c6e79c7db5..bae27e4375b57804e09de0f956dbc5b23b39ede7 100644 --- a/tests/auto/debugger/debugger.pro +++ b/tests/auto/debugger/debugger.pro @@ -1,7 +1,7 @@ TEMPLATE = subdirs -SUBDIRS = dumpers.pro plugin.pro version.pro +SUBDIRS = dumpers.pro version.pro !win32-msvc*: SUBDIRS += gdb.pro diff --git a/tests/auto/debugger/plugin.pro b/tests/auto/debugger/plugin.pro deleted file mode 100644 index 930eab89f7a64f5411c4df43d3739f39f9aa57de..0000000000000000000000000000000000000000 --- a/tests/auto/debugger/plugin.pro +++ /dev/null @@ -1,12 +0,0 @@ -include(../qttest.pri) - -DEBUGGERDIR = $$IDE_SOURCE_TREE/src/plugins/debugger -UTILSDIR = $$IDE_SOURCE_TREE/src/libs -MACROSDIR = $$IDE_SOURCE_TREE/share/qtcreator/gdbmacros - -SOURCES += \ - tst_plugin.cpp \ - -DEFINES += MACROSDEBUG - -INCLUDEPATH += $$DEBUGGERDIR $$UTILSDIR $$MACROSDIR diff --git a/tests/auto/debugger/tst_plugin.cpp b/tests/auto/debugger/tst_plugin.cpp deleted file mode 100644 index 635b7e7ff0a98a47f402c521244d138643e89e5a..0000000000000000000000000000000000000000 --- a/tests/auto/debugger/tst_plugin.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include <ctype.h> - -#include <QtCore/QObject> -#include <QtCore/QProcess> -#include <QtCore/QFileInfo> -#include <QtCore/QMap> -#include <QtCore/QMetaMethod> -#include <QtCore/QModelIndex> -#if QT_VERSION >= 0x040500 -#include <QtCore/QSharedPointer> -#endif -#include <QtCore/QStringList> -#include <QtCore/QTextCodec> -#include <QtGui/QApplication> -#include <QtGui/QDialog> -#include <QtGui/QImage> -#include <QtGui/QPixmap> -#include <QtGui/QStandardItemModel> -#include <QtGui/QStringListModel> -#include <QtTest/QtTest> - -//#include <QtTest/qtest_gui.h> - -#include <QtCore/private/qobject_p.h> - -#include "gdb/gdbmi.h" -#include "gdbmacros.h" -#include "gdbmacros_p.h" - -#undef NS -#ifdef QT_NAMESPACE -# define STRINGIFY0(s) #s -# define STRINGIFY1(s) STRINGIFY0(s) -# define NS STRINGIFY1(QT_NAMESPACE) "::" -#else -# define NS "" -#endif - -using namespace Debugger; -using namespace Debugger::Internal; - - -static QByteArray stripped(QByteArray ba) -{ - for (int i = ba.size(); --i >= 0; ) { - if (ba.at(i) == '\n' || ba.at(i) == ' ') - ba.chop(1); - else - break; - } - return ba; -} - - -class tst_Plugin : public QObject -{ - Q_OBJECT - -public: - tst_Plugin() {} - - -public slots: - void runQtc(); - -public slots: - void readStandardOutput(); - void readStandardError(); - -private: - QProcess m_proc; // the Qt Creator process -}; - -void tst_Plugin::readStandardOutput() -{ - qDebug() << "qtcreator-out: " << stripped(m_proc.readAllStandardOutput()); -} - -void tst_Plugin::readStandardError() -{ - qDebug() << "qtcreator-err: " << stripped(m_proc.readAllStandardError()); -} - -void tst_Plugin::runQtc() -{ - QString test = QFileInfo(qApp->arguments().at(0)).absoluteFilePath(); - // FIXME: this is utterly broken... - QString qtc = QFileInfo(test).absolutePath() + "/../../../bin/qtcreator.bin"; - qtc = QFileInfo(qtc).absoluteFilePath(); - QStringList env = QProcess::systemEnvironment(); - env.append("QTC_DEBUGGER_TEST=" + test); - m_proc.setEnvironment(env); - connect(&m_proc, SIGNAL(readyReadStandardOutput()), - this, SLOT(readStandardOutput())); - connect(&m_proc, SIGNAL(readyReadStandardError()), - this, SLOT(readStandardError())); - m_proc.start(qtc); - m_proc.waitForStarted(); - QCOMPARE(m_proc.state(), QProcess::Running); - m_proc.waitForFinished(); - QCOMPARE(m_proc.state(), QProcess::NotRunning); -} - -void runDebuggee() -{ - qDebug() << "RUNNING DEBUGGEE"; -} - -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - QStringList args = app.arguments(); - - if (args.size() == 2 && args.at(1) == "--run-debuggee") { - runDebuggee(); - app.exec(); - return 0; - } - - tst_Plugin test; - return QTest::qExec(&test, argc, argv); -} - -#include "tst_plugin.moc" -