1 // Copyright (c) 2008 The NetBSD Foundation, Inc.
2 // All rights reserved.
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions
7 // 1. Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // 2. Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the
11 // documentation and/or other materials provided with the distribution.
13 // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
14 // CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
15 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 // IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
18 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
20 // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
22 // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
24 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #include "atf-c++/macros.hpp"
38 #include <atf-c++.hpp>
40 #include "atf-c++/detail/fs.hpp"
41 #include "atf-c++/detail/process.hpp"
42 #include "atf-c++/detail/sanity.hpp"
43 #include "atf-c++/detail/test_helpers.hpp"
44 #include "atf-c++/detail/text.hpp"
45 #include "atf-c++/utils.hpp"
47 // ------------------------------------------------------------------------
48 // Auxiliary functions.
49 // ------------------------------------------------------------------------
53 create_ctl_file(const char *name)
55 ATF_REQUIRE(open(name, O_CREAT | O_WRONLY | O_TRUNC, 0644) != -1);
58 // ------------------------------------------------------------------------
59 // Auxiliary test cases.
60 // ------------------------------------------------------------------------
62 ATF_TEST_CASE(h_pass);
63 ATF_TEST_CASE_HEAD(h_pass)
65 set_md_var("descr", "Helper test case");
67 ATF_TEST_CASE_BODY(h_pass)
69 create_ctl_file("before");
71 create_ctl_file("after");
74 ATF_TEST_CASE(h_fail);
75 ATF_TEST_CASE_HEAD(h_fail)
77 set_md_var("descr", "Helper test case");
79 ATF_TEST_CASE_BODY(h_fail)
81 create_ctl_file("before");
82 ATF_FAIL("Failed on purpose");
83 create_ctl_file("after");
86 ATF_TEST_CASE(h_skip);
87 ATF_TEST_CASE_HEAD(h_skip)
89 set_md_var("descr", "Helper test case");
91 ATF_TEST_CASE_BODY(h_skip)
93 create_ctl_file("before");
94 ATF_SKIP("Skipped on purpose");
95 create_ctl_file("after");
98 ATF_TEST_CASE(h_require);
99 ATF_TEST_CASE_HEAD(h_require)
101 set_md_var("descr", "Helper test case");
103 ATF_TEST_CASE_BODY(h_require)
105 bool condition = atf::text::to_bool(get_config_var("condition"));
107 create_ctl_file("before");
108 ATF_REQUIRE(condition);
109 create_ctl_file("after");
112 ATF_TEST_CASE(h_require_eq);
113 ATF_TEST_CASE_HEAD(h_require_eq)
115 set_md_var("descr", "Helper test case");
117 ATF_TEST_CASE_BODY(h_require_eq)
119 long v1 = atf::text::to_type< long >(get_config_var("v1"));
120 long v2 = atf::text::to_type< long >(get_config_var("v2"));
122 create_ctl_file("before");
123 ATF_REQUIRE_EQ(v1, v2);
124 create_ctl_file("after");
127 ATF_TEST_CASE(h_require_in);
128 ATF_TEST_CASE_HEAD(h_require_in)
130 set_md_var("descr", "Helper test case");
132 ATF_TEST_CASE_BODY(h_require_in)
134 const std::string element = get_config_var("value");
136 std::set< std::string > collection;
137 collection.insert("foo");
138 collection.insert("bar");
139 collection.insert("baz");
141 create_ctl_file("before");
142 ATF_REQUIRE_IN(element, collection);
143 create_ctl_file("after");
146 ATF_TEST_CASE(h_require_match);
147 ATF_TEST_CASE_HEAD(h_require_match)
149 set_md_var("descr", "Helper test case");
151 ATF_TEST_CASE_BODY(h_require_match)
153 const std::string regexp = get_config_var("regexp");
154 const std::string string = get_config_var("string");
156 create_ctl_file("before");
157 ATF_REQUIRE_MATCH(regexp, string);
158 create_ctl_file("after");
161 ATF_TEST_CASE(h_require_not_in);
162 ATF_TEST_CASE_HEAD(h_require_not_in)
164 set_md_var("descr", "Helper test case");
166 ATF_TEST_CASE_BODY(h_require_not_in)
168 const std::string element = get_config_var("value");
170 std::set< std::string > collection;
171 collection.insert("foo");
172 collection.insert("bar");
173 collection.insert("baz");
175 create_ctl_file("before");
176 ATF_REQUIRE_NOT_IN(element, collection);
177 create_ctl_file("after");
180 ATF_TEST_CASE(h_require_throw);
181 ATF_TEST_CASE_HEAD(h_require_throw)
183 set_md_var("descr", "Helper test case");
185 ATF_TEST_CASE_BODY(h_require_throw)
187 create_ctl_file("before");
189 if (get_config_var("what") == "throw_int")
190 ATF_REQUIRE_THROW(std::runtime_error, if (1) throw int(5));
191 else if (get_config_var("what") == "throw_rt")
192 ATF_REQUIRE_THROW(std::runtime_error,
193 if (1) throw std::runtime_error("e"));
194 else if (get_config_var("what") == "no_throw_rt")
195 ATF_REQUIRE_THROW(std::runtime_error,
196 if (0) throw std::runtime_error("e"));
198 create_ctl_file("after");
201 ATF_TEST_CASE(h_require_throw_re);
202 ATF_TEST_CASE_HEAD(h_require_throw_re)
204 set_md_var("descr", "Helper test case");
206 ATF_TEST_CASE_BODY(h_require_throw_re)
208 create_ctl_file("before");
210 if (get_config_var("what") == "throw_int")
211 ATF_REQUIRE_THROW_RE(std::runtime_error, "5", if (1) throw int(5));
212 else if (get_config_var("what") == "throw_rt_match")
213 ATF_REQUIRE_THROW_RE(std::runtime_error, "foo.*baz",
214 if (1) throw std::runtime_error("a foo bar baz"));
215 else if (get_config_var("what") == "throw_rt_no_match")
216 ATF_REQUIRE_THROW_RE(std::runtime_error, "foo.*baz",
217 if (1) throw std::runtime_error("baz foo bar a"));
218 else if (get_config_var("what") == "no_throw_rt")
219 ATF_REQUIRE_THROW_RE(std::runtime_error, "e",
220 if (0) throw std::runtime_error("e"));
222 create_ctl_file("after");
226 errno_fail_stub(const int raised_errno)
228 errno = raised_errno;
238 ATF_TEST_CASE(h_check_errno);
239 ATF_TEST_CASE_HEAD(h_check_errno)
241 set_md_var("descr", "Helper test case");
243 ATF_TEST_CASE_BODY(h_check_errno)
245 create_ctl_file("before");
247 if (get_config_var("what") == "no_error")
248 ATF_CHECK_ERRNO(-1, errno_ok_stub() == -1);
249 else if (get_config_var("what") == "errno_ok")
250 ATF_CHECK_ERRNO(2, errno_fail_stub(2) == -1);
251 else if (get_config_var("what") == "errno_fail")
252 ATF_CHECK_ERRNO(3, errno_fail_stub(4) == -1);
256 create_ctl_file("after");
259 ATF_TEST_CASE(h_require_errno);
260 ATF_TEST_CASE_HEAD(h_require_errno)
262 set_md_var("descr", "Helper test case");
264 ATF_TEST_CASE_BODY(h_require_errno)
266 create_ctl_file("before");
268 if (get_config_var("what") == "no_error")
269 ATF_REQUIRE_ERRNO(-1, errno_ok_stub() == -1);
270 else if (get_config_var("what") == "errno_ok")
271 ATF_REQUIRE_ERRNO(2, errno_fail_stub(2) == -1);
272 else if (get_config_var("what") == "errno_fail")
273 ATF_REQUIRE_ERRNO(3, errno_fail_stub(4) == -1);
277 create_ctl_file("after");
280 // ------------------------------------------------------------------------
281 // Test cases for the macros.
282 // ------------------------------------------------------------------------
285 ATF_TEST_CASE_HEAD(pass)
287 set_md_var("descr", "Tests the ATF_PASS macro");
289 ATF_TEST_CASE_BODY(pass)
291 ATF_TEST_CASE_USE(h_pass);
292 run_h_tc< ATF_TEST_CASE_NAME(h_pass) >();
293 ATF_REQUIRE(atf::utils::grep_file("^passed", "result"));
294 ATF_REQUIRE(atf::fs::exists(atf::fs::path("before")));
295 ATF_REQUIRE(!atf::fs::exists(atf::fs::path("after")));
299 ATF_TEST_CASE_HEAD(fail)
301 set_md_var("descr", "Tests the ATF_FAIL macro");
303 ATF_TEST_CASE_BODY(fail)
305 ATF_TEST_CASE_USE(h_fail);
306 run_h_tc< ATF_TEST_CASE_NAME(h_fail) >();
307 ATF_REQUIRE(atf::utils::grep_file("^failed: Failed on purpose", "result"));
308 ATF_REQUIRE(atf::fs::exists(atf::fs::path("before")));
309 ATF_REQUIRE(!atf::fs::exists(atf::fs::path("after")));
313 ATF_TEST_CASE_HEAD(skip)
315 set_md_var("descr", "Tests the ATF_SKIP macro");
317 ATF_TEST_CASE_BODY(skip)
319 ATF_TEST_CASE_USE(h_skip);
320 run_h_tc< ATF_TEST_CASE_NAME(h_skip) >();
321 ATF_REQUIRE(atf::utils::grep_file("^skipped: Skipped on purpose",
323 ATF_REQUIRE(atf::fs::exists(atf::fs::path("before")));
324 ATF_REQUIRE(!atf::fs::exists(atf::fs::path("after")));
327 ATF_TEST_CASE(require);
328 ATF_TEST_CASE_HEAD(require)
330 set_md_var("descr", "Tests the ATF_REQUIRE macro");
332 ATF_TEST_CASE_BODY(require)
343 const atf::fs::path before("before");
344 const atf::fs::path after("after");
346 for (t = &tests[0]; t->cond != NULL; t++) {
347 atf::tests::vars_map config;
348 config["condition"] = t->cond;
350 std::cout << "Checking with a " << t->cond << " value\n";
352 ATF_TEST_CASE_USE(h_require);
353 run_h_tc< ATF_TEST_CASE_NAME(h_require) >(config);
355 ATF_REQUIRE(atf::fs::exists(before));
357 ATF_REQUIRE(atf::utils::grep_file("^passed", "result"));
358 ATF_REQUIRE(atf::fs::exists(after));
360 ATF_REQUIRE(atf::utils::grep_file(
361 "^failed: .*condition not met", "result"));
362 ATF_REQUIRE(!atf::fs::exists(after));
365 atf::fs::remove(before);
367 atf::fs::remove(after);
371 ATF_TEST_CASE(require_eq);
372 ATF_TEST_CASE_HEAD(require_eq)
374 set_md_var("descr", "Tests the ATF_REQUIRE_EQ macro");
376 ATF_TEST_CASE_BODY(require_eq)
387 { NULL, NULL, false }
390 const atf::fs::path before("before");
391 const atf::fs::path after("after");
393 for (t = &tests[0]; t->v1 != NULL; t++) {
394 atf::tests::vars_map config;
395 config["v1"] = t->v1;
396 config["v2"] = t->v2;
398 std::cout << "Checking with " << t->v1 << ", " << t->v2
399 << " and expecting " << (t->ok ? "true" : "false")
402 ATF_TEST_CASE_USE(h_require_eq);
403 run_h_tc< ATF_TEST_CASE_NAME(h_require_eq) >(config);
405 ATF_REQUIRE(atf::fs::exists(before));
407 ATF_REQUIRE(atf::utils::grep_file("^passed", "result"));
408 ATF_REQUIRE(atf::fs::exists(after));
410 ATF_REQUIRE(atf::utils::grep_file("^failed: .*v1 != v2", "result"));
411 ATF_REQUIRE(!atf::fs::exists(after));
414 atf::fs::remove(before);
416 atf::fs::remove(after);
420 ATF_TEST_CASE(require_in);
421 ATF_TEST_CASE_HEAD(require_in)
423 set_md_var("descr", "Tests the ATF_REQUIRE_IN macro");
425 ATF_TEST_CASE_BODY(require_in)
440 const atf::fs::path before("before");
441 const atf::fs::path after("after");
443 for (t = &tests[0]; t->value != NULL; t++) {
444 atf::tests::vars_map config;
445 config["value"] = t->value;
447 ATF_TEST_CASE_USE(h_require_in);
448 run_h_tc< ATF_TEST_CASE_NAME(h_require_in) >(config);
450 ATF_REQUIRE(atf::fs::exists(before));
452 ATF_REQUIRE(atf::utils::grep_file("^passed", "result"));
453 ATF_REQUIRE(atf::fs::exists(after));
455 ATF_REQUIRE(atf::utils::grep_file("^failed: ", "result"));
456 ATF_REQUIRE(!atf::fs::exists(after));
459 atf::fs::remove(before);
461 atf::fs::remove(after);
465 ATF_TEST_CASE(require_match);
466 ATF_TEST_CASE_HEAD(require_match)
468 set_md_var("descr", "Tests the ATF_REQUIRE_MATCH macro");
470 ATF_TEST_CASE_BODY(require_match)
477 { "foo.*bar", "this is a foo, bar, baz", true },
478 { "bar.*baz", "this is a baz, bar, foo", false },
479 { NULL, NULL, false }
482 const atf::fs::path before("before");
483 const atf::fs::path after("after");
485 for (t = &tests[0]; t->regexp != NULL; t++) {
486 atf::tests::vars_map config;
487 config["regexp"] = t->regexp;
488 config["string"] = t->string;
490 std::cout << "Checking with " << t->regexp << ", " << t->string
491 << " and expecting " << (t->ok ? "true" : "false")
494 ATF_TEST_CASE_USE(h_require_match);
495 run_h_tc< ATF_TEST_CASE_NAME(h_require_match) >(config);
497 ATF_REQUIRE(atf::fs::exists(before));
499 ATF_REQUIRE(atf::utils::grep_file("^passed", "result"));
500 ATF_REQUIRE(atf::fs::exists(after));
502 ATF_REQUIRE(atf::utils::grep_file("^failed: ", "result"));
503 ATF_REQUIRE(!atf::fs::exists(after));
506 atf::fs::remove(before);
508 atf::fs::remove(after);
512 ATF_TEST_CASE(require_not_in);
513 ATF_TEST_CASE_HEAD(require_not_in)
515 set_md_var("descr", "Tests the ATF_REQUIRE_NOT_IN macro");
517 ATF_TEST_CASE_BODY(require_not_in)
532 const atf::fs::path before("before");
533 const atf::fs::path after("after");
535 for (t = &tests[0]; t->value != NULL; t++) {
536 atf::tests::vars_map config;
537 config["value"] = t->value;
539 ATF_TEST_CASE_USE(h_require_not_in);
540 run_h_tc< ATF_TEST_CASE_NAME(h_require_not_in) >(config);
542 ATF_REQUIRE(atf::fs::exists(before));
544 ATF_REQUIRE(atf::utils::grep_file("^passed", "result"));
545 ATF_REQUIRE(atf::fs::exists(after));
547 ATF_REQUIRE(atf::utils::grep_file("^failed: ", "result"));
548 ATF_REQUIRE(!atf::fs::exists(after));
551 atf::fs::remove(before);
553 atf::fs::remove(after);
557 ATF_TEST_CASE(require_throw);
558 ATF_TEST_CASE_HEAD(require_throw)
560 set_md_var("descr", "Tests the ATF_REQUIRE_THROW macro");
562 ATF_TEST_CASE_BODY(require_throw)
569 { "throw_int", false, "unexpected error" },
570 { "throw_rt", true, NULL },
571 { "no_throw_rt", false, "did not throw" },
572 { NULL, false, NULL }
575 const atf::fs::path before("before");
576 const atf::fs::path after("after");
578 for (t = &tests[0]; t->what != NULL; t++) {
579 atf::tests::vars_map config;
580 config["what"] = t->what;
582 std::cout << "Checking with " << t->what << " and expecting "
583 << (t->ok ? "true" : "false") << "\n";
585 ATF_TEST_CASE_USE(h_require_throw);
586 run_h_tc< ATF_TEST_CASE_NAME(h_require_throw) >(config);
588 ATF_REQUIRE(atf::fs::exists(before));
590 ATF_REQUIRE(atf::utils::grep_file("^passed", "result"));
591 ATF_REQUIRE(atf::fs::exists(after));
593 std::cout << "Checking that message contains '" << t->msg
595 std::string exp_result = std::string("^failed: .*") + t->msg;
596 ATF_REQUIRE(atf::utils::grep_file(exp_result.c_str(), "result"));
597 ATF_REQUIRE(!atf::fs::exists(after));
600 atf::fs::remove(before);
602 atf::fs::remove(after);
606 ATF_TEST_CASE(require_throw_re);
607 ATF_TEST_CASE_HEAD(require_throw_re)
609 set_md_var("descr", "Tests the ATF_REQUIRE_THROW_RE macro");
611 ATF_TEST_CASE_BODY(require_throw_re)
618 { "throw_int", false, "unexpected error" },
619 { "throw_rt_match", true, NULL },
620 { "throw_rt_no_match", false,
621 "threw.*runtime_error\\(baz foo bar a\\).*"
622 "does not match 'foo\\.\\*baz'" },
623 { "no_throw_rt", false, "did not throw" },
624 { NULL, false, NULL }
627 const atf::fs::path before("before");
628 const atf::fs::path after("after");
630 for (t = &tests[0]; t->what != NULL; t++) {
631 atf::tests::vars_map config;
632 config["what"] = t->what;
634 std::cout << "Checking with " << t->what << " and expecting "
635 << (t->ok ? "true" : "false") << "\n";
637 ATF_TEST_CASE_USE(h_require_throw_re);
638 run_h_tc< ATF_TEST_CASE_NAME(h_require_throw_re) >(config);
640 ATF_REQUIRE(atf::fs::exists(before));
642 ATF_REQUIRE(atf::utils::grep_file("^passed", "result"));
643 ATF_REQUIRE(atf::fs::exists(after));
645 std::cout << "Checking that message contains '" << t->msg
647 std::string exp_result = std::string("^failed: .*") + t->msg;
648 ATF_REQUIRE(atf::utils::grep_file(exp_result.c_str(), "result"));
649 ATF_REQUIRE(!atf::fs::exists(after));
652 atf::fs::remove(before);
654 atf::fs::remove(after);
658 ATF_TEST_CASE(check_errno);
659 ATF_TEST_CASE_HEAD(check_errno)
661 set_md_var("descr", "Tests the ATF_CHECK_ERRNO macro");
663 ATF_TEST_CASE_BODY(check_errno)
671 "Expected true value in errno_ok_stub\\(\\) == -1" },
672 { "errno_ok", true, NULL },
673 { "errno_fail", false,
674 "Expected errno 3, got 4, in errno_fail_stub\\(4\\) == -1" },
675 { NULL, false, NULL }
678 const atf::fs::path before("before");
679 const atf::fs::path after("after");
681 for (t = &tests[0]; t->what != NULL; t++) {
682 atf::tests::vars_map config;
683 config["what"] = t->what;
685 ATF_TEST_CASE_USE(h_check_errno);
686 run_h_tc< ATF_TEST_CASE_NAME(h_check_errno) >(config);
688 ATF_REQUIRE(atf::fs::exists(before));
689 ATF_REQUIRE(atf::fs::exists(after));
692 ATF_REQUIRE(atf::utils::grep_file("^passed", "result"));
694 ATF_REQUIRE(atf::utils::grep_file("^failed", "result"));
696 std::string exp_result = "macros_test.cpp:[0-9]+: " +
697 std::string(t->msg) + "$";
698 ATF_REQUIRE(atf::utils::grep_file(exp_result.c_str(), "stderr"));
701 atf::fs::remove(before);
702 atf::fs::remove(after);
706 ATF_TEST_CASE(require_errno);
707 ATF_TEST_CASE_HEAD(require_errno)
709 set_md_var("descr", "Tests the ATF_REQUIRE_ERRNO macro");
711 ATF_TEST_CASE_BODY(require_errno)
719 "Expected true value in errno_ok_stub\\(\\) == -1" },
720 { "errno_ok", true, NULL },
721 { "errno_fail", false,
722 "Expected errno 3, got 4, in errno_fail_stub\\(4\\) == -1" },
723 { NULL, false, NULL }
726 const atf::fs::path before("before");
727 const atf::fs::path after("after");
729 for (t = &tests[0]; t->what != NULL; t++) {
730 atf::tests::vars_map config;
731 config["what"] = t->what;
733 ATF_TEST_CASE_USE(h_require_errno);
734 run_h_tc< ATF_TEST_CASE_NAME(h_require_errno) >(config);
736 ATF_REQUIRE(atf::fs::exists(before));
738 ATF_REQUIRE(atf::utils::grep_file("^passed", "result"));
739 ATF_REQUIRE(atf::fs::exists(after));
741 std::string exp_result = "^failed: .*macros_test.cpp:[0-9]+: " +
742 std::string(t->msg) + "$";
743 ATF_REQUIRE(atf::utils::grep_file(exp_result.c_str(), "result"));
745 ATF_REQUIRE(!atf::fs::exists(after));
748 atf::fs::remove(before);
750 atf::fs::remove(after);
754 // ------------------------------------------------------------------------
755 // Tests cases for the header file.
756 // ------------------------------------------------------------------------
758 BUILD_TC(use, "macros_hpp_test.cpp",
759 "Tests that the macros provided by the atf-c++/macros.hpp file "
760 "do not cause syntax errors when used",
761 "Build of macros_hpp_test.cpp failed; some macros in "
762 "atf-c++/macros.hpp are broken");
764 ATF_TEST_CASE(detect_unused_tests);
765 ATF_TEST_CASE_HEAD(detect_unused_tests)
768 "Tests that defining an unused test case raises a warning (and "
771 ATF_TEST_CASE_BODY(detect_unused_tests)
773 const char* validate_compiler =
774 "class test_class { public: int dummy; };\n"
775 "#define define_unused static test_class unused\n"
778 atf::utils::create_file("compiler_test.cpp", validate_compiler);
779 if (build_check_cxx_o("compiler_test.cpp"))
780 expect_fail("Compiler does not raise a warning on an unused "
781 "static global variable declared by a macro");
783 if (build_check_cxx_o_srcdir(*this, "unused_test.cpp"))
784 ATF_FAIL("Build of unused_test.cpp passed; unused test cases are "
785 "not properly detected");
788 // ------------------------------------------------------------------------
790 // ------------------------------------------------------------------------
792 ATF_INIT_TEST_CASES(tcs)
794 // Add the test cases for the macros.
795 ATF_ADD_TEST_CASE(tcs, pass);
796 ATF_ADD_TEST_CASE(tcs, fail);
797 ATF_ADD_TEST_CASE(tcs, skip);
798 ATF_ADD_TEST_CASE(tcs, check_errno);
799 ATF_ADD_TEST_CASE(tcs, require);
800 ATF_ADD_TEST_CASE(tcs, require_eq);
801 ATF_ADD_TEST_CASE(tcs, require_in);
802 ATF_ADD_TEST_CASE(tcs, require_match);
803 ATF_ADD_TEST_CASE(tcs, require_not_in);
804 ATF_ADD_TEST_CASE(tcs, require_throw);
805 ATF_ADD_TEST_CASE(tcs, require_throw_re);
806 ATF_ADD_TEST_CASE(tcs, require_errno);
808 // Add the test cases for the header file.
809 ATF_ADD_TEST_CASE(tcs, use);
810 ATF_ADD_TEST_CASE(tcs, detect_unused_tests);