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
2 changes: 1 addition & 1 deletion .github/workflows/build_ubuntu2204.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
libwayland-dev libinput-dev build-essential cmake \
autoconf automake libtool
autoconf automake libtool libcurl4-openssl-dev

- name: Configure CMake
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang_tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
build-essential cmake \
clang clang-tidy \
libwayland-dev libinput-dev libudev-dev \
autoconf automake libtool
autoconf automake libtool libcurl4-openssl-dev

- name: Configure
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
libwayland-dev libinput-dev libudev-dev \
libgtest-dev libgmock-dev \
libasan5 \
autoconf automake libtool
autoconf automake libtool libcurl4-openssl-dev

- name: Configure
run: |
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
libwayland-dev libinput-dev libudev-dev \
libgtest-dev libgmock-dev \
libubsan1 \
autoconf automake libtool
autoconf automake libtool libcurl4-openssl-dev

- name: Configure
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
libwayland-dev libinput-dev libudev-dev \
libgtest-dev libgmock-dev \
lcov \
autoconf automake libtool
autoconf automake libtool libcurl4-openssl-dev

- name: Configure
run: |
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ if(NOT BUILD_CAPNP)
find_package(CapnProto REQUIRED)
endif()

if(ENABLE_PLUGIN_AGL_HEALTH)
find_package(PkgConfig REQUIRED)
pkg_check_modules(CURL REQUIRED libcurl)
endif()

add_subdirectory(plugins)

# Core Test Runner capnp schemas
Expand Down Expand Up @@ -74,6 +79,7 @@ target_link_libraries(TestRunnerClient
CapnProto::kj
CapnProto::kj-async
spdlog::spdlog
${TEST_RUNNER_PLUGIN_LIBS}
)
target_include_directories(TestRunnerClient
PUBLIC
Expand Down Expand Up @@ -139,6 +145,7 @@ if(BUILD_SERVER)
CapnProto::kj
CapnProto::kj-async
spdlog::spdlog
${TEST_RUNNER_PLUGIN_LIBS}
)
install(TARGETS TestRunnerServer)
endif()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![CI](https://github.com/<org>/test_runner/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/<org>/test_runner/actions/workflows/unit_tests.yml)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)

A Cap'n Proto RPC framework for injecting and recording input events on Linux systems via `uinput`. A plugin system lets developers extend the server with their own Cap'n Proto interfaces.
Remote test framework for automated testing of [ivi-homescreen](https://github.com/toyota-connected/ivi-homescreen). Cap'n Proto server daemon runs alongside ivi-homescreen and listens for remote events. Enables injecting and recording input events via `uinput`. A plugin system lets developers extend the server with their own Cap'n Proto interfaces.

## Features

Expand Down
5 changes: 5 additions & 0 deletions cmake/plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ if (ENABLE_PLUGIN_WESTON_SCREENSHOOTER)
add_compile_definitions(ENABLE_PLUGIN_WESTON_SCREENSHOOTER)
endif ()

option(ENABLE_PLUGIN_AGL_HEALTH "Enable AGL Health Plugin" ON)
if (ENABLE_PLUGIN_AGL_HEALTH)
add_compile_definitions(ENABLE_PLUGIN_AGL_HEALTH)
endif ()

174 changes: 174 additions & 0 deletions emb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# A self-describing package manifest for the emb CLI.
#
# Build it natively on this host (host compiler + system libraries) with the
# built-in `local` target — `emb cross <file> --target local` uses the file's
# parent dir as the CMake source, so this manifest lives at the repo root:
#
# emb cross emb.yaml --target local --build
#
# Install the host build deps below first (coalesced across every discovered
# package, filtered to what's missing, installed in one transaction):
#
# emb deps --packages .. --yes # scans sibling dirs for emb.yaml
#
# The `cross.defines` reproduce the canonical Linux build
# (.github/workflows/build_ubuntu2204.yml): server + recorder + examples, with
# the vendored capnproto 0.9.1 under third_party/ (BUILD_CAPNP=ON). Override any
# of them per invocation with `-D`, e.g. a client-only build:
#
# emb cross emb.yaml --target local --build \
# -D BUILD_SERVER=OFF -D BUILD_EXAMPLES=OFF
id: test_runner
type: app
supported_archs: [arm64, x86_64]
supported_host_types: [fedora, ubuntu]

cross:
# `provider:` is required for the cross: block to parse; it is ignored for the
# native `--target local` build (which uses the host toolchain, no sysroot).
provider: arm-gnu
# Shared build-system -D defines, applied to every build: the native `local`
# build and each cross target below.
defines:
BUILD_SERVER: 'ON'
BUILD_RECORDER: 'ON'
BUILD_EXAMPLES: 'ON'
BUILD_TESTING: 'OFF'
BUILD_CAPNP: 'ON' # build the vendored capnproto 0.9.1 (third_party/)

# `emb cross emb.yaml --build --deb` packages this binary into a .deb under
# <buildRoot>/dist. Depends is auto-derived from the binary's DT_NEEDED
# (libudev1, libc6, libstdc++6, …); the vendored capnproto/spdlog are linked
# statically, so they pull no runtime dependency. The two in-tree shared libs
# the server loads (libTestRunnerServer.so, libTestRunnerRecorder.so) ship
# alongside it under /usr/lib via cmake install(), collected by `files:`.
package:
name: test-runner
version: 0.1.0
maintainer: "Matt Everett <M.Everett.90@gmail.com>"
description: "Remote test runner server for ivi-homescreen (cross-built by emb)"
section: utils
bin: TestRunner-Server
install_dir: /usr/bin
# Ship the binary's in-tree .so closure (libTestRunnerServer.so,
# libTestRunnerRecorder.so) under /usr/lib/<multiarch>/ so the single-binary
# package is runnable. Sysroot/system libs stay out — see depends: below.
bundle_libs: true
# The target capnp/kj runtimes come from the device's Debian repo; declare
# them so `apt-get install ./test-runner.deb` pulls them. (auto-depends can't
# derive these: emb extracts the -dev packages root-free, so the sonames
# aren't in the sysroot's dpkg db.) Confirm the exact name on trixie with
# `apt-cache policy` if apt can't find it.
depends:
- libcapnp-1.1.0

# Cross targets, one per board. Build with `emb cross emb.yaml --target <name>
# --build`; `--target local` (the default) still does the native host build
# above. Each `extends: <board>` picks the hardware layer from emb's shipped
# board library (boards/raspberry-pi.emb.yaml): ARM GNU toolchain 15.2.rel1
# (gcc 15 / glibc 2.41), the raspios-trixie sysroot image, rootfs partition,
# CPU tuning, and the base GUI/input stack (which already covers libwayland-dev,
# libinput-dev, libudev-dev that the server links). spdlog is vendored and
# cross-built (header/static, no sysroot dep).
#
# The boards differ ONLY in CPU tuning — rpi4-trixie is Cortex-A72 (armv8-a),
# rpi5-trixie is Cortex-A76 (armv8.2-a). Build the one that matches the actual
# device: an A76 build emits armv8.1+ instructions (e.g. `ldapr`) that an A72
# traps as SIGILL. The app layer (defines/augment/sysroot) is identical across
# boards, shared here via YAML anchors on rpi4-trixie.
targets:
# Raspberry Pi 4 (Cortex-A72). Carries the shared app-layer anchors.
rpi4-trixie:
extends: rpi4-trixie

# Target `defines` REPLACE the shared set above (the shared→target merge is
# shallow), so the full set is restated here. The one change vs. the native
# build is BUILD_CAPNP=OFF: capnp is both a build-time schema compiler AND a
# runtime library. Building it for the target (BUILD_CAPNP=ON) produces an
# aarch64 `capnp`/`capnpc-c++` that CMake then can't run on the x86_64 host
# (qemu can't find the aarch64 loader) — the codegen step fails. So use a
# HOST capnp (augment below) for codegen + the TARGET libcapnp from the
# sysroot for the headers/link, exactly as the CMakeLists' `if(NOT
# BUILD_CAPNP)` path intends. FOUND_LIBATOMIC pre-seeds a cache var so
# Debian's CapnProtoConfig.cmake skips a check_library_exists(atomic …)
# probe that fails to *compile* under gcc 15 (it declares `char
# __atomic_load_8()`, ambiguating the builtin) and aborts with a bogus
# "libatomic not found".
defines: &trixie_defines
BUILD_SERVER: 'ON'
BUILD_RECORDER: 'ON'
BUILD_EXAMPLES: 'ON'
BUILD_TESTING: 'OFF'
BUILD_CAPNP: 'OFF'
FOUND_LIBATOMIC: 'ON'

# Host-native capnp 1.1.0 codegen tool (`capnp` + `capnpc-c++`), built with
# the host compiler and prepended to the cross build's PATH so the project's
# `find_program(capnp)` / `find_program(capnpc-c++)` resolve it. Same
# host-tool pattern ivi-homescreen uses for wayland-cxx-scanner. The version
# MUST match the target libcapnp (trixie ships 1.1.0): capnp's generated
# headers enforce an exact CAPNP_VERSION match between compiler and runtime,
# so a host 1.0.x + target 1.1.0 mix would `#error` at compile time.
augment: &trixie_augment
- pkg: capnproto
min: "1.1.0" # also the extracted source-dir name
url: https://capnproto.org/capnproto-c++-1.1.0.tar.gz
build: cmake
host: true
defines:
BUILD_TESTING: 'OFF'

# Target capnproto (1.1.0) for `find_package(CapnProto)` + link. Unions with
# the board's base dev_packages (which already cover wayland/input/udev).
# The libatomic.so symlink: CapnProtoConfig.cmake link-probes `-latomic`
# (aarch64 needs libatomic for 64-bit atomics), but the image sysroot ships
# only the versioned libatomic.so.1 under the multiarch dir (the unversioned
# dev symlink lives in gcc's private dir, off the linker's default search
# path). Add the standard dev symlink; the binary's NEEDED stays
# libatomic.so.1, which is present on the device.
sysroot: &trixie_sysroot
dev_packages:
- libcapnp-dev
symlinks:
usr/lib/aarch64-linux-gnu/libatomic.so: libatomic.so.1

# Raspberry Pi 5 (Cortex-A76). Same app layer as rpi4-trixie; only the board
# (toolchain tuning / image) differs.
rpi5-trixie:
extends: rpi5-trixie
defines: *trixie_defines
augment: *trixie_augment
sysroot: *trixie_sysroot

# Host build dependencies, keyed by OS then (on Linux) distro id. `emb deps`
# coalesces these across all discovered packages, filters to what's missing on
# the host, and installs the union in one PackageKit (Linux) transaction.
#
# - wayland + libinput + libudev: the server links wayland-client / udev and
# (optionally) libinput for the recorder.
# - pkg-config: the server's `pkg_check_modules(wayland-client)`.
# - autoconf/automake/libtool: the vendored capnproto 0.9.1 runs `./configure`
# when BUILD_CAPNP=ON.
deps:
linux:
fedora:
- gcc-c++
- make
- cmake
- pkgconf-pkg-config
- wayland-devel
- libinput-devel
- systemd-devel
- autoconf
- automake
- libtool
ubuntu:
- build-essential
- cmake
- pkg-config
- libwayland-dev
- libinput-dev
- libudev-dev
- autoconf
- automake
- libtool
6 changes: 6 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ set(TEST_RUNNER_PLUGIN_SRCS "")
set(TEST_RUNNER_PLUGIN_INC "")
set(TEST_RUNNER_PLUGIN_CLIENT_SRCS "")
set(TEST_RUNNER_PLUGIN_CAPNP_SCHEMAS "")
set(TEST_RUNNER_PLUGIN_LIBS "")

if (ENABLE_PLUGIN_WESTON_SCREENSHOOTER)
add_subdirectory(weston_screenshooter)
endif ()

if (ENABLE_PLUGIN_AGL_HEALTH)
add_subdirectory(agl_health)
endif ()

set(TEST_RUNNER_PLUGIN_SRCS
${TEST_RUNNER_PLUGIN_SRCS}
${CMAKE_CURRENT_SOURCE_DIR}/plugins.cpp
PARENT_SCOPE
)
set(TEST_RUNNER_PLUGIN_CLIENT_SRCS ${TEST_RUNNER_PLUGIN_CLIENT_SRCS} PARENT_SCOPE)
set(TEST_RUNNER_PLUGIN_INC ${TEST_RUNNER_PLUGIN_INC} PARENT_SCOPE)
set(TEST_RUNNER_PLUGIN_LIBS ${TEST_RUNNER_PLUGIN_LIBS} PARENT_SCOPE)
set(TEST_RUNNER_PLUGIN_CAPNP_SCHEMAS
${TEST_RUNNER_PLUGIN_CAPNP_SCHEMAS}
${CMAKE_CURRENT_SOURCE_DIR}/plugins.capnp
Expand Down
Loading
Loading