Skip to content

Commit

Permalink
Remove test-programs/fork_test
Browse files Browse the repository at this point in the history
Actually... follow up on change 6399886
by just removing the test-programs/fork_test tests altogether.  They
don't make sense any more because test programs don't fork to run their
test cases... and the stop test in the fork_test program was tricky to
get right for some reason.

While doing this, remove some related garbage from the test-programs
directory as well.
  • Loading branch information
jmmv committed Feb 14, 2013
1 parent 03559ce commit 65d7020
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 182 deletions.
1 change: 0 additions & 1 deletion test-programs/Atffile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ prop: test-suite = atf

tp: config_test
tp: expect_test
tp: fork_test
tp: meta_data_test
tp: srcdir_test
tp: result_test
1 change: 0 additions & 1 deletion test-programs/Kyuafile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ test_suite("atf")

atf_test_program{name="config_test"}
atf_test_program{name="expect_test"}
atf_test_program{name="fork_test"}
atf_test_program{name="meta_data_test"}
atf_test_program{name="srcdir_test"}
atf_test_program{name="result_test"}
8 changes: 0 additions & 8 deletions test-programs/Makefile.am.inc
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ test-programs/expect_test: $(srcdir)/test-programs/expect_test.sh
@src="$(srcdir)/test-programs/expect_test.sh $(common_sh)"; \
dst="test-programs/expect_test"; $(BUILD_SH_TP)

tests_test_programs_SCRIPTS += test-programs/fork_test
CLEANFILES += test-programs/fork_test
EXTRA_DIST += test-programs/fork_test.sh
test-programs/fork_test: $(srcdir)/test-programs/fork_test.sh
test -d test-programs || mkdir -p test-programs
@src="$(srcdir)/test-programs/fork_test.sh $(common_sh)"; \
dst="test-programs/fork_test"; $(BUILD_SH_TP)

tests_test_programs_SCRIPTS += test-programs/meta_data_test
CLEANFILES += test-programs/meta_data_test
EXTRA_DIST += test-programs/meta_data_test.sh
Expand Down
46 changes: 0 additions & 46 deletions test-programs/c_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,6 @@ ATF_TC_CLEANUP(cleanup_sigterm, tc)
safe_remove(atf_tc_get_config_var(tc, "tmpfile"));
}

ATF_TC_WITH_CLEANUP(cleanup_fork);
ATF_TC_HEAD(cleanup_fork, tc)
{
atf_tc_set_md_var(tc, "descr", "Helper test case for the t_cleanup test "
"program");
}
ATF_TC_BODY(cleanup_fork, tc)
{
}
ATF_TC_CLEANUP(cleanup_fork, tc)
{
close(STDOUT_FILENO);
close(STDERR_FILENO);
close(3);
}

/* ---------------------------------------------------------------------
* Helper tests for "t_config".
* --------------------------------------------------------------------- */
Expand Down Expand Up @@ -385,32 +369,6 @@ ATF_TC_BODY(expect_timeout_but_pass, tc)
atf_tc_expect_timeout("Will just exit");
}

/* ---------------------------------------------------------------------
* Helper tests for "t_fork".
* --------------------------------------------------------------------- */

ATF_TC(fork_stop);
ATF_TC_HEAD(fork_stop, tc)
{
atf_tc_set_md_var(tc, "descr", "Helper test case for the t_fork test "
"program");
}
ATF_TC_BODY(fork_stop, tc)
{
const char *dfstr, *rfstr;

dfstr = atf_tc_get_config_var(tc, "donefile");
rfstr = atf_tc_get_config_var(tc, "runfile");

atf_utils_create_file(rfstr, "%s", "");
printf("Wrote runfile\n");

printf("Waiting for done file\n");
while (access(dfstr, F_OK) != 0)
usleep(10000);
printf("Exiting\n");
}

/* ---------------------------------------------------------------------
* Helper tests for "t_meta_data".
* --------------------------------------------------------------------- */
Expand Down Expand Up @@ -506,7 +464,6 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, cleanup_skip);
ATF_TP_ADD_TC(tp, cleanup_curdir);
ATF_TP_ADD_TC(tp, cleanup_sigterm);
ATF_TP_ADD_TC(tp, cleanup_fork);

/* Add helper tests for t_config. */
ATF_TP_ADD_TC(tp, config_unset);
Expand All @@ -533,9 +490,6 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, expect_timeout_and_hang);
ATF_TP_ADD_TC(tp, expect_timeout_but_pass);

/* Add helper tests for t_fork. */
ATF_TP_ADD_TC(tp, fork_stop);

/* Add helper tests for t_meta_data. */
ATF_TP_ADD_TC(tp, metadata_no_descr);
ATF_TP_ADD_TC(tp, metadata_no_head);
Expand Down
22 changes: 0 additions & 22 deletions test-programs/cpp_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,25 +224,6 @@ ATF_TEST_CASE_BODY(expect_timeout_but_pass)
expect_timeout("Will just exit");
}

// ------------------------------------------------------------------------
// Helper tests for "t_fork".
// ------------------------------------------------------------------------

ATF_TEST_CASE(fork_stop);
ATF_TEST_CASE_HEAD(fork_stop)
{
set_md_var("descr", "Helper test case for the t_fork test program");
}
ATF_TEST_CASE_BODY(fork_stop)
{
atf::utils::create_file(get_config_var("runfile"), "");
std::cout << "Wrote runfile\n";
std::cout << "Waiting for done file\n";
while (::access(get_config_var("donefile").c_str(), F_OK) != 0)
::usleep(10000);
std::cout << "Exiting\n";
}

// ------------------------------------------------------------------------
// Helper tests for "t_meta_data".
// ------------------------------------------------------------------------
Expand Down Expand Up @@ -361,9 +342,6 @@ ATF_INIT_TEST_CASES(tcs)
ATF_ADD_TEST_CASE(tcs, expect_timeout_and_hang);
ATF_ADD_TEST_CASE(tcs, expect_timeout_but_pass);

// Add helper tests for t_fork.
ATF_ADD_TEST_CASE(tcs, fork_stop);

// Add helper tests for t_meta_data.
ATF_ADD_TEST_CASE(tcs, metadata_no_descr);
ATF_ADD_TEST_CASE(tcs, metadata_no_head);
Expand Down
65 changes: 0 additions & 65 deletions test-programs/fork_test.sh

This file was deleted.

39 changes: 0 additions & 39 deletions test-programs/sh_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,6 @@ cleanup_sigterm_cleanup()
rm $(atf_config_get tmpfile)
}

atf_test_case cleanup_fork cleanup
cleanup_fork_head()
{
atf_set "descr" "Helper test case for the t_cleanup test program"
}
cleanup_fork_body()
{
:
}
cleanup_fork_cleanup()
{
exec 1>out
exec 2>err
exec 3>res
rm -f out err res
}

# -------------------------------------------------------------------------
# Helper tests for "t_config".
# -------------------------------------------------------------------------
Expand Down Expand Up @@ -174,24 +157,6 @@ config_multi_value_body()
atf_check_equal "$(atf_config_get 'test')" "foo bar"
}

# -------------------------------------------------------------------------
# Helper tests for "t_fork".
# -------------------------------------------------------------------------

atf_test_case fork_stop
fork_stop_head()
{
atf_set "descr" "Helper test case for the t_fork test program"
}
fork_stop_body()
{
echo >$(atf_config_get runfile)
echo "Wrote runfile"
echo "Waiting for done file"
while ! test -f $(atf_config_get donefile); do sleep 1; done
echo "Exiting"
}

# -------------------------------------------------------------------------
# Helper tests for "t_expect".
# -------------------------------------------------------------------------
Expand Down Expand Up @@ -387,7 +352,6 @@ atf_init_test_cases()
atf_add_test_case cleanup_skip
atf_add_test_case cleanup_curdir
atf_add_test_case cleanup_sigterm
atf_add_test_case cleanup_fork

# Add helper tests for t_config.
atf_add_test_case config_unset
Expand All @@ -414,9 +378,6 @@ atf_init_test_cases()
atf_add_test_case expect_timeout_and_hang
atf_add_test_case expect_timeout_but_pass

# Add helper tests for t_fork.
atf_add_test_case fork_stop

# Add helper tests for t_meta_data.
atf_add_test_case metadata_no_descr
atf_add_test_case metadata_no_head
Expand Down

0 comments on commit 65d7020

Please sign in to comment.