mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
gobject: Use TEST_FUNCTIONS framework in tests.
This commit is contained in:
@@ -18,9 +18,9 @@
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$GJS" ]; then
|
||||
echo "GObject bind tests skipped: gjs is missing"
|
||||
exit 77
|
||||
fi
|
||||
$TEST_FUNCTIONS
|
||||
skip_if_skipped
|
||||
skip_unless_environment_variable_set GJS
|
||||
skip_unless_phony_guest fedora.img
|
||||
|
||||
$GJS $srcdir/tests-misc.js
|
||||
|
||||
@@ -18,13 +18,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$GJS" ]; then
|
||||
echo "GObject bind tests skipped: gjs is missing"
|
||||
exit 77
|
||||
fi
|
||||
$TEST_FUNCTIONS
|
||||
skip_if_skipped
|
||||
skip_unless_environment_variable_set GJS
|
||||
|
||||
echo "GObject bind tests skipped: Int64, OInt64 and OStringList are all broken"
|
||||
exit 77
|
||||
# This test is disabled until we fix 64 bit support.
|
||||
skip_because "Int64, OInt64 and OStringList are all broken"
|
||||
|
||||
rm -f bindtests.tmp
|
||||
|
||||
|
||||
@@ -18,9 +18,8 @@
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$GJS" ]; then
|
||||
echo "GObject bind tests skipped: gjs is missing"
|
||||
exit 77
|
||||
fi
|
||||
$TEST_FUNCTIONS
|
||||
skip_if_skipped
|
||||
skip_unless_environment_variable_set GJS
|
||||
|
||||
$GJS $srcdir/bindtests-retvalues.js 2>/dev/null
|
||||
|
||||
@@ -211,6 +211,15 @@ skip_unless_libvirt_minimum_version ()
|
||||
fi
|
||||
}
|
||||
|
||||
# Skip unless the environment variable named is set to a non-empty value.
|
||||
skip_unless_environment_variable_set ()
|
||||
{
|
||||
if [ -z "${!1}" ]; then
|
||||
echo "$(basename $0): test skipped because \$$1 is not set"
|
||||
exit 77
|
||||
fi
|
||||
}
|
||||
|
||||
# Run an external command and skip if the command fails. This can be
|
||||
# used to test if a command exists. Normally you should use
|
||||
# `cmd --help' or `cmd --version' or similar.
|
||||
@@ -222,6 +231,13 @@ skip_unless ()
|
||||
fi
|
||||
}
|
||||
|
||||
# Use this if a test is broken. "$1" should contain the reason.
|
||||
skip_because ()
|
||||
{
|
||||
echo "$(basename $0): test skipped because: $1"
|
||||
exit 77
|
||||
}
|
||||
|
||||
# Skip if the user is trying to run a test as root.
|
||||
# Tests shouldn't be run as root, but a few are especially dangerous.
|
||||
skip_if_root ()
|
||||
|
||||
Reference in New Issue
Block a user