|
From: J. H. F. <jo...@gm...> - 2009-01-05 17:48:42
|
Hello,
How I can use the collector tool?
Example:
In file tests/assertion_tests.c we can end the file with:
TestSuite *assertion_tests() {
TestSuite *suite = create_test_suite();
add_tests(suite, ); // this is right? maybe add_tests(suite,
assertion_tests, );??
return suite;
}
Now we do:
src/collector tests/assertion_tests.c and we get this:
TestSuite *assertion_tests() {
TestSuite *suite = create_test_suite();
add_tests(suite, &integer_one_should_assert_true,
&integer_zero_should_assert_false, &one_should_assert_equal_to_one,
&zero_should_assert_not_equal_to_one,
&one_should_assert_long_equal_to_one,
&zero_should_assert_long_not_equal_to_one,
&one_should_assert_unsigned_long_equal_to_one,
&zero_should_assert_unsigned_long_not_equal_to_one,
&one_should_assert_long_long_equal_to_one,
&zero_should_assert_long_long_not_equal_to_one,
&one_should_assert_unsigned_long_long_equal_to_one,
&zero_should_assert_unsigned_long_long_not_equal_to_one,
&one_should_assert_short_equal_to_one,
&zero_should_assert_short_not_equal_to_one,
&one_should_assert_unsigned_short_equal_to_one,
&zero_should_assert_unsigned_short_not_equal_to_one,
&one_should_assert_char_equal_to_one,
&zero_should_assert_char_not_equal_to_one,
&one_should_assert_unsigned_char_equal_to_one,
&zero_should_assert_unsigned_char_not_equal_to_one,
&one_should_assert_float_equal_to_one,
&zero_should_assert_float_not_equal_to_one,
&one_should_assert_double_equal_to_one,
&zero_should_assert_double_not_equal_to_one,
&one_should_assert_long_double_equal_to_one,
&zero_should_assert_long_double_not_equal_to_one,
&double_differences_do_not_matter_past_significant_figures,
&double_differences_matter_past_significant_figures,
&double_assertions_can_have_custom_messages,
&identical_string_copies_should_match,
&case_different_strings_should_not_match,
&null_string_should_only_match_another_null_string,
&null_string_should_only_match_another_null_string_even_with_messages);
return suite;
Ok!, Currently the collector tool don't write the results in file
tests/assertion_tests.c. But we can simulate this:
src/collector tests/assertion_tests.c > tests/tmp.c
cp tests/tmp.c tests/assertion_tests.c
Now, run the tests/all_tests and we get:
Running "main"...
Exception!: parameter_tests -> -> Test "" failed to complete
Exception!: parameter_tests -> ▒�� -> Test "▒��" failed to complete
Exception!: parameter_tests -> 8_read_long_parameters_with_funky_names
-> Test "8_read_long_parameters_with_funky_names" failed to complete
Exception!: parameter_tests ->
�_read_two_parameters_with_varied_whitespace -> Test
"�_read_two_parameters_with_varied_whitespace" failed to complete
Exception!: parameter_tests ->
�_strip_box_double_to_leave_original_name -> Test
"�_strip_box_double_to_leave_original_name" failed to complete
Exception!: parameter_tests -> �_strip_d_macro_to_leave_original_name
-> Test "�_strip_d_macro_to_leave_original_name" failed to complete
Completed "main": 164 passes, 0 failures, 6 exceptions.
Something are wrong...
In TODO lists:
Collector
---------
Should write back to the same file when given a single file parameter,
stdout otherwise. <---------- I can do it.
Fix memory bug in slurp.c file. <----------- this works now.
Thanks
--
-----------------------------------------------------------
João Henrique Freitas - joaohf_at_gmail.com
Campinas-SP-Brasil
BSD051283
LPI 1
http://www.joaohfreitas.eti.br
|