diff --git a/src/plugins/valgrind/valgrind_test.pri b/src/plugins/valgrind/valgrind_test.pri
new file mode 100644
index 0000000000000000000000000000000000000000..221d54e2c08b825578fd78de547d697735a50aa8
--- /dev/null
+++ b/src/plugins/valgrind/valgrind_test.pri
@@ -0,0 +1,61 @@
+QT *= network
+
+INCLUDEPATH *= $$PWD
+
+HEADERS += \
+    $$PWD/xmlprotocol/frame.h \
+    $$PWD/xmlprotocol/parser.h \
+    $$PWD/xmlprotocol/error.h \
+    $$PWD/xmlprotocol/status.h \
+    $$PWD/xmlprotocol/suppression.h \
+    $$PWD/xmlprotocol/threadedparser.h \
+    $$PWD/xmlprotocol/announcethread.h \
+    $$PWD/xmlprotocol/stack.h \
+    $$PWD/xmlprotocol/errorlistmodel.h \
+    $$PWD/xmlprotocol/stackmodel.h \
+    $$PWD/xmlprotocol/modelhelpers.h \
+    $$PWD/callgrind/callgrindparser.h \
+    $$PWD/callgrind/callgrindparsedata.h \
+    $$PWD/callgrind/callgrindfunction.h \
+    $$PWD/callgrind/callgrindfunction_p.h \
+    $$PWD/callgrind/callgrindfunctioncycle.h \
+    $$PWD/callgrind/callgrindfunctioncall.h \
+    $$PWD/callgrind/callgrindcostitem.h \
+    $$PWD/callgrind/callgrinddatamodel.h \
+    $$PWD/callgrind/callgrindcallmodel.h \
+    $$PWD/callgrind/callgrindcontroller.h \
+    $$PWD/callgrind/callgrindcycledetection.h \
+    $$PWD/callgrind/callgrindproxymodel.h \
+    $$PWD/callgrind/callgrindstackbrowser.h \
+    $$PWD/callgrind/callgrindrunner.h \
+    $$PWD/memcheck/memcheckrunner.h \
+    $$PWD/valgrindrunner.h \
+    $$PWD/valgrindprocess.h
+
+SOURCES += $$PWD/xmlprotocol/error.cpp \
+    $$PWD/xmlprotocol/frame.cpp \
+    $$PWD/xmlprotocol/parser.cpp \
+    $$PWD/xmlprotocol/status.cpp \
+    $$PWD/xmlprotocol/suppression.cpp \
+    $$PWD/xmlprotocol/threadedparser.cpp \
+    $$PWD/xmlprotocol/announcethread.cpp \
+    $$PWD/xmlprotocol/stack.cpp \
+    $$PWD/xmlprotocol/errorlistmodel.cpp \
+    $$PWD/xmlprotocol/stackmodel.cpp \
+    $$PWD/xmlprotocol/modelhelpers.cpp \
+    $$PWD/callgrind/callgrindparser.cpp \
+    $$PWD/callgrind/callgrindparsedata.cpp \
+    $$PWD/callgrind/callgrindfunction.cpp \
+    $$PWD/callgrind/callgrindfunctioncycle.cpp \
+    $$PWD/callgrind/callgrindfunctioncall.cpp \
+    $$PWD/callgrind/callgrindcostitem.cpp \
+    $$PWD/callgrind/callgrinddatamodel.cpp \
+    $$PWD/callgrind/callgrindcallmodel.cpp \
+    $$PWD/callgrind/callgrindcontroller.cpp \
+    $$PWD/callgrind/callgrindcycledetection.cpp \
+    $$PWD/callgrind/callgrindproxymodel.cpp \
+    $$PWD/callgrind/callgrindrunner.cpp \
+    $$PWD/callgrind/callgrindstackbrowser.cpp \
+    $$PWD/memcheck/memcheckrunner.cpp \
+    $$PWD/valgrindrunner.cpp \
+    $$PWD/valgrindprocess.cpp
diff --git a/tests/valgrind/callgrind/callgrind.pro b/tests/valgrind/callgrind/callgrind.pro
index f40c53ccbf45d59531d95c48c227b88b730345b2..c48d1f43a5953bd6bec9b6959767307b9e28b0f8 100644
--- a/tests/valgrind/callgrind/callgrind.pro
+++ b/tests/valgrind/callgrind/callgrind.pro
@@ -1,3 +1,4 @@
 TEMPLATE = subdirs
 
-SUBDIRS += callgrindparsertests.pro modeltest.pro
+SUBDIRS += callgrindparsertests.pro
+# modeltest.pro not compiling due to missing widget handler.
diff --git a/tests/valgrind/callgrind/callgrindparsertests.pro b/tests/valgrind/callgrind/callgrindparsertests.pro
index 6ecbcc633c1ac602f4beb52499e2f09d6b1b323e..39b25046c4e1d5ccfcf6394417ad38e1d1456d6f 100644
--- a/tests/valgrind/callgrind/callgrindparsertests.pro
+++ b/tests/valgrind/callgrind/callgrindparsertests.pro
@@ -1,5 +1,5 @@
 include(../../auto/qttest.pri)
-include(../../../src/libs/valgrind/valgrind.pri)
+include($$IDE_SOURCE_TREE/src/plugins/valgrind/valgrind_test.pri)
 include($$IDE_SOURCE_TREE/src/libs/utils/utils.pri)
 TARGET = callgrindparsertests
 
diff --git a/tests/valgrind/callgrind/modeltest.cpp b/tests/valgrind/callgrind/modeltest.cpp
index 77cf91df7e470f711d876d135a99c49144cbb62a..65c483f3229b7544615be7d0092e784e54fcef4c 100644
--- a/tests/valgrind/callgrind/modeltest.cpp
+++ b/tests/valgrind/callgrind/modeltest.cpp
@@ -51,10 +51,9 @@
 #include <QtGui/QDockWidget>
 #include <QtGui/QToolButton>
 
-#include <callgrind/callgrindcostview.h>
-#include <callgrind/callgrindcostdelegate.h>
-#include <callgrind/callgrindvisualisation.h>
-#include <callgrind/callgrindwidgethandler.h>
+#include <callgrindcostview.h>
+#include <callgrindcostdelegate.h>
+#include <callgrindvisualisation.h>
 
 #include <valgrind/callgrind/callgrindparsedata.h>
 #include <valgrind/callgrind/callgrindparser.h>
diff --git a/tests/valgrind/callgrind/modeltest.pro b/tests/valgrind/callgrind/modeltest.pro
index 0038639ec0de9e079ecfbe70b5b4b1633ad78d51..ef70530633aaee21cfc75c402ae9d614d202c854 100644
--- a/tests/valgrind/callgrind/modeltest.pro
+++ b/tests/valgrind/callgrind/modeltest.pro
@@ -1,6 +1,6 @@
 include(../../../qtcreator.pri)
 include(../../auto/qttestrpath.pri)
-include($$IDE_SOURCE_TREE/src/plugins/callgrind/callgrind.pri)
+include($$IDE_SOURCE_TREE/src/plugins/valgrind/valgrind_test.pri)
 include($$IDE_SOURCE_TREE/src/libs/languageutils/languageutils.pri)
 
 TEMPLATE = app
@@ -13,21 +13,21 @@ SRCDIR = $$IDE_SOURCE_TREE/src
 
 SOURCES += \
     modeltest.cpp \
-    $$SRCDIR/plugins/callgrind/callgrindcostdelegate.cpp \
-    $$SRCDIR/plugins/callgrind/callgrindhelper.cpp \
-    $$SRCDIR/plugins/callgrind/callgrindcostview.cpp \
-    $$SRCDIR/plugins/callgrind/callgrindnamedelegate.cpp \
-    $$SRCDIR/plugins/callgrind/callgrindwidgethandler.cpp \
-    $$SRCDIR/plugins/callgrind/callgrindvisualisation.cpp \
+    $$SRCDIR/plugins/valgrind/callgrindcostdelegate.cpp \
+    $$SRCDIR/plugins/valgrind/callgrindhelper.cpp \
+    $$SRCDIR/plugins/valgrind/callgrindcostview.cpp \
+    $$SRCDIR/plugins/valgrind/callgrindnamedelegate.cpp \
+    $$SRCDIR/plugins/valgrind/callgrindwidgethandler.cpp \
+    $$SRCDIR/plugins/valgrind/callgrindvisualisation.cpp \
 
 HEADERS += \
     modeltest.h \
-    $$SRCDIR/plugins/callgrind/callgrindcostdelegate.h \
-    $$SRCDIR/plugins/callgrind/callgrindcostview.h \
-    $$SRCDIR/plugins/callgrind/callgrindhelper.h \
-    $$SRCDIR/plugins/callgrind/callgrindnamedelegate.h \
-    $$SRCDIR/plugins/callgrind/callgrindwidgethandler.h \
-    $$SRCDIR/plugins/callgrind/callgrindvisualisation.h \
+    $$SRCDIR/plugins/valgrind/callgrindcostdelegate.h \
+    $$SRCDIR/plugins/valgrind/callgrindcostview.h \
+    $$SRCDIR/plugins/valgrind/callgrindhelper.h \
+    $$SRCDIR/plugins/valgrind/callgrindnamedelegate.h \
+    $$SRCDIR/plugins/valgrind/callgrindwidgethandler.h \
+    $$SRCDIR/plugins/valgrind/callgrindvisualisation.h \
 
 LIBS += -L$$IDE_PLUGIN_PATH/Nokia
 
diff --git a/tests/valgrind/memcheck/modeldemo.pro b/tests/valgrind/memcheck/modeldemo.pro
index 1034124234fefe13fdbd74aecbd598f512d7de13..e002f36542d138390969893649d1d21f6ea46634 100644
--- a/tests/valgrind/memcheck/modeldemo.pro
+++ b/tests/valgrind/memcheck/modeldemo.pro
@@ -2,7 +2,8 @@ include(../../../qtcreator.pri)
 include(../../auto/qttestrpath.pri)
 include($$IDE_SOURCE_TREE/src/libs/3rdparty/botan/botan.pri)
 include($$IDE_SOURCE_TREE/src/libs/utils/utils.pri)
-include($$IDE_SOURCE_TREE/src/libs/valgrind/valgrind.pri)
+include($$IDE_SOURCE_TREE/src/plugins/valgrind/valgrind_test.pri)
+
 TEMPLATE = app
 TARGET = modeldemo
 
diff --git a/tests/valgrind/memcheck/parsertests.pro b/tests/valgrind/memcheck/parsertests.pro
index 6338951f487e898a4762e62a16d7c9ee37ee6cac..3170210d3817c07e986dbc1c1358255c285eb54b 100644
--- a/tests/valgrind/memcheck/parsertests.pro
+++ b/tests/valgrind/memcheck/parsertests.pro
@@ -1,7 +1,7 @@
 include(../../auto/qttest.pri)
 include($$IDE_SOURCE_TREE/src/libs/3rdparty/botan/botan.pri)
 include($$IDE_SOURCE_TREE/src/libs/utils/utils.pri)
-include($$IDE_SOURCE_TREE/src/libs/valgrind/valgrind.pri)
+include($$IDE_SOURCE_TREE/src/plugins/valgrind/valgrind_test.pri)
 
 TARGET = parsertests
 
diff --git a/tests/valgrind/memcheck/testrunner.pro b/tests/valgrind/memcheck/testrunner.pro
index f83c43941251c0c7f88d5bfb6ceac8a21c0e3ef0..53035bbac7aaccd1f3df3050cc0045cb33b19bed 100644
--- a/tests/valgrind/memcheck/testrunner.pro
+++ b/tests/valgrind/memcheck/testrunner.pro
@@ -1,7 +1,7 @@
 include(../../auto/qttest.pri)
 include($$IDE_SOURCE_TREE/src/libs/utils/utils.pri)
 include($$IDE_SOURCE_TREE/src/libs/3rdparty/botan/botan.pri)
-include($$IDE_SOURCE_TREE/src/libs/valgrind/valgrind.pri)
+include($$IDE_SOURCE_TREE/src/plugins/valgrind/valgrind_test.pri)
 
 TARGET = testrunner