mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-19 18:26:34 +01:00
Port benchmarks to cmake
This commit is contained in:
parent
98e8a9355d
commit
b4a1b4acdb
@ -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)
|
||||
|
18
tests/benchmarks/CMakeLists.txt
Normal file
18
tests/benchmarks/CMakeLists.txt
Normal 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
|
||||
)
|
1
tests/benchmarks/adblockmatchrule/.gitignore
vendored
1
tests/benchmarks/adblockmatchrule/.gitignore
vendored
@ -1 +0,0 @@
|
||||
adblockmatchrule
|
@ -1,4 +0,0 @@
|
||||
include(../benchmarks.pri)
|
||||
|
||||
TARGET = adblockmatchrule
|
||||
SOURCES = adblockmatchrule.cpp
|
@ -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());
|
||||
}
|
||||
}
|
1
tests/benchmarks/adblockparserule/.gitignore
vendored
1
tests/benchmarks/adblockparserule/.gitignore
vendored
@ -1 +0,0 @@
|
||||
adblockparserule
|
@ -1,4 +0,0 @@
|
||||
include(../benchmarks.pri)
|
||||
|
||||
TARGET = adblockparserule
|
||||
SOURCES = adblockparserule.cpp
|
@ -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 \
|
@ -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)
|
5
tests/benchmarks/benchmarks.qrc
Normal file
5
tests/benchmarks/benchmarks.qrc
Normal file
@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>files/easylist.txt</file>
|
||||
</qresource>
|
||||
</RCC>
|
Loading…
Reference in New Issue
Block a user