1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00

Port benchmarks to cmake

This commit is contained in:
David Rosca 2018-01-24 16:56:46 +01:00
parent 98e8a9355d
commit b4a1b4acdb
11 changed files with 26 additions and 72 deletions

View File

@ -144,6 +144,7 @@ add_subdirectory(src)
if (BUILD_TESTING)
add_subdirectory(autotests)
add_subdirectory(tests/benchmarks)
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

View File

@ -0,0 +1,18 @@
set(falkon_benchmarks_SRCS )
qt5_add_resources(falkon_benchmarks_SRCS benchmarks.qrc)
macro(falkon_benchmarks)
foreach(_benchmarkname ${ARGN})
add_executable(${_benchmarkname} ${_benchmarkname}.cpp ${falkon_benchmarks_SRCS})
target_link_libraries(${_benchmarkname} Qt5::Test FalkonPrivate)
#add_test(NAME falkon-${_benchmarkname} COMMAND ${_benchmarkname})
#ecm_mark_as_test(${_benchmarkname})
#set_tests_properties(falkon-${_benchmarkname} PROPERTIES RUN_SERIAL TRUE)
endforeach(_benchmarkname)
endmacro()
falkon_benchmarks(
#adblockmatchrule
adblockparserule
)

View File

@ -1 +0,0 @@
adblockmatchrule

View File

@ -1,4 +0,0 @@
include(../benchmarks.pri)
TARGET = adblockmatchrule
SOURCES = adblockmatchrule.cpp

View File

@ -29,11 +29,12 @@ private slots:
};
#include "qztools.h"
void AdBlockParseRule::parseEasyList()
{
QBENCHMARK {
AdBlockSubscription* subscription = new AdBlockSubscription("EasyList", this);
subscription->setFilePath("../files/easylist.txt");
subscription->setFilePath(":/files/easylist.txt");
subscription->loadSubscription(QStringList());
}
}

View File

@ -1 +0,0 @@
adblockparserule

View File

@ -1,4 +0,0 @@
include(../benchmarks.pri)
TARGET = adblockparserule
SOURCES = adblockparserule.cpp

View File

@ -1,43 +0,0 @@
include($$PWD/../../src/defines.pri)
isEqual(QT_MAJOR_VERSION, 5) {
QT += webkitwidgets network widgets printsupport sql script gui-private testlib
} else {
QT += core gui webkit sql network script
CONFIG += qtestlib
}
!unix|mac: LIBS += -L$$PWD/../../bin -lFalkon
!mac:unix: LIBS += $$PWD/../../bin/libFalkon.so
QMAKE_LFLAGS+=$${QMAKE_LFLAGS_RPATH}$$PWD/../../bin
DESTDIR =
OBJECTS_DIR = build
MOC_DIR = build
RCC_DIR = build
UI_DIR = build
INCLUDEPATH += $$PWD/../../src/lib/3rdparty \
$$PWD/../../src/lib/adblock \
$$PWD/../../src/lib/app \
$$PWD/../../src/lib/autofill \
$$PWD/../../src/lib/bookmarks \
$$PWD/../../src/lib/cookies \
$$PWD/../../src/lib/downloads \
$$PWD/../../src/lib/history \
$$PWD/../../src/lib/navigation \
$$PWD/../../src/lib/network \
$$PWD/../../src/lib/notifications \
$$PWD/../../src/lib/opensearch \
$$PWD/../../src/lib/other \
$$PWD/../../src/lib/plugins \
$$PWD/../../src/lib/popupwindow \
$$PWD/../../src/lib/preferences \
$$PWD/../../src/lib/rss \
$$PWD/../../src/lib/session \
$$PWD/../../src/lib/sidebar \
$$PWD/../../src/lib/tabwidget \
$$PWD/../../src/lib/tools \
$$PWD/../../src/lib/webkit \
$$PWD/../../src/lib/webtab \

View File

@ -1,18 +0,0 @@
TEMPLATE = subdirs
defineTest(addSubdir) {
for(subdir, 1) {
entries = $$files($$subdir/*)
for(entry, entries) {
fullPath = $$replace(entry, ;,"")
fullPath = $$replace(fullPath, \\\\, /)
name = $$replace(fullPath, $$re_escape("$$subdir/"), "")
os2|win32: fullPath = $$lower($$fullPath)
exists($$fullPath/*.pro): SUBDIRS += $$fullPath
}
}
export (SUBDIRS)
}
addSubdir($$PWD)

View File

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>files/easylist.txt</file>
</qresource>
</RCC>