aboutsummaryrefslogtreecommitdiff
path: root/src/webengine
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-12-07 12:22:15 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2020-12-07 12:22:15 +0200
commit92b3c2dcff3e85ad3d455f6ab845d9a97d3b525b (patch)
treea850643f7b86e6cebfddbeec98d7c372478d379c /src/webengine
parentHostlist filter plugin can rewrite hostnames (diff)
downloadsmolbote-92b3c2dcff3e85ad3d455f6ab845d9a97d3b525b.tar.xz
Rewrite meson build scripts into cmakelists
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/CMakeLists.txt22
-rw-r--r--src/webengine/meson.build27
-rw-r--r--src/webengine/test/profilemanager.cpp8
3 files changed, 26 insertions, 31 deletions
diff --git a/src/webengine/CMakeLists.txt b/src/webengine/CMakeLists.txt
new file mode 100644
index 0000000..5d2769d
--- /dev/null
+++ b/src/webengine/CMakeLists.txt
@@ -0,0 +1,22 @@
+add_library(webengine INTERFACE)
+target_sources(webengine INTERFACE
+ webprofile.h webprofile.cpp webprofilemanager.h webprofilemanager.cpp
+ webpage.h webpage.cpp
+ webview.h webview.cpp webviewcontextmenu.h webviewcontextmenu.cpp
+ urlinterceptor.h urlinterceptor.cpp)
+target_include_directories(webengine INTERFACE ${CMAKE_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR})
+target_link_libraries(webengine INTERFACE Qt5::WebEngineWidgets fmt)
+
+# tests
+add_executable(profile_test test/profile.cpp)
+target_link_libraries(profile_test PRIVATE webengine Catch2::Catch2)
+#target_sanitize(profile_test)
+
+add_executable(profilemanager_test test/profilemanager.cpp)
+target_link_libraries(profilemanager_test PRIVATE webengine Catch2::Catch2)
+#target_sanitize(profilemanager_test)
+
+add_test(NAME webengine_profile COMMAND profile_test)
+add_test(NAME webengine_profilemanager COMMAND profilemanager_test)
+set_tests_properties(webengine_profile webengine_profilemanager PROPERTIES
+ ENVIRONMENT "PROFILE=${CMAKE_CURRENT_SOURCE_DIR}/test/testing.profile") \ No newline at end of file
diff --git a/src/webengine/meson.build b/src/webengine/meson.build
deleted file mode 100644
index da59006..0000000
--- a/src/webengine/meson.build
+++ /dev/null
@@ -1,27 +0,0 @@
-webengine_moc = mod_qt5.preprocess(
- moc_headers: [ 'webprofile.h', 'webpage.h', 'webview.h' ],
- dependencies: dep_qt5
-)
-
-dep_webengine = declare_dependency(
- include_directories: [ '.', smolbote_include ],
- link_with: static_library('webengine', dependencies: [ dep_qt5, dep_spdlog ],
- include_directories: smolbote_include,
- sources: [ 'webprofile.cpp', 'urlinterceptor.cpp', 'webprofilemanager.cpp', 'webpage.cpp', 'webview.cpp', 'webviewcontextmenu.cpp', webengine_moc ])
-)
-
-poi_sourceset.add(dep_webengine)
-
-test('profile', executable('profile', 'test/profile.cpp', dependencies: [ dep_qt5, dep_webengine, dep_catch ]),
- env: { 'PROFILE' : meson.current_source_dir()/'test/testing.profile' },
- suite: 'webengine')
-
-test('profilemanager', executable('profilemanager', 'test/profilemanager.cpp', dependencies: [ dep_qt5, dep_webengine, dep_catch ]),
- env: { 'PROFILES' : meson.current_source_dir()/'test/testing.profile' },
- suite: 'webengine')
-
-test('view', executable('view', 'test/view.cpp', dependencies: [ dep_qt5, dep_webengine, dep_catch ]),
- #args: [ '-platform', 'offscreen' ],
- env: { 'PROFILE' : meson.current_source_dir()/'test/testing.profile',
- 'URL' : meson.current_source_dir()/'test/sample.html' },
- suite: 'webengine')
diff --git a/src/webengine/test/profilemanager.cpp b/src/webengine/test/profilemanager.cpp
index dc7c903..8f6a34f 100644
--- a/src/webengine/test/profilemanager.cpp
+++ b/src/webengine/test/profilemanager.cpp
@@ -60,9 +60,9 @@ SCENARIO("WebProfileManager")
GIVEN("a number of profiles, default undefined")
{
- REQUIRE(qEnvironmentVariableIsSet("PROFILES"));
+ REQUIRE(qEnvironmentVariableIsSet("PROFILE"));
- WebProfileManager<false> profiles(QString::fromLatin1(qgetenv("PROFILES")).split(';'), default_id, search, homepage, newtab);
+ WebProfileManager<false> profiles(QString::fromLatin1(qgetenv("PROFILE")).split(';'), default_id, search, homepage, newtab);
REQUIRE(profiles.idList().count() == 2);
REQUIRE(profiles.profile(default_id) == WebProfile::defaultProfile());
@@ -94,9 +94,9 @@ SCENARIO("WebProfileManager")
GIVEN("a number of profiles, default defined")
{
- REQUIRE(qEnvironmentVariableIsSet("PROFILES"));
+ REQUIRE(qEnvironmentVariableIsSet("PROFILE"));
- WebProfileManager<false> profiles(QString::fromLatin1(qgetenv("PROFILES")).split(';'), "testing", search, homepage, newtab);
+ WebProfileManager<false> profiles(QString::fromLatin1(qgetenv("PROFILE")).split(';'), "testing", search, homepage, newtab);
REQUIRE(profiles.idList().count() == 1);
REQUIRE(profiles.profile("testing") == WebProfile::defaultProfile());