diff options
Diffstat (limited to 'plugins')
8 files changed, 112 insertions, 2 deletions
diff --git a/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.cpp b/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.cpp index 21b086858e..4eed420574 100644 --- a/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.cpp +++ b/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.cpp @@ -94,10 +94,16 @@ void ClangStaticAnalyzerUnitTests::testProject_data() { QTest::addColumn<QString>("projectFilePath"); QTest::addColumn<int>("expectedDiagCount"); - QTest::newRow("qbs project") + + QTest::newRow("simple qbs project") << QString(m_tmpDir->path() + QLatin1String("/simple/simple.qbs")) << 1; - QTest::newRow("qmake project") + QTest::newRow("simple qmake project") << QString(m_tmpDir->path() + QLatin1String("/simple/simple.pro")) << 1; + + QTest::newRow("qt-widgets-app qbs project") + << QString(m_tmpDir->path() + QLatin1String("/qt-widgets-app/qt-widgets-app.qbs")) << 0; + QTest::newRow("qt-widgets-app qmake project") + << QString(m_tmpDir->path() + QLatin1String("/qt-widgets-app/qt-widgets-app.pro")) << 0; } } // namespace Internal diff --git a/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.qrc b/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.qrc index 0de4936d20..d8a1a8674e 100644 --- a/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.qrc +++ b/plugins/clangstaticanalyzer/clangstaticanalyzerunittests.qrc @@ -3,5 +3,11 @@ <file>unit-tests/simple/main.cpp</file> <file>unit-tests/simple/simple.qbs</file> <file>unit-tests/simple/simple.pro</file> + <file>unit-tests/qt-widgets-app/main.cpp</file> + <file>unit-tests/qt-widgets-app/mainwindow.cpp</file> + <file>unit-tests/qt-widgets-app/mainwindow.h</file> + <file>unit-tests/qt-widgets-app/mainwindow.ui</file> + <file>unit-tests/qt-widgets-app/qt-widgets-app.pro</file> + <file>unit-tests/qt-widgets-app/qt-widgets-app.qbs</file> </qresource> </RCC> diff --git a/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/main.cpp b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/main.cpp new file mode 100644 index 0000000000..b48f94ec82 --- /dev/null +++ b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + + return a.exec(); +} diff --git a/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.cpp b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.cpp new file mode 100644 index 0000000000..49d64fce7c --- /dev/null +++ b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.cpp @@ -0,0 +1,14 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} diff --git a/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.h b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.h new file mode 100644 index 0000000000..ce76956bad --- /dev/null +++ b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.h @@ -0,0 +1,24 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include <QMainWindow> + +QT_BEGIN_NAMESPACE +namespace Ui { +class MainWindow; +} +QT_END_NAMESPACE + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.ui b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.ui new file mode 100644 index 0000000000..6050363fa7 --- /dev/null +++ b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/mainwindow.ui @@ -0,0 +1,24 @@ +<ui version="4.0"> + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle" > + <string>MainWindow</string> + </property> + <widget class="QMenuBar" name="menuBar" /> + <widget class="QToolBar" name="mainToolBar" /> + <widget class="QWidget" name="centralWidget" /> + <widget class="QStatusBar" name="statusBar" /> + </widget> + <layoutDefault spacing="6" margin="11" /> + <pixmapfunction></pixmapfunction> + <resources/> + <connections/> +</ui> diff --git a/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/qt-widgets-app.pro b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/qt-widgets-app.pro new file mode 100644 index 0000000000..d9e1f2590b --- /dev/null +++ b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/qt-widgets-app.pro @@ -0,0 +1,8 @@ +QT += core gui +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = qt-widgets-app +TEMPLATE = app +SOURCES += main.cpp mainwindow.cpp +HEADERS += mainwindow.h +FORMS += mainwindow.ui diff --git a/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/qt-widgets-app.qbs b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/qt-widgets-app.qbs new file mode 100644 index 0000000000..e641f9bd54 --- /dev/null +++ b/plugins/clangstaticanalyzer/unit-tests/qt-widgets-app/qt-widgets-app.qbs @@ -0,0 +1,17 @@ +import qbs 1.0 + +QtApplication { + name : "Qt Widgets Application" + + Depends { + name: "Qt" + submodules: [ "widgets" ] + } + + files : [ + "main.cpp", + "mainwindow.cpp", + "mainwindow.h", + "mainwindow.ui" + ] +} |