[PATCH libevl v2 4/4] tests: Add latmus wrapper script for evl-test integration

Tobias Schaffner <[email protected]> Thu, 9 Jul 2026 16:35:16 +0200
Newsgroups dev.linux.lists.xenomai
Message-ID <[email protected]>
Introduce a shell script wrapper that allows to invoke latmus as a
test binary like any other test:

The wrapper defaults to a 10-second timeout and no stdout if called
without arguments. If called with arguments latmus behaves like
directly called.

  evl test latmus            # runs with -T 10
  evl test latmus -- -A 150  # passes custom latmus arguments

This also allows to run latmus with the --stress-cmd option provided
by evl test:

  evl test --stress-cmd "stress-ng --cpu 1" latmus -- -T 60 -A 150

Signed-off-by: Tobias Schaffner <[email protected]>
---
 tests/latmus      | 16 ++++++++++++++++
 tests/meson.build | 11 +++++++++++
 2 files changed, 27 insertions(+)
 create mode 100755 tests/latmus

diff --git a/tests/latmus b/tests/latmus
new file mode 100755
index 0000000..c9cf135
--- /dev/null
+++ b/tests/latmus
@@ -0,0 +1,16 @@
+#!/bin/sh
+# SPDX-License-Identifier: MIT
+#
+# Wrapper for latmus test integration with evl-test.
+# Allows invoking latmus through the test suite with:
+#   evl test latmus -- -A 150
+#   evl test latmus -- -T 60
+#   evl test latmus
+#
+# Defaults to a 10-second dropping stdout if run if no arguments are provided.
+
+if [ $# -eq 0 ]; then
+    exec latmus -T 10 >/dev/null
+else
+    exec latmus "$@"
+fi
diff --git a/tests/meson.build b/tests/meson.build
index da2cfe9..d90cbdd 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -119,4 +119,15 @@ foreach t : test_programs_with_atomic
 )
 endforeach
 
+test_scripts = [
+    'latmus',
+]
+
+foreach t : test_scripts
+    install_data(t,
+        install_dir : libexec_evl + '/tests',
+        install_mode : 'rwxr-xr-x'
+    )
+endforeach
+
 subdir('compile-tests')
-- 
2.43.0