Page MenuHomeFreeBSD

D58034.id181294.diff
No OneTemporary

D58034.id181294.diff

diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -1211,6 +1211,8 @@
..
patch
..
+ pkgconf
+ ..
pr
..
printenv
diff --git a/usr.bin/pkgconf/Makefile b/usr.bin/pkgconf/Makefile
--- a/usr.bin/pkgconf/Makefile
+++ b/usr.bin/pkgconf/Makefile
@@ -1,3 +1,5 @@
+.include <src.opts.mk>
+
PACKAGE= pkgconf
# from contrib/pkgconf/meson.build:246
@@ -21,4 +23,7 @@
.PATH: ${PKGCONFDIR}/cli
.PATH: ${PKGCONFDIR}/man
+HAS_TESTS=
+SUBDIR.${MK_TESTS}+= tests
+
.include <bsd.prog.mk>
diff --git a/usr.bin/pkgconf/tests/Makefile b/usr.bin/pkgconf/tests/Makefile
new file mode 100644
--- /dev/null
+++ b/usr.bin/pkgconf/tests/Makefile
@@ -0,0 +1,29 @@
+.include <src.opts.mk>
+
+PACKAGE= tests
+
+# from contrib/pkgconf/meson.build:281
+PROGS+= test-runner
+
+BINDIR= ${TESTSDIR}
+
+SRCS.test-runner=core.c \
+ getopt_long.c \
+ renderer-msvc.c \
+ test-runner.c
+
+LIBADD.test-runner= pkgconf
+NO_SHARED.test-runner= yes
+
+PKGCONFDIR= ${SRCTOP}/contrib/pkgconf
+
+WARNS?= 3
+
+CFLAGS+= -I${SRCTOP}/lib/libpkgconf -I${PKGCONFDIR}
+
+.PATH: ${PKGCONFDIR}/tests
+.PATH: ${PKGCONFDIR}/cli
+
+TAP_TESTS_SH= pkgconf_tests
+
+.include <bsd.test.mk>
diff --git a/usr.bin/pkgconf/tests/pkgconf_tests.sh b/usr.bin/pkgconf/tests/pkgconf_tests.sh
new file mode 100644
--- /dev/null
+++ b/usr.bin/pkgconf/tests/pkgconf_tests.sh
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+_test() {
+ id="$1"
+ desc="$2"
+ shift 2
+
+ log=$("$@" 2>&1)
+ if [ $? -eq 0 ]; then
+ echo "ok $id $desc"
+ else
+ echo "not ok $id $desc"
+ fi
+ echo "$log" | while read line; do
+ echo "# $line"
+ done
+}
+
+_tests() {
+ tests="basic ordering personality solver sbom sysroot tuple spdxtool symlink parser"
+ cnt=2
+ for test in $tests; do cnt=$((cnt + 1)); done
+ failed=
+
+ echo "1..$cnt"
+ echo "# Log of test suite run on $(date)"
+
+ _test 1 "pkgconf:api-buffer" test-api-buffer
+
+ _test 2 "pkgconf:path-utils" test-path-utils
+
+ i=3
+ for test in $tests; do
+ _test "$i" "pkgconf:$test" test-runner --test-fixtures tests --tool-dir . t/$test
+ i=$((i + 1))
+ done
+}
+
+_tests

File Metadata

Mime Type
text/plain
Expires
Thu, Aug 6, 3:28 PM (18 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36046346
Default Alt Text
D58034.id181294.diff (2 KB)

Event Timeline