generic: fix some tests build after 1f34f5ad

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2016-05-03 01:13:15 +00:00
parent 3828e55f8a
commit 6ad8959836
13 changed files with 17 additions and 33 deletions

View file

@ -52,6 +52,8 @@ ADD_DEFINITIONS(
)
INCLUDE_DIRECTORIES(
# for the export header
${CMAKE_CURRENT_BINARY_DIR}/libkdcraw
${QDBUS_INCLUDE_DIRS}
${KDE4_KDECORE_INCLUDES}
${KDE4_KIO_INCLUDES}

View file

@ -267,7 +267,7 @@ void KDebugTest::testNoMainComponentData()
procenv.insert("KDE_DEBUG_NOPROCESSINFO", "1");
procenv.insert("KDE_DEBUG_TIMESTAMP", "0");
proc.setProcessEnvironment(procenv);
proc.setProcessChannelMode(QProcess::OnlyStderrChannel);
proc.setReadChannel(QProcess::StandardError);
QVERIFY(QFile::exists(KDEBINDIR "/kdecore-kdebug_qcoreapptest"));
QVERIFY(proc.execute(KDEBINDIR "/kdecore-kdebug_qcoreapptest"));
const QByteArray allOutput = proc.readAllStandardError();

View file

@ -156,7 +156,7 @@ void KMimeTypeTest::cleanupTestCase()
QFile::remove(m_kdeApp);
QFile::remove(m_nonKdeApp);
QProcess proc;
proc.setOutputChannelMode(QProcess::MergedChannels); // silence kbuildsycoca output
proc.setProcessChannelMode(QProcess::MergedChannels); // silence kbuildsycoca output
proc.execute(KStandardDirs::findExe(KBUILDSYCOCA_EXENAME));
}

View file

@ -129,7 +129,7 @@ void KServiceTest::cleanupTestCase()
QFile::remove(fakeService);
}
QProcess proc;
proc.setOutputChannelMode(QProcess::MergedChannels); // silence kbuildsycoca output
proc.setProcessChannelMode(QProcess::MergedChannels); // silence kbuildsycoca output
proc.execute(KStandardDirs::findExe(KBUILDSYCOCA_EXENAME));
}

View file

@ -33,6 +33,8 @@ include_directories(
${QDBUS_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
# for the export header
${CMAKE_CURRENT_BINARY_DIR}/libkexiv2
${KDE4_KDECORE_INCLUDES}
${KDE4_KDEUI_INCLUDES}
)

View file

@ -10,10 +10,6 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/config-kunitconversion.h
)
if(ENABLE_TESTING)
add_subdirectory(tests)
endif()
set(kunitconversion_LIB_SRCS
converter.cpp
value.cpp
@ -67,6 +63,8 @@ endif()
include_directories(
${CMAKE_SOURCE_DIR}
# for the export header
${CMAKE_CURRENT_BINARY_DIR}
${KDE4_KDECORE_INCLUDES}
${KDE4_KDEUI_INCLUDES}
)
@ -101,3 +99,7 @@ install(
DESTINATION ${INCLUDE_INSTALL_DIR}/kunitconversion
COMPONENT Devel
)
if(ENABLE_TESTING)
add_subdirectory(tests)
endif()

View file

@ -17,8 +17,7 @@ void AppendCharacterAndVerifyJob::run()
QMutexLocker locker ( &s_GlobalMutex );
stringRef()->append( c() );
if (m_expected.mid(0, stringRef()->length()) != *stringRef()) {
debug(3, "It broke!");
kDebug() << "It broke!";
}
debug( 3, "AppendCharacterJob::run: %c appended, result is %s.\n",
c().toLatin1(), qPrintable( *stringRef() ) );
kDebug() << c().toLatin1() << "appended, result is" << qPrintable( *stringRef() );
}

View file

@ -3,9 +3,9 @@
#include <QtCore/QObject>
#include <QtCore/QMutex>
#include <kdebug.h>
#include <Job.h>
#include <DebuggingAids.h>
// define in test binary:
@ -33,9 +33,7 @@ public:
{
QMutexLocker locker ( &s_GlobalMutex );
m_stringref->append( m_c );
using namespace ThreadWeaver;
debug( 3, "AppendCharacterJob::run: %c appended, result is %s.\n",
m_c.toLatin1(), qPrintable( *m_stringref ) );
kDebug() << m_c.toLatin1() << "appended, result is " << qPrintable( *m_stringref );
}
protected:

View file

@ -12,7 +12,6 @@
#include <QueuePolicy.h>
#include <JobSequence.h>
#include <JobCollection.h>
#include <DebuggingAids.h>
#include <WeaverObserver.h>
#include <DependencyPolicy.h>
#include <ResourceRestrictionPolicy.h>
@ -31,8 +30,6 @@ int main(int argc, char **argv)
DeleteTest::DeleteTest(int argc, char **argv)
: QCoreApplication(argc, argv)
{
ThreadWeaver::setDebugLevel ( true, 1 );
ThreadWeaver::Weaver::instance()->setMaximumNumberOfThreads(4);
m_finishCount = 100;

View file

@ -8,7 +8,6 @@
#include <JobSequence.h>
#include <ThreadWeaver.h>
#include <DebuggingAids.h>
#include <JobCollection.h>
#include <ResourceRestrictionPolicy.h>
@ -16,11 +15,6 @@
#include "AppendCharacterAndVerifyJob.h"
QMutex s_GlobalMutex;
void JobTests::initTestCase ()
{
ThreadWeaver::setDebugLevel ( true, 1 );
}
// call finish() before leave a test to make sure the queue is empty
void JobTests::WeaverLazyThreadCreationTest()

View file

@ -15,8 +15,6 @@ class JobTests : public QObject
private Q_SLOTS:
void initTestCase ();
// call finish() before leave a test to make sure the queue is empty
void WeaverLazyThreadCreationTest();

View file

@ -14,7 +14,6 @@
#include <QueuePolicy.h>
#include <JobSequence.h>
#include <JobCollection.h>
#include <DebuggingAids.h>
#include <WeaverObserver.h>
#include <DependencyPolicy.h>
#include <ResourceRestrictionPolicy.h>
@ -69,11 +68,6 @@ QueueTests::QueueTests( QObject* parent )
{
}
void QueueTests::initTestCase ()
{
ThreadWeaver::setDebugLevel ( true, 1 );
}
void QueueTests::SimpleQueuePrioritiesTest() {
ThreadWeaver::Weaver weaver;
weaver.setMaximumNumberOfThreads ( 1 ); // just one thread

View file

@ -69,8 +69,6 @@ private:
private Q_SLOTS:
void initTestCase ();
void SimpleQueuePrioritiesTest();
void WeaverInitializationTest();
void QueueFromSecondThreadTest();