Page MenuHomeFreeBSD

D58034.diff
No OneTemporary

D58034.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,56 @@
+.include <src.opts.mk>
+
+PACKAGE= tests
+
+# from contrib/pkgconf/meson.build:281
+PROGS+= test-runner
+
+SRCS.test-runner=core.c \
+ getopt_long.c \
+ renderer-msvc.c \
+ test-runner.c
+
+LIBADD.test-runner= pkgconf
+NO_SHARED.test-runner= yes
+
+# from contrib/pkgconf/meson.build:292
+API_TESTS=audit \
+ buffer \
+ bytecode \
+ client \
+ dependency \
+ fileio \
+ fragment \
+ license \
+ path-utils \
+ personality \
+ queue \
+ tuple \
+ variable \
+ version
+
+# from contrib/pkgconf/meson.build:309
+.for test in ${API_TESTS}
+PROGS+= test-api-${test}
+
+SRCS.test-api-${test}= test-${test}.c
+
+LIBADD.test-api-${test}=pkgconf
+NO_SHARED.test-api-${test}=yes
+.endfor
+
+BINDIR= ${TESTSDIR}
+
+PKGCONFDIR= ${SRCTOP}/contrib/pkgconf
+
+WARNS?= 3
+
+CFLAGS+= -I${SRCTOP}/lib/libpkgconf -I${PKGCONFDIR}
+
+.PATH: ${PKGCONFDIR}/tests/api
+.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,41 @@
+#! /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() {
+ api_tests="audit buffer bytecode client dependency fileio fragment license path-utils personality queue tuple variable version"
+ tests="basic ordering personality solver sbom sysroot tuple spdxtool symlink parser"
+ cnt=0
+ for test in $api_tests $tests; do cnt=$((cnt + 1)); done
+ failed=
+
+ i=1
+ echo "$i..$cnt"
+ echo "# Log of test suite run on $(date)"
+
+ for test in $api_tests; do
+ _test $i "pkgconf:api-$test" test-api-$test
+ i=$((i + 1))
+ done
+
+ 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
Tue, Jul 7, 5:46 AM (19 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34787063
Default Alt Text
D58034.diff (2 KB)

Event Timeline