Added initial configuration file schema validation

This commit is contained in:
Bartek Kryza
2023-07-22 18:39:07 +02:00
parent 97efbbb332
commit 8dc0dacd3f
11 changed files with 1550 additions and 73 deletions
-1
View File
@@ -8,7 +8,6 @@ diagrams:
- ../../tests/t00048/a_t00048.cc
- ../../tests/t00048/t00048.cc
using_namespace: clanguml::t00048
parse_includes: true
include:
namespaces:
- clanguml::t00048
+45 -3
View File
@@ -15,10 +15,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define CATCH_CONFIG_MAIN
#define CATCH_CONFIG_RUNNER
#define CATCH_CONFIG_CONSOLE_WIDTH 512
#include "catch.h"
#include "cli/cli_handler.h"
#include "config/config.h"
#include "util/util.h"
@@ -339,4 +340,45 @@ TEST_CASE("Test config sequence inherited", "[unit-test]")
CHECK(def.type() == clanguml::common::model::diagram_t::kSequence);
CHECK(def.combine_free_functions_into_file_participants() == false);
CHECK(def.generate_return_types() == false);
}
}
TEST_CASE("Test config full clang uml dump", "[unit-test]")
{
auto cfg =
clanguml::config::load("./test_config_data/clang_uml_config.yml");
CHECK(cfg.diagrams.size() == 32);
}
///
/// Main test function
///
int main(int argc, char *argv[])
{
Catch::Session session;
using namespace Catch::clara;
bool debug_log{false};
auto cli = session.cli() |
Opt(debug_log, "debug_log")["-u"]["--debug-log"]("Enable debug logs");
session.cli(cli);
int returnCode = session.applyCommandLine(argc, argv);
if (returnCode != 0)
return returnCode;
clanguml::cli::cli_handler clih;
std::vector<const char *> argvv = {
"clang-uml", "--config", "./test_config_data/simple.yml"};
if (debug_log)
argvv.push_back("-vvv");
else
argvv.push_back("-q");
clih.handle_options(argvv.size(), argvv.data());
return session.run();
}
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -6,11 +6,11 @@ diagram_templates:
description: Sequence diagram of the main() function
type: sequence
template: |
main_sequence_diagram:
type: sequence
glob: [ {{ glob }} ]
start_from:
- function: 'main(int,const char**)'
main_sequence_diagram:
type: sequence
glob: [ {{ glob }} ]
start_from:
- function: 'main(int,const char**)'
diagrams:
diagram1:
type: class
-1
View File
@@ -28,7 +28,6 @@ diagrams:
- src/**/*.h
using_namespace:
- clanguml
generate_method_arguments: full
layout:
ABCD:
- up: ABCD_SUBCLASS