Files
fedora-tools/touchpad-hold-tap/tests/test-touchpad-hold-tap-config
T

40 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
set -euo pipefail
plugin=$1
configurator=$2
test_root=$(mktemp -d)
trap 'rm -rf -- "$test_root"' EXIT
install -Dpm 0644 "$plugin" \
"$test_root/usr/lib64/libinput/plugins/90-touchpad-hold-tap.lua"
TOUCHPAD_HOLD_TAP_TEST_ROOT=$test_root bash "$configurator" set \
--minimum-anchor-age-ms 125 \
--minimum-pause-ms 175 \
--minimum-tap-ms 15 \
--maximum-tap-ms 225 \
--output-event KEY_F13
config="$test_root/etc/touchpad-hold-tap.conf"
override="$test_root/etc/libinput/plugins/90-touchpad-hold-tap.lua"
grep -qx 'MINIMUM_PAUSE_MS=175' "$config"
grep -qx 'MINIMUM_ANCHOR_AGE_MS=125' "$config"
grep -qx 'MINIMUM_TAP_MS=15' "$config"
grep -qx 'MAXIMUM_TAP_MS=225' "$config"
grep -qx 'OUTPUT_EVENT=KEY_F13' "$config"
grep -q 'minimum_pause_ms = 175' "$override"
grep -q 'minimum_anchor_age_ms = 125' "$override"
grep -q 'minimum_tap_ms = 15' "$override"
grep -q 'maximum_tap_ms = 225' "$override"
grep -q 'output_event = "KEY_F13"' "$override"
TOUCHPAD_HOLD_TAP_TEST_ROOT=$test_root bash "$configurator" reset
[[ ! -e $config ]]
[[ ! -e $override ]]
printf 'touchpad configurator tests passed\n'