mirror of
https://github.com/openbsd/ports.git
synced 2026-06-18 07:24:23 +02:00
Import regression tests suite for portcheck. With help support from espie@
and suggestions from others. A few files need to be added manually in the next commit.
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
|
||||
# To add a test named ${testname}:
|
||||
# 1) If test should catch errors, add sample portcheck output to the
|
||||
# ${testname}.sample file in this directory. Otherwise, this file should
|
||||
# absent.
|
||||
# 2) Create test port directory with ${testname} name.
|
||||
# 3) Add the test to REGRESS_TARGETS.
|
||||
# 4) If the test doesn't need running plist checks, add the -P to the
|
||||
# TEST_${testname}_ARGS variable. Do this in the "test-specific parameters"
|
||||
# section below.
|
||||
|
||||
# user-customizeable
|
||||
REGRESS_TARGETS ?= t1 t2 t3 t4 t5
|
||||
PORTCHECK ?= ${PORTSDIR}/infrastructure/bin/portcheck
|
||||
PORTCHECK_ARGS ?=
|
||||
SUBST_CMD ?= ${PORTSDIR}/infrastructure/bin/pkg_subst
|
||||
|
||||
# internal stuff, non-customizable
|
||||
PORTCHECK_ROOT_DIR = ${.CURDIR:C,/[^/]+/*$,,}
|
||||
CATEGORY = ${.CURDIR:C,^${PORTSDIR}/,,}
|
||||
SUBST_ARGS = -c -DCATEGORY=${CATEGORY}
|
||||
SCANNING_MSG = "scanning ports under the ${PORTSDIR}"
|
||||
|
||||
# test-specific parameters
|
||||
TEST_t3_ARGS = -A ${CATEGORY}/t3
|
||||
TEST_t4_ARGS = -A -P ${CATEGORY}/t4
|
||||
|
||||
# define tests
|
||||
.for _t in ${REGRESS_TARGETS}
|
||||
TEST_${_t}_ARGS ?=
|
||||
TEST_${_t}_DIR = ${.CURDIR}/${_t}
|
||||
TEST_${_t}_DIFF_OPTS =
|
||||
. if ${TEST_${_t}_ARGS:M-A}
|
||||
TEST_${_t}_DIFF_OPTS += -I ${SCANNING_MSG}
|
||||
. endif
|
||||
|
||||
# will exist if and only if portcheck returned non-zero
|
||||
TEST_${_t}_FAIL = ${_t}.failed
|
||||
|
||||
# output of portcheck's stdout and stderr
|
||||
TEST_${_t}_OUT = ${_t}.pkgpath
|
||||
TEST_${_t}_ERR = ${_t}.errors
|
||||
|
||||
CLEANFILES += ${TEST_${_t}_FAIL} ${TEST_${_t}_ERR} ${TEST_${_t}_OUT}
|
||||
|
||||
# sample error list, to compare with actual portcheck output
|
||||
TEST_${_t}_SAMPLE_SRC = ${.CURDIR}/${_t}.sample
|
||||
|
||||
# same as above but after substitution, needed for path independancy
|
||||
TEST_${_t}_SAMPLE = ${_t}.sample.subst
|
||||
CLEANFILES += ${TEST_${_t}_SAMPLE}
|
||||
|
||||
. if exists(${TEST_${_t}_SAMPLE_SRC})
|
||||
${TEST_${_t}_SAMPLE}: ${TEST_${_t}_SAMPLE_SRC}
|
||||
@${SUBST_CMD} ${SUBST_ARGS} -DTEST=${_t} $> $@
|
||||
${_t}: ${TEST_${_t}_SAMPLE}
|
||||
. endif
|
||||
|
||||
${_t}: .PHONY
|
||||
@echo '=> ${_t}'
|
||||
@rm -f ${TEST_${_t}_FAIL}
|
||||
@(cd ${TEST_${_t}_DIR}; ${PORTCHECK} ${TEST_${_t}_ARGS}) \
|
||||
>${TEST_${_t}_OUT} 2>${TEST_${_t}_ERR} || touch ${TEST_${_t}_FAIL}
|
||||
|
||||
. if exists(${TEST_${_t}_SAMPLE_SRC})
|
||||
# there should be errors printed and portcheck should exit with non-zero code
|
||||
@test -e ${TEST_${_t}_FAIL} || echo "${_t}: portcheck did not fail"
|
||||
@diff -u ${TEST_${_t}_DIFF_OPTS} ${TEST_${_t}_SAMPLE} ${TEST_${_t}_ERR}
|
||||
. else
|
||||
# there should be NO errors printed and portcheck should exit with zero code
|
||||
@test ! -e ${TEST_${_t}_FAIL} || echo "${_t}: portcheck did not succeed"
|
||||
|
||||
# in -A mode, portcheck still prints to stderr ${SCANNING_MSG}
|
||||
. if ${TEST_${_t}_ARGS:M-A}
|
||||
@echo ${SCANNING_MSG} | \
|
||||
diff -u ${TEST_${_t}_DIFF_OPTS} - ${TEST_${_t}_ERR}
|
||||
. else
|
||||
@test ! -s ${TEST_${_t}_ERR} || { \
|
||||
echo "${_t}: portcheck printed errors:"; \
|
||||
cat ${TEST_${_t}_ERR}; \
|
||||
}
|
||||
. endif
|
||||
. endif
|
||||
|
||||
. if ${TEST_${_t}_ARGS:M-A}
|
||||
@test ! -s ${TEST_${_t}_OUT} || { \
|
||||
echo "${_t}: portcheck printed on stdout:"; \
|
||||
cat ${TEST_${_t}_OUT}; \
|
||||
}
|
||||
. else
|
||||
@echo ${CATEGORY}/${_t} | \
|
||||
diff -u ${TEST_${_t}_DIFF_OPTS} - ${TEST_${_t}_OUT}
|
||||
. endif
|
||||
|
||||
.PHONY: ${_t}
|
||||
.endfor
|
||||
|
||||
.include <bsd.regress.mk>
|
||||
@@ -0,0 +1,3 @@
|
||||
# $OpenBSD: Makefile.inc,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
CATEGORIES += ${PKGPATH:C,/[^/]+$,,}
|
||||
PERMIT_PACKAGE_CDROM ?= Yes
|
||||
@@ -0,0 +1,2 @@
|
||||
no distinfo in .
|
||||
missing RDEP on devel/desktop-file-utils
|
||||
@@ -0,0 +1,6 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
|
||||
COMMENT = test 1
|
||||
DISTNAME = test-1
|
||||
|
||||
.include <bsd.port.mk>
|
||||
@@ -0,0 +1 @@
|
||||
KCalc is a calculator which offers many mathematical functions.
|
||||
@@ -0,0 +1,17 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
@conflict kdeutils-<4
|
||||
@bin bin/kcalc
|
||||
lib/libkdeinit4_kcalc.so
|
||||
share/applications/kde4/kcalc.desktop
|
||||
share/apps/kcalc/
|
||||
share/apps/kcalc/kcalcui.rc
|
||||
share/apps/kcalc/scienceconstants.xml
|
||||
share/apps/kconf_update/kcalcrc.upd
|
||||
share/config.kcfg/kcalc.kcfg
|
||||
share/doc/HTML/en/kcalc/
|
||||
share/doc/HTML/en/kcalc/commands.docbook
|
||||
share/doc/HTML/en/kcalc/common
|
||||
share/doc/HTML/en/kcalc/index.cache.bz2
|
||||
share/doc/HTML/en/kcalc/index.docbook
|
||||
@exec %D/bin/update-desktop-database
|
||||
@unexec-delete %D/bin/update-desktop-database
|
||||
@@ -0,0 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
# "fixed" version of t1
|
||||
|
||||
COMMENT = test 1
|
||||
DISTNAME = test-1
|
||||
|
||||
RUN_DEPENDS = devel/desktop-file-utils
|
||||
|
||||
.include <bsd.port.mk>
|
||||
@@ -0,0 +1 @@
|
||||
KCalc is a calculator which offers many mathematical functions.
|
||||
@@ -0,0 +1,17 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
@conflict kdeutils-<4
|
||||
@bin bin/kcalc
|
||||
lib/libkdeinit4_kcalc.so
|
||||
share/applications/kde4/kcalc.desktop
|
||||
share/apps/kcalc/
|
||||
share/apps/kcalc/kcalcui.rc
|
||||
share/apps/kcalc/scienceconstants.xml
|
||||
share/apps/kconf_update/kcalcrc.upd
|
||||
share/config.kcfg/kcalc.kcfg
|
||||
share/doc/HTML/en/kcalc/
|
||||
share/doc/HTML/en/kcalc/commands.docbook
|
||||
share/doc/HTML/en/kcalc/common
|
||||
share/doc/HTML/en/kcalc/index.cache.bz2
|
||||
share/doc/HTML/en/kcalc/index.docbook
|
||||
@exec %D/bin/update-desktop-database
|
||||
@unexec-delete %D/bin/update-desktop-database
|
||||
@@ -0,0 +1 @@
|
||||
in ${CATEGORY}/${TEST}: missing RDEP on devel/desktop-file-utils
|
||||
@@ -0,0 +1,8 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
#
|
||||
# Check there are no distinfo checks in -A mode
|
||||
|
||||
COMMENT = test 1
|
||||
DISTNAME = test-1
|
||||
|
||||
.include <bsd.port.mk>
|
||||
@@ -0,0 +1 @@
|
||||
KCalc is a calculator which offers many mathematical functions.
|
||||
@@ -0,0 +1,17 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
@conflict kdeutils-<4
|
||||
@bin bin/kcalc
|
||||
lib/libkdeinit4_kcalc.so
|
||||
share/applications/kde4/kcalc.desktop
|
||||
share/apps/kcalc/
|
||||
share/apps/kcalc/kcalcui.rc
|
||||
share/apps/kcalc/scienceconstants.xml
|
||||
share/apps/kconf_update/kcalcrc.upd
|
||||
share/config.kcfg/kcalc.kcfg
|
||||
share/doc/HTML/en/kcalc/
|
||||
share/doc/HTML/en/kcalc/commands.docbook
|
||||
share/doc/HTML/en/kcalc/common
|
||||
share/doc/HTML/en/kcalc/index.cache.bz2
|
||||
share/doc/HTML/en/kcalc/index.docbook
|
||||
@exec %D/bin/update-desktop-database
|
||||
@unexec-delete %D/bin/update-desktop-database
|
||||
@@ -0,0 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
#
|
||||
# Won't fail because distinfo checks don't happen for checking
|
||||
# "existing" ports, and -P is used to skip PLIST checks.
|
||||
|
||||
COMMENT = test 1
|
||||
DISTNAME = test-1
|
||||
|
||||
.include <bsd.port.mk>
|
||||
@@ -0,0 +1,17 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
@conflict kdeutils-<4
|
||||
@bin bin/kcalc
|
||||
lib/libkdeinit4_kcalc.so
|
||||
share/applications/kde4/kcalc.desktop
|
||||
share/apps/kcalc/
|
||||
share/apps/kcalc/kcalcui.rc
|
||||
share/apps/kcalc/scienceconstants.xml
|
||||
share/apps/kconf_update/kcalcrc.upd
|
||||
share/config.kcfg/kcalc.kcfg
|
||||
share/doc/HTML/en/kcalc/
|
||||
share/doc/HTML/en/kcalc/commands.docbook
|
||||
share/doc/HTML/en/kcalc/common
|
||||
share/doc/HTML/en/kcalc/index.cache.bz2
|
||||
share/doc/HTML/en/kcalc/index.docbook
|
||||
@exec %D/bin/update-desktop-database
|
||||
@unexec-delete %D/bin/update-desktop-database
|
||||
@@ -0,0 +1,13 @@
|
||||
duplicated assignment of COMMENT at Makefile:7
|
||||
patches/patch-xyz does not have $OpenBSD$ RCS tag at the top
|
||||
extra file: patches/patch-xyz.orig
|
||||
extra file: patches/qwerty
|
||||
core dump file found: some.core
|
||||
no distinfo in .
|
||||
extra file: ./pkg/qwerty
|
||||
non-empty WANTLIB- for arch-independent package
|
||||
kdeui WANTLIB without x11/kde* in MODULES (check other libs, too!)
|
||||
missing RDEP on devel/desktop-file-utils
|
||||
missing @exec of update-desktop-database
|
||||
missing @unexec-delete of update-desktop-database
|
||||
translation file(s) found without devel/gettext dependency
|
||||
@@ -0,0 +1,13 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
#
|
||||
# Check catching most obvious things
|
||||
|
||||
COMMENT = test 1
|
||||
COMMENT += 222
|
||||
COMMENT = test 1
|
||||
DISTNAME = test-1
|
||||
PKG_ARCH= *
|
||||
|
||||
WANTLIB = c kdeui
|
||||
|
||||
.include <bsd.port.mk>
|
||||
@@ -0,0 +1 @@
|
||||
stub
|
||||
@@ -0,0 +1 @@
|
||||
stub
|
||||
@@ -0,0 +1,5 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2014/02/03 22:28:41 zhuk Exp $
|
||||
share/applications/kde4/kcalc.desktop
|
||||
share/doc/HTML/en/kcalc/index.cache.bz2
|
||||
share/doc/HTML/en/kcalc/index.docbook
|
||||
share/locale/zh_CN/LC_MESSAGES/gwenview.mo
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user