Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
- Fix for default mtree style
- Update libelf
- Importing libexecinfo
- Resynchronize GCC, mpc, gmp, mpfr
- build.sh: Replace params with show-params.
This has been done as the make target has been renamed in the same
way, while a new target named params has been added. This new
target generates a file containing all the parameters, instead of
printing it on the console.
- Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
get getservbyport() out of the inner loop
Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
This commit is contained in:
@@ -364,6 +364,30 @@ public:
|
||||
};
|
||||
|
||||
|
||||
/// Creates a mock tester that receives a signal.
|
||||
///
|
||||
/// \param interface The name of the interface implemented by the tester.
|
||||
/// \param term_sig Signal to deliver to the tester. If the tester does not
|
||||
/// exit due to this reason, it exits with an arbitrary non-zero code.
|
||||
static void
|
||||
create_mock_tester_signal(const char* interface, const int term_sig)
|
||||
{
|
||||
const std::string tester_name = F("kyua-%s-tester") % interface;
|
||||
|
||||
atf::utils::create_file(
|
||||
tester_name,
|
||||
F("#! /bin/sh\n"
|
||||
"echo 'stdout stuff'\n"
|
||||
"echo 'stderr stuff' 1>&2\n"
|
||||
"kill -%s $$\n"
|
||||
"echo 'not reachable' 1>&2\n"
|
||||
"exit 0\n") % term_sig);
|
||||
ATF_REQUIRE(::chmod(tester_name.c_str(), 0755) != -1);
|
||||
|
||||
utils::setenv("KYUA_TESTERSDIR", fs::current_path().str());
|
||||
}
|
||||
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
@@ -513,6 +537,23 @@ ATF_TEST_CASE_BODY(test_case__operators_eq_and_ne__not_copy)
|
||||
}
|
||||
|
||||
|
||||
ATF_TEST_CASE_WITHOUT_HEAD(run_test_case__tester_crashes);
|
||||
ATF_TEST_CASE_BODY(run_test_case__tester_crashes)
|
||||
{
|
||||
atf_helper helper(this, "pass");
|
||||
helper.move("program", ".");
|
||||
create_mock_tester_signal("atf", SIGSEGV);
|
||||
capture_hooks hooks;
|
||||
const engine::test_result result = helper.run(hooks);
|
||||
|
||||
ATF_REQUIRE(engine::test_result::broken == result.type());
|
||||
ATF_REQUIRE_MATCH("Tester received signal.*bug", result.reason());
|
||||
|
||||
ATF_REQUIRE_EQ("stdout stuff\n", hooks.stdout_contents);
|
||||
ATF_REQUIRE_EQ("stderr stuff\n", hooks.stderr_contents);
|
||||
}
|
||||
|
||||
|
||||
ATF_TEST_CASE_WITHOUT_HEAD(run_test_case__atf__current_directory);
|
||||
ATF_TEST_CASE_BODY(run_test_case__atf__current_directory)
|
||||
{
|
||||
@@ -1064,6 +1105,8 @@ ATF_INIT_TEST_CASES(tcs)
|
||||
|
||||
ATF_ADD_TEST_CASE(tcs, test_case__output);
|
||||
|
||||
ATF_ADD_TEST_CASE(tcs, run_test_case__tester_crashes);
|
||||
|
||||
ATF_ADD_TEST_CASE(tcs, run_test_case__atf__current_directory);
|
||||
ATF_ADD_TEST_CASE(tcs, run_test_case__atf__subdirectory);
|
||||
ATF_ADD_TEST_CASE(tcs, run_test_case__atf__config_variables);
|
||||
|
||||
Reference in New Issue
Block a user