Vendor import of atf commit 55c21b2c5fb189bbdfccb2b297bfa89236502542
Updated from https://github.com/freebsd/atf
This commit is contained in:
parent
a3330ae736
commit
cd355e3667
14
.cirrus.yml
14
.cirrus.yml
@ -4,19 +4,19 @@ env:
|
||||
|
||||
task:
|
||||
matrix:
|
||||
- name: 13.0-CURRENT
|
||||
- name: 14.0-CURRENT
|
||||
freebsd_instance:
|
||||
image_family: freebsd-14-0-snap
|
||||
- name: 13.0-STABLE
|
||||
freebsd_instance:
|
||||
image_family: freebsd-13-0-snap
|
||||
- name: 12.2-STABLE
|
||||
- name: 13.0-RELEASE
|
||||
freebsd_instance:
|
||||
image_family: freebsd-12-2-snap
|
||||
- name: 12.1-RELEASE
|
||||
freebsd_instance:
|
||||
image_family: freebsd-12-1
|
||||
image_family: freebsd-13-0
|
||||
install_script:
|
||||
- sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf
|
||||
- ASSUME_ALWAYS_YES=yes pkg bootstrap -f
|
||||
- pkg install -y autoconf automake libtool kyua
|
||||
- pkg install -y autoconf automake libtool kyua pkgconf
|
||||
script:
|
||||
- env JUNIT_OUTPUT=$(pwd)/test-results.xml ./admin/travis-build.sh
|
||||
always:
|
||||
|
1223
Makefile.in
1223
Makefile.in
File diff suppressed because it is too large
Load Diff
9253
aclocal.m4
vendored
9253
aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@
|
||||
.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.Dd October 13, 2014
|
||||
.Dd February 23, 2021
|
||||
.Dt ATF-C 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -35,6 +35,8 @@
|
||||
.Nm ATF_CHECK_MATCH_MSG ,
|
||||
.Nm ATF_CHECK_STREQ ,
|
||||
.Nm ATF_CHECK_STREQ_MSG ,
|
||||
.Nm ATF_CHECK_INTEQ ,
|
||||
.Nm ATF_CHECK_INTEQ_MSG ,
|
||||
.Nm ATF_CHECK_ERRNO ,
|
||||
.Nm ATF_REQUIRE ,
|
||||
.Nm ATF_REQUIRE_MSG ,
|
||||
@ -44,6 +46,8 @@
|
||||
.Nm ATF_REQUIRE_MATCH_MSG ,
|
||||
.Nm ATF_REQUIRE_STREQ ,
|
||||
.Nm ATF_REQUIRE_STREQ_MSG ,
|
||||
.Nm ATF_REQUIRE_INTEQ ,
|
||||
.Nm ATF_REQUIRE_INTEQ_MSG ,
|
||||
.Nm ATF_REQUIRE_ERRNO ,
|
||||
.Nm ATF_TC ,
|
||||
.Nm ATF_TC_BODY ,
|
||||
@ -96,8 +100,10 @@
|
||||
.Fn ATF_CHECK_EQ_MSG "expected_expression" "actual_expression" "fail_msg_fmt" ...
|
||||
.Fn ATF_CHECK_MATCH "regexp" "string"
|
||||
.Fn ATF_CHECK_MATCH_MSG "regexp" "string" "fail_msg_fmt" ...
|
||||
.Fn ATF_CHECK_STREQ "string_1" "string_2"
|
||||
.Fn ATF_CHECK_STREQ_MSG "string_1" "string_2" "fail_msg_fmt" ...
|
||||
.Fn ATF_CHECK_STREQ "expected_string" "actual_string"
|
||||
.Fn ATF_CHECK_STREQ_MSG "expected_string" "actual_string" "fail_msg_fmt" ...
|
||||
.Fn ATF_CHECK_INTEQ "expected_int" "actual_int"
|
||||
.Fn ATF_CHECK_INTEQ_MSG "expected_int" "actual_int" "fail_msg_fmt" ...
|
||||
.Fn ATF_CHECK_ERRNO "expected_errno" "bool_expression"
|
||||
.Fn ATF_REQUIRE "expression"
|
||||
.Fn ATF_REQUIRE_MSG "expression" "fail_msg_fmt" ...
|
||||
@ -107,6 +113,8 @@
|
||||
.Fn ATF_REQUIRE_MATCH_MSG "regexp" "string" "fail_msg_fmt" ...
|
||||
.Fn ATF_REQUIRE_STREQ "expected_string" "actual_string"
|
||||
.Fn ATF_REQUIRE_STREQ_MSG "expected_string" "actual_string" "fail_msg_fmt" ...
|
||||
.Fn ATF_REQUIRE_INTEQ "expected_int" "actual_int"
|
||||
.Fn ATF_REQUIRE_INTEQ_MSG "expected_int" "actual_int" "fail_msg_fmt" ...
|
||||
.Fn ATF_REQUIRE_ERRNO "expected_errno" "bool_expression"
|
||||
.\" NO_CHECK_STYLE_END
|
||||
.Fn ATF_TC "name"
|
||||
@ -494,7 +502,7 @@ and
|
||||
.Fn ATF_REQUIRE_EQ_MSG
|
||||
take two expressions and fail if the two evaluated values are not equal.
|
||||
The common style is to put the expected value in the first parameter and the
|
||||
actual value in the second parameter.
|
||||
observed value in the second parameter.
|
||||
.Pp
|
||||
.Fn ATF_CHECK_MATCH ,
|
||||
.Fn ATF_CHECK_MATCH_MSG ,
|
||||
@ -513,7 +521,16 @@ and
|
||||
.Fn ATF_REQUIRE_STREQ_MSG
|
||||
take two strings and fail if the two are not equal character by character.
|
||||
The common style is to put the expected string in the first parameter and the
|
||||
actual string in the second parameter.
|
||||
observed string in the second parameter.
|
||||
.Pp
|
||||
.Fn ATF_CHECK_INTEQ ,
|
||||
.Fn ATF_CHECK_INTEQ_MSG ,
|
||||
.Fn ATF_REQUIRE_INTEQ
|
||||
and
|
||||
.Fn ATF_REQUIRE_INTQ_MSG
|
||||
take two integers and fail if the two are not equal.
|
||||
The common style is to put the expected integer in the first parameter and the
|
||||
observed integer in the second parameter.
|
||||
.Pp
|
||||
.Fn ATF_CHECK_ERRNO
|
||||
and
|
||||
|
@ -185,6 +185,25 @@
|
||||
"%s != %s (%s != %s): " fmt, \
|
||||
#expected, #actual, expected, actual, ##__VA_ARGS__)
|
||||
|
||||
#define ATF_REQUIRE_INTEQ(expected, actual) \
|
||||
ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd)", \
|
||||
#expected, #actual, (intmax_t)(expected), \
|
||||
(intmax_t)(actual))
|
||||
|
||||
#define ATF_CHECK_INTEQ(expected, actual) \
|
||||
ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd)", #expected, \
|
||||
#actual, (intmax_t)(expected), (intmax_t)(actual))
|
||||
|
||||
#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) \
|
||||
ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \
|
||||
#expected, #actual, (intmax_t)(expected), \
|
||||
(intmax_t)(actual), ##__VA_ARGS__)
|
||||
|
||||
#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) \
|
||||
ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \
|
||||
#expected, #actual, (intmax_t)(expected), \
|
||||
(intmax_t)(actual), ##__VA_ARGS__)
|
||||
|
||||
#define ATF_REQUIRE_MATCH(regexp, string) \
|
||||
ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \
|
||||
"'%s' not matched in '%s'", regexp, string);
|
||||
|
12
atf-c/tc.c
12
atf-c/tc.c
@ -381,15 +381,9 @@ pass(struct context *ctx)
|
||||
static void
|
||||
skip(struct context *ctx, atf_dynstr_t *reason)
|
||||
{
|
||||
if (ctx->expect == EXPECT_PASS) {
|
||||
create_resfile(ctx, "skipped", -1, reason);
|
||||
context_close_resfile(ctx);
|
||||
exit(EXIT_SUCCESS);
|
||||
} else {
|
||||
error_in_expect(ctx, "Can only skip a test case when running in "
|
||||
"expect pass mode");
|
||||
}
|
||||
UNREACHABLE;
|
||||
create_resfile(ctx, "skipped", -1, reason);
|
||||
context_close_resfile(ctx);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/** Formats a failure/skip reason message.
|
||||
|
@ -500,7 +500,7 @@ compare_files(const atf::fs::path& p1, const atf::fs::path& p2)
|
||||
|
||||
std::ifstream f2(p2.c_str());
|
||||
if (!f2)
|
||||
throw std::runtime_error("Failed to open " + p1.str());
|
||||
throw std::runtime_error("Failed to open " + p2.str());
|
||||
|
||||
for (;;) {
|
||||
char buf1[512], buf2[512];
|
||||
@ -511,7 +511,7 @@ compare_files(const atf::fs::path& p1, const atf::fs::path& p2)
|
||||
|
||||
f2.read(buf2, sizeof(buf2));
|
||||
if (f2.bad())
|
||||
throw std::runtime_error("Failed to read from " + p1.str());
|
||||
throw std::runtime_error("Failed to read from " + p2.str());
|
||||
|
||||
if ((f1.gcount() == 0) && (f2.gcount() == 0)) {
|
||||
equal = true;
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.Dd June 08, 2017
|
||||
.Dd January 27, 2021
|
||||
.Dt ATF-SH 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -358,21 +358,21 @@ This example demonstrates the use of the very useful
|
||||
function:
|
||||
.Bd -literal -offset indent
|
||||
# Check for silent output
|
||||
atf_check -s exit:0 -o empty -e empty 'true'
|
||||
atf_check -s exit:0 -o empty -e empty true
|
||||
|
||||
# Check for silent output and failure
|
||||
atf_check -s exit:1 -o empty -e empty 'false'
|
||||
atf_check -s exit:1 -o empty -e empty false
|
||||
|
||||
# Check for known stdout and silent stderr
|
||||
echo foo >expout
|
||||
atf_check -s exit:0 -o file:expout -e empty 'echo foo'
|
||||
atf_check -s exit:0 -o file:expout -e empty echo foo
|
||||
|
||||
# Generate a file for later inspection
|
||||
atf_check -s exit:0 -o save:stdout -e empty 'ls'
|
||||
atf_check -s exit:0 -o save:stdout -e empty ls
|
||||
grep foo ls || atf_fail "foo file not found in listing"
|
||||
|
||||
# Or just do the match along the way
|
||||
atf_check -s exit:0 -o match:"^foo$" -e empty 'ls'
|
||||
atf_check -s exit:0 -o match:"^foo$" -e empty ls
|
||||
.Ed
|
||||
.Sh SEE ALSO
|
||||
.Xr atf-check 1 ,
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Signature of the current package.
|
||||
m4_define(AT_PACKAGE_NAME, Automated Testing Framework)
|
||||
m4_define(AT_PACKAGE_TARNAME, atf)
|
||||
m4_define(AT_PACKAGE_VERSION, 0.21)
|
||||
m4_define(AT_PACKAGE_STRING, Automated Testing Framework 0.21)
|
||||
m4_define(AT_PACKAGE_VERSION, 0.22)
|
||||
m4_define(AT_PACKAGE_STRING, Automated Testing Framework 0.22)
|
||||
m4_define(AT_PACKAGE_BUGREPORT, atf-discuss@googlegroups.com)
|
||||
|
@ -906,7 +906,7 @@ fi
|
||||
# List of tests.
|
||||
if $at_list_p; then
|
||||
cat <<_ATEOF || at_write_fail=1
|
||||
Automated Testing Framework 0.21 test suite: bootstrap tests test groups:
|
||||
Automated Testing Framework 0.22 test suite: bootstrap tests test groups:
|
||||
|
||||
NUM: FILE-NAME:LINE TEST-GROUP-NAME
|
||||
KEYWORDS
|
||||
@ -947,7 +947,7 @@ _ATEOF
|
||||
exit $at_write_fail
|
||||
fi
|
||||
if $at_version_p; then
|
||||
$as_echo "$as_me (Automated Testing Framework 0.21)" &&
|
||||
$as_echo "$as_me (Automated Testing Framework 0.22)" &&
|
||||
cat <<\_ATEOF || at_write_fail=1
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@ -1124,11 +1124,11 @@ exec 5>>"$at_suite_log"
|
||||
|
||||
# Banners and logs.
|
||||
$as_echo "## ------------------------------------------------------------- ##
|
||||
## Automated Testing Framework 0.21 test suite: bootstrap tests. ##
|
||||
## Automated Testing Framework 0.22 test suite: bootstrap tests. ##
|
||||
## ------------------------------------------------------------- ##"
|
||||
{
|
||||
$as_echo "## ------------------------------------------------------------- ##
|
||||
## Automated Testing Framework 0.21 test suite: bootstrap tests. ##
|
||||
## Automated Testing Framework 0.22 test suite: bootstrap tests. ##
|
||||
## ------------------------------------------------------------- ##"
|
||||
echo
|
||||
|
||||
@ -1972,7 +1972,7 @@ _ASBOX
|
||||
$as_echo "Please send $at_msg and all information you think might help:
|
||||
|
||||
To: <atf-discuss@googlegroups.com>
|
||||
Subject: [Automated Testing Framework 0.21] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}
|
||||
Subject: [Automated Testing Framework 0.22] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}
|
||||
|
||||
You may investigate any problem if you feel able to do so, in which
|
||||
case the test suite provides a good starting point. Its output may
|
||||
|
Loading…
Reference in New Issue
Block a user