-
Notifications
You must be signed in to change notification settings - Fork 723
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libusb-compat: add simple ptest (example programs)
Build and run example programs as test. This will only catch major errors (.so lib won't load etc.) because no output check is done, only return status is checked. Signed-off-by: Yoann Congal <[email protected]>
- Loading branch information
1 parent
996778c
commit 0e09786
Showing
3 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...ecipes-support/libusb/libusb-compat/0002-automake-make-example-programs-installable.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
From 9dcdfa716e3c3831d9b70472b39dab2fd370f503 Mon Sep 17 00:00:00 2001 | ||
From: Yoann Congal <[email protected]> | ||
Date: Sun, 26 Feb 2023 16:04:35 +0100 | ||
Subject: [PATCH] automake: make example programs installable | ||
|
||
The example programs are used as tests for ptest, so we need a way to | ||
install them on the rootfs. | ||
|
||
Upstream-Status: Inappropriate [oe-core specific] | ||
--- | ||
examples/Makefile.am | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/examples/Makefile.am b/examples/Makefile.am | ||
index 9bd3efc..f4324c2 100644 | ||
--- a/examples/Makefile.am | ||
+++ b/examples/Makefile.am | ||
@@ -1,5 +1,5 @@ | ||
AM_CPPFLAGS = -I$(top_srcdir)/libusb | ||
-noinst_PROGRAMS = lsusb testlibusb | ||
+bin_PROGRAMS = lsusb testlibusb | ||
|
||
lsusb_SOURCES = lsusb.c | ||
lsusb_LDADD = ../libusb/libusb.la |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
rc=0 | ||
for TEST in lsusb testlibusb; do | ||
if ! ./$TEST ; then | ||
echo "FAIL: $TEST" | ||
rc=$((rc + 1)) | ||
else | ||
echo "PASS: $TEST" | ||
fi | ||
done | ||
|
||
# return number of failed tests | ||
exit $rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters