Lines Matching +full:tcs +full:- +full:config
29 #include "utils/config/parser.hpp"
33 #include <atf-c++.hpp>
35 #include "utils/config/exceptions.hpp"
36 #include "utils/config/parser.hpp"
37 #include "utils/config/tree.ipp"
41 namespace config = utils::config;
49 class mock_parser : public config::parser {
56 setup(config::tree& tree, const int syntax_version) in setup()
61 tree.define< config::string_node >("top_string"); in setup()
62 tree.define< config::int_node >("inner.int"); in setup()
73 /// \param tree The mock config tree to parse.
74 mock_parser(config::tree& tree) : in mock_parser()
75 config::parser(tree) in mock_parser()
92 config::tree tree; in ATF_TEST_CASE_BODY()
94 ATF_REQUIRE_THROW(config::unknown_key_error, in ATF_TEST_CASE_BODY()
95 tree.lookup< config::string_node >("foo")); in ATF_TEST_CASE_BODY()
107 config::tree tree; in ATF_TEST_CASE_BODY()
108 ATF_REQUIRE_THROW_RE(config::syntax_error, "foo", in ATF_TEST_CASE_BODY()
124 config::tree tree; in ATF_TEST_CASE_BODY()
126 ATF_REQUIRE_EQ("foo", tree.lookup< config::string_node >("top_string")); in ATF_TEST_CASE_BODY()
127 ATF_REQUIRE_EQ(12345, tree.lookup< config::int_node >("inner.int")); in ATF_TEST_CASE_BODY()
129 tree.lookup< config::string_node >("inner.dynamic.foo")); in ATF_TEST_CASE_BODY()
131 tree.lookup< config::string_node >("inner.dynamic.bar")); in ATF_TEST_CASE_BODY()
145 config::tree tree(false); in ATF_TEST_CASE_BODY()
147 ATF_REQUIRE_EQ("baz", tree.lookup< config::string_node >("top_string")); in ATF_TEST_CASE_BODY()
159 config::tree tree1; in ATF_TEST_CASE_BODY()
160 ATF_REQUIRE_THROW_RE(config::syntax_error, in ATF_TEST_CASE_BODY()
168 config::tree tree2; in ATF_TEST_CASE_BODY()
169 ATF_REQUIRE_THROW_RE(config::syntax_error, in ATF_TEST_CASE_BODY()
178 config::tree tree; in ATF_TEST_CASE_BODY()
181 ATF_REQUIRE_THROW_RE(config::syntax_error, in ATF_TEST_CASE_BODY()
190 config::tree tree; in ATF_TEST_CASE_BODY()
192 atf::utils::create_file("output.lua", "syntax('config', 1)\n"); in ATF_TEST_CASE_BODY()
196 ATF_REQUIRE_THROW_RE(config::syntax_error, "must be 'config'", in ATF_TEST_CASE_BODY()
199 atf::utils::create_file("output.lua", "syntax('config', 2)\n"); in ATF_TEST_CASE_BODY()
200 ATF_REQUIRE_THROW_RE(config::syntax_error, "only takes one argument", in ATF_TEST_CASE_BODY()
208 config::tree tree; in ATF_TEST_CASE_BODY()
209 tree.define< config::int_node >("var"); in ATF_TEST_CASE_BODY()
212 ATF_REQUIRE_THROW_RE(config::syntax_error, "No syntax defined", in ATF_TEST_CASE_BODY()
222 config::tree tree; in ATF_TEST_CASE_BODY()
223 tree.define< config::int_node >("var"); in ATF_TEST_CASE_BODY()
231 ATF_REQUIRE_THROW_RE(config::syntax_error, in ATF_TEST_CASE_BODY()
235 ATF_REQUIRE_EQ(3, tree.lookup< config::int_node >("var")); in ATF_TEST_CASE_BODY()
239 ATF_INIT_TEST_CASES(tcs) in ATF_INIT_TEST_CASES() argument
241 ATF_ADD_TEST_CASE(tcs, no_keys__ok); in ATF_INIT_TEST_CASES()
242 ATF_ADD_TEST_CASE(tcs, no_keys__unknown_key); in ATF_INIT_TEST_CASES()
244 ATF_ADD_TEST_CASE(tcs, some_keys__ok); in ATF_INIT_TEST_CASES()
245 ATF_ADD_TEST_CASE(tcs, some_keys__not_strict); in ATF_INIT_TEST_CASES()
246 ATF_ADD_TEST_CASE(tcs, some_keys__unknown_key); in ATF_INIT_TEST_CASES()
248 ATF_ADD_TEST_CASE(tcs, invalid_syntax); in ATF_INIT_TEST_CASES()
249 ATF_ADD_TEST_CASE(tcs, syntax_deprecated_format); in ATF_INIT_TEST_CASES()
250 ATF_ADD_TEST_CASE(tcs, syntax_not_called); in ATF_INIT_TEST_CASES()
251 ATF_ADD_TEST_CASE(tcs, syntax_called_more_than_once); in ATF_INIT_TEST_CASES()