Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
required: false
type: string
default: ''
cmake-args:
description: Specify additional CMake arguments
required: false
type: string
default: ''
jobs:
build:
name: Build
Expand All @@ -38,7 +43,7 @@ jobs:
if: ${{ inputs.cmake-preset != '' }}
run: echo "cmake-preset=--preset ${{ inputs.cmake-preset }}" >> $GITHUB_ENV
- name: Configure
run: cmake ${{ env.cmake-preset }} -S . -B build
run: cmake ${{ env.cmake-preset }} ${{ inputs.cmake-args }} -S . -B build
- name: Build
run: cmake --build build
- name: Tar artifact (keep permissions)
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@ jobs:
clang-format:
uses: ./.github/workflows/clang-format.yml

coverage-build:
clang-build:
uses: ./.github/workflows/build.yml
with:
image: registry.gitlab.com/kwinft/ci-images/archlinux/kwinft-base-master
artifact-name: coverage-build
cmake-preset: gcc-cov
artifact-name: clang-build
cmake-preset: clang

builds:
strategy:
matrix:
preset: [clang, release]
preset: [gcc-cov, release]
uses: ./.github/workflows/build.yml
with:
image: registry.gitlab.com/kwinft/ci-images/archlinux/kwinft-base-master
artifact-name: '${{ matrix.preset }}-build'
artifact-name: ${{ matrix.preset }}-build
cmake-preset: ${{ matrix.preset }}
cmake-args: -DBUILD_TESTING=ON

install:
uses: ./.github/workflows/install.yml
Expand All @@ -44,13 +45,18 @@ jobs:
image: registry.gitlab.com/kwinft/ci-images/archlinux/kwinft-base-master
artifact-name: release-build

test:
tests:
strategy:
fail-fast: false
matrix:
preset: [gcc-cov, release]
uses: ./.github/workflows/test.yml
needs: coverage-build
needs: builds
secrets: inherit
with:
image: registry.gitlab.com/kwinft/ci-images/archlinux/kwinft-base-master
artifact-name: coverage-build
artifact-prefix: ${{ matrix.preset }}
coverage: ${{ matrix.preset == 'gcc-cov' }}
# Following tests are currently disabled on CI:
# * lockscreen, modifier-only-shortcut: flaky on CI because the lockscreen greeter process likes to
# freeze off. Also see: https://bugreports.qt.io/browse/QTBUG-82911
Expand All @@ -64,7 +70,7 @@ jobs:

clang-tidy:
uses: ./.github/workflows/clang-tidy.yml
needs: builds
needs: clang-build
with:
image: registry.gitlab.com/kwinft/ci-images/archlinux/kwinft-base-master
artifact-name: clang-build
Expand All @@ -74,5 +80,5 @@ jobs:
needs: builds
with:
image: registry.gitlab.com/kwinft/ci-images/archlinux/kwinft-base-master
artifact-name: clang-build
artifact-name: release-build
package-name: como
10 changes: 6 additions & 4 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
description: Artifact name of build dir
required: true
type: string
threads:
description: Parallel execution count
required: false
type: number
default: 0

jobs:
clang-tidy:
Expand All @@ -33,8 +38,5 @@ jobs:
- name: Untar artifact
run: tar -xzf build-dir.tar
- name: Run Clang-Tidy
# TODO(romangg): For now we skip the actual clang-tidy operation on CI because
# the process consumes too much resources and the runner terminates.
if: false
run: tooling/analysis/clang-tidy.py -p build
run: tooling/analysis/clang-tidy.py -p build -j ${{ inputs.threads }}
shell: bash
14 changes: 10 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ on:
description: Image to run tests on
required: true
type: string
artifact-name:
description: Artifact name of build dir
artifact-prefix:
description: Artifact prefix of build dir
required: true
type: string
ctest-args:
description: Specify additional CTest arguments
required: false
type: string
default: ''
coverage:
description: Option to create coverage
required: false
type: boolean
default: false

jobs:
test:
Expand All @@ -34,7 +39,7 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}
name: ${{ inputs.artifact-prefix }}-build
- name: Untar artifact
run: tar -xzf build-dir.tar
- name: List all tests
Expand All @@ -55,10 +60,11 @@ jobs:
--output-on-failure --no-compress-output ${{ inputs.ctest-args }}"
shell: bash
- name: Generate a code coverage report
if: ${{ inputs.coverage }}
uses: ./.github/actions/coverage
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
if: github.repository == 'winft/como' || github.event_name == 'pull_request'
if: ${{ inputs.coverage && (github.repository == 'winft/como' || github.event_name == 'pull_request') }}
with:
file: coverage.xml
fail_ci_if_error: true
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ ecm_find_qmlmodule(org.kde.kquickcontrolsaddons 2.0)
ecm_find_qmlmodule(org.kde.plasma.core 2.0)
ecm_find_qmlmodule(org.kde.plasma.components 2.0)

option(BUILD_EXAMPLES "Enable building examples." ON)
option(COMO_BUILD_DECORATIONS "Enable building of decorations." ON)
option(COMO_BUILD_KCMS "Enable building of configuration modules." ON)
option(COMO_BUILD_TABBOX "Enable building of Tabbox functionality" ON)
Expand Down Expand Up @@ -342,7 +343,9 @@ if (BUILD_TESTING)
add_subdirectory(tests)
endif()

add_subdirectory(examples)
if (BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

if (KF6DocTools_FOUND)
add_subdirectory(docs)
Expand Down
14 changes: 4 additions & 10 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@
"CMAKE_MODULE_LINKER_FLAGS": "$env{DEBUG_MODULE_LINKER_FLAGS}"
}
},
{
"name": "clang-cov",
"inherits": "clang",
"displayName": "Clang Tests Coverage",
"description": "Clang Build with tests and coverage reporting enabled",
"cacheVariables": {
"CMAKE_CXX_FLAGS": "$env{DEBUG_CXX_FLAGS_CLANG} --coverage",
"CMAKE_EXE_LINKER_FLAGS": "--coverage"
}
},
{
"name": "gcc-cov",
"inherits": "gcc",
Expand All @@ -106,6 +96,10 @@
"BUILD_TESTING": {
"type": "BOOL",
"value": "OFF"
},
"BUILD_EXAMPLES": {
"type": "BOOL",
"value": "OFF"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion como/input/x11/xinput_integration.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace como::input::x11

static inline qreal fixed1616ToReal(FP1616 val)
{
return (val)*1.0 / (1 << 16);
return (val) * 1.0 / (1 << 16);
}

template<typename Xinput>
Expand Down
6 changes: 3 additions & 3 deletions como/win/wayland/xdg_activation.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ inline bool generate_token(char out[token_strlen])
template<typename Space>
struct xdg_activation {
xdg_activation(Space& space)
: interface {
std::make_unique<Wrapland::Server::XdgActivationV1>(space.base.server->display.get())
}, space{space}
: interface{std::make_unique<Wrapland::Server::XdgActivationV1>(
space.base.server->display.get())}
, space{space}
{
QObject::connect(
interface.get(),
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ add_executable(tests
)

target_compile_definitions(tests PRIVATE USE_XWL=1)
set_target_properties(tests PROPERTIES UNITY_BUILD ON)

target_link_libraries(tests
PRIVATE
Expand Down Expand Up @@ -188,6 +189,7 @@ add_executable(tests-wl
)

target_compile_definitions(tests-wl PRIVATE USE_XWL=0)
set_target_properties(tests-wl PROPERTIES UNITY_BUILD ON)

target_link_libraries(tests-wl
PRIVATE
Expand Down
23 changes: 8 additions & 15 deletions tests/integration/activation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ TEST_CASE("activation", "[win]")
SECTION("switch to left window")
{
// Verifies that "Switch to Window to the Left" shortcut works.
using namespace Wrapland::Client;

// Prepare the test environment.
stackScreensHorizontally();
Expand Down Expand Up @@ -107,8 +106,6 @@ TEST_CASE("activation", "[win]")
{
// Verifies that "Switch to Window to the Right" shortcut works.

using namespace Wrapland::Client;

// Prepare the test environment.
stackScreensHorizontally();

Expand Down Expand Up @@ -175,8 +172,6 @@ TEST_CASE("activation", "[win]")
{
// Verifies that "Switch to Window Above" shortcut works.

using namespace Wrapland::Client;

// Prepare the test environment.
stackScreensVertically();

Expand Down Expand Up @@ -243,8 +238,6 @@ TEST_CASE("activation", "[win]")
{
// Verifies that "Switch to Window Bottom" shortcut works.

using namespace Wrapland::Client;

// Prepare the test environment.
stackScreensVertically();

Expand Down Expand Up @@ -312,8 +305,6 @@ TEST_CASE("activation", "[win]")
// Verifies that we switch to the top-most maximized client, i.e.
// the one that user sees at the moment. See bug 411356.

using namespace Wrapland::Client;

// Prepare the test environment.
stackScreensHorizontally();

Expand All @@ -324,7 +315,8 @@ TEST_CASE("activation", "[win]")
REQUIRE(client1);
REQUIRE(client1->control->active);

QSignalSpy configureRequestedSpy1(shellSurface1.get(), &XdgShellToplevel::configured);
QSignalSpy configureRequestedSpy1(shellSurface1.get(),
&Wrapland::Client::XdgShellToplevel::configured);
REQUIRE(configureRequestedSpy1.isValid());

REQUIRE(configureRequestedSpy1.wait());
Expand All @@ -348,7 +340,8 @@ TEST_CASE("activation", "[win]")
REQUIRE(client2);
REQUIRE(client2->control->active);

QSignalSpy configureRequestedSpy2(shellSurface2.get(), &XdgShellToplevel::configured);
QSignalSpy configureRequestedSpy2(shellSurface2.get(),
&Wrapland::Client::XdgShellToplevel::configured);
REQUIRE(configureRequestedSpy2.isValid());

REQUIRE(configureRequestedSpy2.wait());
Expand Down Expand Up @@ -415,8 +408,6 @@ TEST_CASE("activation", "[win]")
// Verifies that we switch to the top-most fullscreen fullscreen, i.e.
// the one that user sees at the moment. See bug 411356.

using namespace Wrapland::Client;

// Prepare the test environment.
stackScreensVertically();

Expand All @@ -427,7 +418,8 @@ TEST_CASE("activation", "[win]")
REQUIRE(client1);
REQUIRE(client1->control->active);

QSignalSpy configureRequestedSpy1(shellSurface1.get(), &XdgShellToplevel::configured);
QSignalSpy configureRequestedSpy1(shellSurface1.get(),
&Wrapland::Client::XdgShellToplevel::configured);
REQUIRE(configureRequestedSpy1.isValid());

REQUIRE(configureRequestedSpy1.wait());
Expand All @@ -449,7 +441,8 @@ TEST_CASE("activation", "[win]")
REQUIRE(client2);
REQUIRE(client2->control->active);

QSignalSpy configureRequestedSpy2(shellSurface2.get(), &XdgShellToplevel::configured);
QSignalSpy configureRequestedSpy2(shellSurface2.get(),
&Wrapland::Client::XdgShellToplevel::configured);
REQUIRE(configureRequestedSpy2.isValid());

REQUIRE(configureRequestedSpy2.wait());
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ SPDX-License-Identifier: GPL-2.0-or-later
#include <catch2/generators/catch_generators.hpp>
#include <catch2/generators/catch_generators_range.hpp>

using namespace Wrapland::Client;

namespace como::detail::test
{

Expand Down
9 changes: 2 additions & 7 deletions tests/integration/buffer_size_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ TEST_CASE("buffer size change", "[render]")
SECTION("shm")
{
// Verifies that an SHM buffer size change is handled correctly.

using namespace Wrapland::Client;

auto surface = create_surface();
QVERIFY(surface);

Expand All @@ -48,8 +45,6 @@ TEST_CASE("buffer size change", "[render]")

SECTION("shm on subsurface")
{
using namespace Wrapland::Client;

// setup parent surface
auto parentSurface = create_surface();
QVERIFY(parentSurface);
Expand All @@ -59,7 +54,7 @@ TEST_CASE("buffer size change", "[render]")
// setup sub surface
auto surface = create_surface();
QVERIFY(surface);
std::unique_ptr<SubSurface> subSurface(create_subsurface(surface, parentSurface));
auto subSurface = create_subsurface(surface, parentSurface);
QVERIFY(subSurface);

// set buffer sizes
Expand All @@ -74,7 +69,7 @@ TEST_CASE("buffer size change", "[render]")
QSignalSpy damagedParentSpy(parent->qobject.get(), &win::window_qobject::damaged);
QVERIFY(damagedParentSpy.isValid());
render(surface, QSize(20, 10), Qt::red);
parentSurface->commit(Surface::CommitFlag::None);
parentSurface->commit(Wrapland::Client::Surface::CommitFlag::None);

QVERIFY(damagedParentSpy.wait());
QTRY_COMPARE(damagedParentSpy.count(), 2);
Expand Down
6 changes: 2 additions & 4 deletions tests/integration/dbus_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#include <Wrapland/Client/surface.h>
#include <xcb/xcb_icccm.h>

using namespace Wrapland::Client;

namespace como::detail::test
{

Expand Down Expand Up @@ -60,8 +58,8 @@ TEST_CASE("dbus interface", "[base]")
&space::qobject_t::wayland_window_added);
QVERIFY(clientAddedSpy.isValid());

std::unique_ptr<Surface> surface(create_surface());
std::unique_ptr<XdgShellToplevel> shellSurface(create_xdg_shell_toplevel(surface));
auto surface = create_surface();
auto shellSurface = create_xdg_shell_toplevel(surface);
shellSurface->setAppId(QByteArrayLiteral("org.kde.foo"));
shellSurface->setTitle(QStringLiteral("Test window"));

Expand Down
Loading