Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Use atf_skip on tests when not supported
Baptiste Daroussin committed 10 years ago
commit 9c17591776b5da218db8a5cc4f10aa4cfc20a9b8
parent 38f6cfe
4 files changed +15 -13
modified tests/frontend/001sanity.sh
@@ -1,12 +1,9 @@
#!/usr/bin/env atf-sh

. $(atf_get_srcdir)/test_environment.sh
-
if [ "${OS}" != "Darwin" ]; then
-
	ldd=ldd
-
fi
tests_init \
	which \
-
	${ldd}
+
	ldd

which_body() {
	atf_check \
@@ -16,8 +13,9 @@ which_body() {
	    which pkg
}

-

ldd_body() {
+
	atf_skip_on Darwin irrelevant on OSX
+

	atf_check \
	    -o match:".*libpkg.so.3 => $(atf_get_srcdir).*$" \
	    -e empty \
modified tests/frontend/create.sh
@@ -2,10 +2,6 @@

. $(atf_get_srcdir)/test_environment.sh

-
if [ `uname -s` != "Linux" ] ; then
-
	nonlinux="create_from_plist_fflags create_from_plist_bad_fflags"
-
fi
-

tests_init \
	create_from_plist \
	create_from_plist_set_owner \
@@ -15,7 +11,7 @@ tests_init \
	create_from_plist_mini \
	create_from_plist_dirrm \
	create_from_plist_ignore \
-
	${nonlinux} \
+
	create_from_plist_fflags create_from_plist_bad_fflags \
	create_from_plist_with_keyword_arguments \
	create_from_manifest_and_plist \
	create_from_plist_pkg_descr \
@@ -213,6 +209,7 @@ aline"
}

create_from_plist_fflags_body() {
+
	atf_skip_on Linux does not support fflags
	preparetestcredentials "(,,,schg)"

	atf_check \
@@ -223,6 +220,7 @@ create_from_plist_fflags_body() {
}

create_from_plist_bad_fflags_body() {
+
	atf_skip_on Linux does not support fflags
	preparetestcredentials "(,,,schg,bad)"

	atf_check \
modified tests/frontend/jpeg.sh
@@ -6,9 +6,8 @@ tests_init \
	jpeg

jpeg_body() {
-
	if [ "${OS}" = "Darwin" ]; then
-
		return
-
	fi
+
	atf_skip_on Darwin Irrelevant on OSX
+

	cc -shared -Wl,-soname=libjpeg.so.3 -o libjpeg.so.3
	ln -sf libjpeg.so.3 libjpeg.so
	cc -shared -Wl,-rpath=${TMPDIR} -L. -ljpeg -o deponjpeg.so
modified tests/frontend/test_environment.sh.in
@@ -25,3 +25,10 @@ atf_init_test_cases() {
		atf_add_test_case $t
	done
}
+

+
atf_skip_on() {
+
	if [ "${OS}" = "$1" ]; then
+
		shift
+
		atf_skip "$@"
+
	fi
+
}