JayBeams  0.1
Another project to have fun coding.
Functions
ut_config_object.cpp File Reference
#include <jb/config_files_location.hpp>
#include <jb/config_object.hpp>
#include <boost/filesystem.hpp>
#include <boost/test/unit_test.hpp>
#include <cstdlib>
#include <fstream>
#include <string>
#include <vector>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (config_attribute_simple)
 
 BOOST_AUTO_TEST_CASE (config_attribute_complex)
 
 BOOST_AUTO_TEST_CASE (config_attribute_complex_copy)
 
 BOOST_AUTO_TEST_CASE (config_attribute_variadic_constructor)
 
 BOOST_AUTO_TEST_CASE (config_object_apply)
 
 BOOST_AUTO_TEST_CASE (config_object_vector)
 
 BOOST_AUTO_TEST_CASE (config_object_vector_empty)
 
 BOOST_AUTO_TEST_CASE (config_object_nested_by_class)
 
 BOOST_AUTO_TEST_CASE (config_object_load)
 
 BOOST_AUTO_TEST_CASE (config_object_cmdline_args)
 
 BOOST_AUTO_TEST_CASE (config_object_usage)
 
 BOOST_AUTO_TEST_CASE (config_object_invalid_option)
 
 BOOST_AUTO_TEST_CASE (config_object_pair_yaml)
 
 BOOST_AUTO_TEST_CASE (config_object_pair_options)
 
 BOOST_AUTO_TEST_CASE (config_object_config_file_env)
 
 BOOST_AUTO_TEST_CASE (config_object_config_file_missing_with_env)
 
 BOOST_AUTO_TEST_CASE (config_object_config_file)
 
 BOOST_AUTO_TEST_CASE (config_object_config_file_missing)
 
 BOOST_AUTO_TEST_CASE (config_object_positional)
 
 BOOST_AUTO_TEST_CASE (usage_coverage)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/20]

BOOST_AUTO_TEST_CASE ( config_attribute_simple  )
Test:
Verify we can create simple jb::config_attribute objects

Definition at line 55 of file ut_config_object.cpp.

◆ BOOST_AUTO_TEST_CASE() [2/20]

BOOST_AUTO_TEST_CASE ( config_attribute_complex  )
Test:
Verify we can create more complex jb::config_attribute objects

Definition at line 70 of file ut_config_object.cpp.

◆ BOOST_AUTO_TEST_CASE() [3/20]

BOOST_AUTO_TEST_CASE ( config_attribute_complex_copy  )
Test:
Verify we can copy and assign complex config objects.

Definition at line 93 of file ut_config_object.cpp.

◆ BOOST_AUTO_TEST_CASE() [4/20]

BOOST_AUTO_TEST_CASE ( config_attribute_variadic_constructor  )
Test:
Verify we can create jb::config_attribute objects with complex constructors

Definition at line 121 of file ut_config_object.cpp.

References config_object_constructors, jb::operator<<(), and jb::itch5::operator==().

◆ BOOST_AUTO_TEST_CASE() [5/20]

BOOST_AUTO_TEST_CASE ( config_object_apply  )
Test:
Verify the framework support deeply nested configs with by_class overrides.

Definition at line 177 of file ut_config_object.cpp.

References config_object_constructors.

◆ BOOST_AUTO_TEST_CASE() [6/20]

BOOST_AUTO_TEST_CASE ( config_object_vector  )
Test:
Verify the framework supports vectors of config objects.

Definition at line 225 of file ut_config_object.cpp.

◆ BOOST_AUTO_TEST_CASE() [7/20]

BOOST_AUTO_TEST_CASE ( config_object_vector_empty  )
Test:
Verify the framework supports vectors of config objects that are empty.

Definition at line 279 of file ut_config_object.cpp.

References config_object_constructors.

◆ BOOST_AUTO_TEST_CASE() [8/20]

BOOST_AUTO_TEST_CASE ( config_object_nested_by_class  )
Test:
Verify the framework supports configuring by class in nested structs.

Definition at line 333 of file ut_config_object.cpp.

◆ BOOST_AUTO_TEST_CASE() [9/20]

BOOST_AUTO_TEST_CASE ( config_object_load  )
Test:
Verify that we can load configurations from an iostream.

Definition at line 389 of file ut_config_object.cpp.

◆ BOOST_AUTO_TEST_CASE() [10/20]

BOOST_AUTO_TEST_CASE ( config_object_cmdline_args  )
Test:
Verify that we apply command-line arguments after the overrides.

Definition at line 420 of file ut_config_object.cpp.

◆ BOOST_AUTO_TEST_CASE() [11/20]

BOOST_AUTO_TEST_CASE ( config_object_usage  )
Test:
Verify that config objects raise usage exceptions.

Definition at line 455 of file ut_config_object.cpp.

◆ BOOST_AUTO_TEST_CASE() [12/20]

BOOST_AUTO_TEST_CASE ( config_object_invalid_option  )
Test:
Verify that config objects raise exceptions when presented with invalid options.

Definition at line 470 of file ut_config_object.cpp.

References config_object_constructors.

◆ BOOST_AUTO_TEST_CASE() [13/20]

BOOST_AUTO_TEST_CASE ( config_object_pair_yaml  )
Test:
Verify config_objects can handle std::pair<>

Definition at line 497 of file ut_config_object.cpp.

◆ BOOST_AUTO_TEST_CASE() [14/20]

BOOST_AUTO_TEST_CASE ( config_object_pair_options  )
Test:
Verify config_objects can handle std::pair<>

Definition at line 516 of file ut_config_object.cpp.

References config_object_constructors.

◆ BOOST_AUTO_TEST_CASE() [15/20]

BOOST_AUTO_TEST_CASE ( config_object_config_file_env  )
Test:
Verify that config object works correctly with real files and an environment variable.

Definition at line 560 of file ut_config_object.cpp.

References jb::sysconfdir().

◆ BOOST_AUTO_TEST_CASE() [16/20]

BOOST_AUTO_TEST_CASE ( config_object_config_file_missing_with_env  )
Test:
Verify that config object works correctly with a missing file and the environment variable.

Definition at line 607 of file ut_config_object.cpp.

◆ BOOST_AUTO_TEST_CASE() [17/20]

BOOST_AUTO_TEST_CASE ( config_object_config_file  )
Test:
Verify that config object works correctly with real files and the default environment variable.

Definition at line 636 of file ut_config_object.cpp.

References jb::sysconfdir().

◆ BOOST_AUTO_TEST_CASE() [18/20]

BOOST_AUTO_TEST_CASE ( config_object_config_file_missing  )
Test:
Verify that config object works correctly when the real file is not found using the default environment variable.

Definition at line 683 of file ut_config_object.cpp.

References config_object_constructors.

◆ BOOST_AUTO_TEST_CASE() [19/20]

BOOST_AUTO_TEST_CASE ( config_object_positional  )
Test:
Verify that config object works correctly with real files and an environment variable.

Definition at line 719 of file ut_config_object.cpp.

◆ BOOST_AUTO_TEST_CASE() [20/20]

BOOST_AUTO_TEST_CASE ( usage_coverage  )
Test:
Complete coverage for jb::usage

Definition at line 737 of file ut_config_object.cpp.

References jb::usage::exit_status().