Lines Matching +full:tcs +full:- +full:config

38 #include <atf-c++.hpp>
50 #include "utils/config/tree.ipp"
57 namespace config = utils::config;
70 atf::utils::create_file("config", "syntax(2)\n"); in ATF_TEST_CASE_BODY()
73 fs::path("config"), none, config::tree(), handle); in ATF_TEST_CASE_BODY()
88 "config", in ATF_TEST_CASE_BODY()
90 "test_suite('one-suite')\n" in ATF_TEST_CASE_BODY()
95 "include('dir/config')\n"); in ATF_TEST_CASE_BODY()
99 "dir/config", in ATF_TEST_CASE_BODY()
101 "atf_test_program{name='1st', test_suite='other-suite'}\n" in ATF_TEST_CASE_BODY()
102 "include('subdir/config')\n"); in ATF_TEST_CASE_BODY()
106 "dir/subdir/config", in ATF_TEST_CASE_BODY()
108 "atf_test_program{name='5th', test_suite='last-suite'}\n"); in ATF_TEST_CASE_BODY()
118 fs::path("config"), none, config::tree(), handle); in ATF_TEST_CASE_BODY()
123 ATF_REQUIRE_EQ("atf", suite.test_programs()[0]->interface_name()); in ATF_TEST_CASE_BODY()
124 ATF_REQUIRE_EQ(fs::path("1st"), suite.test_programs()[0]->relative_path()); in ATF_TEST_CASE_BODY()
125 ATF_REQUIRE_EQ("one-suite", suite.test_programs()[0]->test_suite_name()); in ATF_TEST_CASE_BODY()
127 ATF_REQUIRE_EQ("atf", suite.test_programs()[1]->interface_name()); in ATF_TEST_CASE_BODY()
128 ATF_REQUIRE_EQ(fs::path("2nd"), suite.test_programs()[1]->relative_path()); in ATF_TEST_CASE_BODY()
129 ATF_REQUIRE_EQ("first", suite.test_programs()[1]->test_suite_name()); in ATF_TEST_CASE_BODY()
131 ATF_REQUIRE_EQ("plain", suite.test_programs()[2]->interface_name()); in ATF_TEST_CASE_BODY()
132 ATF_REQUIRE_EQ(fs::path("3rd"), suite.test_programs()[2]->relative_path()); in ATF_TEST_CASE_BODY()
133 ATF_REQUIRE_EQ("one-suite", suite.test_programs()[2]->test_suite_name()); in ATF_TEST_CASE_BODY()
135 ATF_REQUIRE_EQ("tap", suite.test_programs()[3]->interface_name()); in ATF_TEST_CASE_BODY()
136 ATF_REQUIRE_EQ(fs::path("4th"), suite.test_programs()[3]->relative_path()); in ATF_TEST_CASE_BODY()
137 ATF_REQUIRE_EQ("second", suite.test_programs()[3]->test_suite_name()); in ATF_TEST_CASE_BODY()
139 ATF_REQUIRE_EQ("atf", suite.test_programs()[4]->interface_name()); in ATF_TEST_CASE_BODY()
141 suite.test_programs()[4]->relative_path()); in ATF_TEST_CASE_BODY()
142 ATF_REQUIRE_EQ("other-suite", suite.test_programs()[4]->test_suite_name()); in ATF_TEST_CASE_BODY()
144 ATF_REQUIRE_EQ("atf", suite.test_programs()[5]->interface_name()); in ATF_TEST_CASE_BODY()
146 suite.test_programs()[5]->relative_path()); in ATF_TEST_CASE_BODY()
147 ATF_REQUIRE_EQ("last-suite", suite.test_programs()[5]->test_suite_name()); in ATF_TEST_CASE_BODY()
166 "config", in ATF_TEST_CASE_BODY()
168 "test_suite('one-suite')\n" in ATF_TEST_CASE_BODY()
178 fs::path("config"), none, config::tree(), handle); in ATF_TEST_CASE_BODY()
183 ATF_REQUIRE_EQ("some", suite.test_programs()[0]->interface_name()); in ATF_TEST_CASE_BODY()
184 ATF_REQUIRE_EQ(fs::path("1st"), suite.test_programs()[0]->relative_path()); in ATF_TEST_CASE_BODY()
186 ATF_REQUIRE_EQ("random", suite.test_programs()[1]->interface_name()); in ATF_TEST_CASE_BODY()
187 ATF_REQUIRE_EQ(fs::path("2nd"), suite.test_programs()[1]->relative_path()); in ATF_TEST_CASE_BODY()
189 ATF_REQUIRE_EQ("names", suite.test_programs()[2]->interface_name()); in ATF_TEST_CASE_BODY()
190 ATF_REQUIRE_EQ(fs::path("3rd"), suite.test_programs()[2]->relative_path()); in ATF_TEST_CASE_BODY()
202 "config", in ATF_TEST_CASE_BODY()
208 " ['custom.a-number']=123, ['custom.a-bool']=true}\n"); in ATF_TEST_CASE_BODY()
213 fs::path("config"), none, config::tree(), handle); in ATF_TEST_CASE_BODY()
216 ATF_REQUIRE_EQ("atf", suite.test_programs()[0]->interface_name()); in ATF_TEST_CASE_BODY()
217 ATF_REQUIRE_EQ(fs::path("1st"), suite.test_programs()[0]->relative_path()); in ATF_TEST_CASE_BODY()
218 ATF_REQUIRE_EQ("first", suite.test_programs()[0]->test_suite_name()); in ATF_TEST_CASE_BODY()
224 ATF_REQUIRE_EQ(md1, suite.test_programs()[0]->get_metadata()); in ATF_TEST_CASE_BODY()
226 ATF_REQUIRE_EQ("plain", suite.test_programs()[1]->interface_name()); in ATF_TEST_CASE_BODY()
227 ATF_REQUIRE_EQ(fs::path("2nd"), suite.test_programs()[1]->relative_path()); in ATF_TEST_CASE_BODY()
228 ATF_REQUIRE_EQ("second", suite.test_programs()[1]->test_suite_name()); in ATF_TEST_CASE_BODY()
232 .add_custom("a-bool", "true") in ATF_TEST_CASE_BODY()
233 .add_custom("a-number", "123") in ATF_TEST_CASE_BODY()
236 ATF_REQUIRE_EQ(md2, suite.test_programs()[1]->get_metadata()); in ATF_TEST_CASE_BODY()
248 "config", in ATF_TEST_CASE_BODY()
263 fs::path("config"), none, config::tree(), handle); in ATF_TEST_CASE_BODY()
267 ATF_REQUIRE_EQ(fs::path("one"), suite.test_programs()[0]->relative_path()); in ATF_TEST_CASE_BODY()
268 ATF_REQUIRE_EQ("first", suite.test_programs()[0]->test_suite_name()); in ATF_TEST_CASE_BODY()
270 suite.test_programs()[1]->relative_path()); in ATF_TEST_CASE_BODY()
271 ATF_REQUIRE_EQ("second", suite.test_programs()[1]->test_suite_name()); in ATF_TEST_CASE_BODY()
284 "root/config", in ATF_TEST_CASE_BODY()
288 "include('dir/config')\n"); in ATF_TEST_CASE_BODY()
292 "root/dir/config", in ATF_TEST_CASE_BODY()
303 fs::path("root/config"), none, config::tree(), handle); in ATF_TEST_CASE_BODY()
307 ATF_REQUIRE_EQ(fs::path("one"), suite.test_programs()[0]->relative_path()); in ATF_TEST_CASE_BODY()
308 ATF_REQUIRE_EQ("abc", suite.test_programs()[0]->test_suite_name()); in ATF_TEST_CASE_BODY()
310 suite.test_programs()[1]->relative_path()); in ATF_TEST_CASE_BODY()
311 ATF_REQUIRE_EQ("def", suite.test_programs()[1]->test_suite_name()); in ATF_TEST_CASE_BODY()
313 suite.test_programs()[2]->relative_path()); in ATF_TEST_CASE_BODY()
314 ATF_REQUIRE_EQ("foo", suite.test_programs()[2]->test_suite_name()); in ATF_TEST_CASE_BODY()
327 "srcdir/config", in ATF_TEST_CASE_BODY()
331 "include('dir/config')\n"); in ATF_TEST_CASE_BODY()
335 "srcdir/dir/config", in ATF_TEST_CASE_BODY()
348 fs::path("srcdir/config"), utils::make_optional(fs::path("builddir")), in ATF_TEST_CASE_BODY()
349 config::tree(), handle); in ATF_TEST_CASE_BODY()
354 suite.test_programs()[0]->absolute_path()); in ATF_TEST_CASE_BODY()
355 ATF_REQUIRE_EQ(fs::path("one"), suite.test_programs()[0]->relative_path()); in ATF_TEST_CASE_BODY()
356 ATF_REQUIRE_EQ("abc", suite.test_programs()[0]->test_suite_name()); in ATF_TEST_CASE_BODY()
358 suite.test_programs()[1]->absolute_path()); in ATF_TEST_CASE_BODY()
360 suite.test_programs()[1]->relative_path()); in ATF_TEST_CASE_BODY()
361 ATF_REQUIRE_EQ("def", suite.test_programs()[1]->test_suite_name()); in ATF_TEST_CASE_BODY()
363 suite.test_programs()[2]->absolute_path()); in ATF_TEST_CASE_BODY()
365 suite.test_programs()[2]->relative_path()); in ATF_TEST_CASE_BODY()
366 ATF_REQUIRE_EQ("foo", suite.test_programs()[2]->test_suite_name()); in ATF_TEST_CASE_BODY()
378 "config", in ATF_TEST_CASE_BODY()
384 fs::path("config"), none, config::tree(), handle); in ATF_TEST_CASE_BODY()
390 ATF_REQUIRE(::chdir("other") != -1); in ATF_TEST_CASE_BODY()
396 suite.test_programs()[0]->absolute_path()); in ATF_TEST_CASE_BODY()
397 ATF_REQUIRE_EQ(fs::path("one"), suite.test_programs()[0]->relative_path()); in ATF_TEST_CASE_BODY()
398 ATF_REQUIRE_EQ("first", suite.test_programs()[0]->test_suite_name()); in ATF_TEST_CASE_BODY()
433 fs::path("Kyuafile"), none, config::tree(), handle); in ATF_TEST_CASE_BODY()
437 suite.test_programs()[0]->absolute_path()); in ATF_TEST_CASE_BODY()
439 suite.test_programs()[1]->absolute_path()); in ATF_TEST_CASE_BODY()
455 config::tree(), handle)); in do_load_error_test()
464 "config", in ATF_TEST_CASE_BODY()
471 do_load_error_test("config", "./ls.*path components"); in ATF_TEST_CASE_BODY()
478 atf::utils::create_file("config", "this syntax is invalid\n"); in ATF_TEST_CASE_BODY()
480 do_load_error_test("config", ".*"); in ATF_TEST_CASE_BODY()
487 atf::utils::create_file("config", ""); in ATF_TEST_CASE_BODY()
489 do_load_error_test("config", "syntax.* never called"); in ATF_TEST_CASE_BODY()
497 atf::utils::create_file("config", "syntax('foo', 1)\n"); in ATF_TEST_CASE_BODY()
498 do_load_error_test("config", "must be 'kyuafile'"); in ATF_TEST_CASE_BODY()
500 atf::utils::create_file("config", "syntax('config', 2)\n"); in ATF_TEST_CASE_BODY()
501 do_load_error_test("config", "only takes one argument"); in ATF_TEST_CASE_BODY()
509 "config", in ATF_TEST_CASE_BODY()
513 do_load_error_test("config", "Can only call syntax.* once"); in ATF_TEST_CASE_BODY()
520 atf::utils::create_file("config", "syntax(12)\n"); in ATF_TEST_CASE_BODY()
522 do_load_error_test("config", "Unsupported file version 12"); in ATF_TEST_CASE_BODY()
530 "config", in ATF_TEST_CASE_BODY()
536 do_load_error_test("config", "No test suite defined"); in ATF_TEST_CASE_BODY()
544 "config", in ATF_TEST_CASE_BODY()
549 do_load_error_test("config", "Can only call test_suite.* once"); in ATF_TEST_CASE_BODY()
564 "config", in ATF_TEST_CASE_BODY()
571 do_load_error_test("config", "Non-existent.*'two'"); in ATF_TEST_CASE_BODY()
575 ATF_INIT_TEST_CASES(tcs) in ATF_INIT_TEST_CASES() argument
587 ATF_ADD_TEST_CASE(tcs, kyuafile__load__empty); in ATF_INIT_TEST_CASES()
588 ATF_ADD_TEST_CASE(tcs, kyuafile__load__real_interfaces); in ATF_INIT_TEST_CASES()
589 ATF_ADD_TEST_CASE(tcs, kyuafile__load__mock_interfaces); in ATF_INIT_TEST_CASES()
590 ATF_ADD_TEST_CASE(tcs, kyuafile__load__metadata); in ATF_INIT_TEST_CASES()
591 ATF_ADD_TEST_CASE(tcs, kyuafile__load__current_directory); in ATF_INIT_TEST_CASES()
592 ATF_ADD_TEST_CASE(tcs, kyuafile__load__other_directory); in ATF_INIT_TEST_CASES()
593 ATF_ADD_TEST_CASE(tcs, kyuafile__load__build_directory); in ATF_INIT_TEST_CASES()
594 ATF_ADD_TEST_CASE(tcs, kyuafile__load__absolute_paths_are_stable); in ATF_INIT_TEST_CASES()
595 ATF_ADD_TEST_CASE(tcs, kyuafile__load__fs_calls_are_relative); in ATF_INIT_TEST_CASES()
596 ATF_ADD_TEST_CASE(tcs, kyuafile__load__test_program_not_basename); in ATF_INIT_TEST_CASES()
597 ATF_ADD_TEST_CASE(tcs, kyuafile__load__lua_error); in ATF_INIT_TEST_CASES()
598 ATF_ADD_TEST_CASE(tcs, kyuafile__load__syntax__not_called); in ATF_INIT_TEST_CASES()
599 ATF_ADD_TEST_CASE(tcs, kyuafile__load__syntax__deprecated_format); in ATF_INIT_TEST_CASES()
600 ATF_ADD_TEST_CASE(tcs, kyuafile__load__syntax__twice); in ATF_INIT_TEST_CASES()
601 ATF_ADD_TEST_CASE(tcs, kyuafile__load__syntax__bad_version); in ATF_INIT_TEST_CASES()
602 ATF_ADD_TEST_CASE(tcs, kyuafile__load__test_suite__missing); in ATF_INIT_TEST_CASES()
603 ATF_ADD_TEST_CASE(tcs, kyuafile__load__test_suite__twice); in ATF_INIT_TEST_CASES()
604 ATF_ADD_TEST_CASE(tcs, kyuafile__load__missing_file); in ATF_INIT_TEST_CASES()
605 ATF_ADD_TEST_CASE(tcs, kyuafile__load__missing_test_program); in ATF_INIT_TEST_CASES()