Skip to content

Commit

Permalink
YAMLParser enable/refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaciel committed Dec 16, 2024
1 parent a8f0983 commit 19a2d35
Show file tree
Hide file tree
Showing 3 changed files with 383 additions and 579 deletions.
2 changes: 1 addition & 1 deletion tests/parser/2.13.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ASCII Art
--- |
\//||\/||
// || ||__
// || ||__
63 changes: 51 additions & 12 deletions tests/parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,60 @@ ecbuild_add_test( TARGET eckit_test_parser_json
SOURCES test_json.cc
LIBS eckit )

list( APPEND yaml
2.1.yaml 2.10.yaml 2.11.yaml 2.12.yaml 2.13.yaml 2.14.yaml 2.15.yaml 2.16.yaml 2.17.yaml
2.18.yaml 2.19.yaml 2.2.yaml 2.20.yaml 2.21.yaml 2.22.yaml 2.23.yaml 2.24.yaml 2.25.yaml
2.26.yaml 2.27.yaml 2.28.yaml 2.3.yaml 2.4.yaml 2.5.yaml 2.6.yaml 2.7.yaml 2.8.yaml 2.9.yaml
cfg.1.yaml string.yaml unicode.yaml
)
ecbuild_add_executable( TARGET eckit_yaml_file
SOURCES eckit_yaml_file.cc
LIBS eckit_option
NOINSTALL )

foreach( r ${yaml} )
configure_file( ${r} ${CMAKE_CURRENT_BINARY_DIR}/${r} @ONLY )
endforeach()
function(test_yaml_file test_file check_file)
if(NOT DEFINED check_file)
ecbuild_add_test( TARGET eckit_test_yaml_file_${test_file}
COMMAND eckit_yaml_file
ARGS ${test_file} --check-file=${check_file}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
else()
ecbuild_add_test( TARGET eckit_test_yaml_file_${test_file}
COMMAND eckit_yaml_file
ARGS ${test_file}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
endif()
endfunction()

test_yaml_file( 2.1.yaml 2.1.json )
test_yaml_file( 2.2.yaml 2.2.json )
test_yaml_file( 2.3.yaml 2.3.json )
test_yaml_file( 2.4.yaml 2.4.json )
test_yaml_file( 2.5.yaml 2.5.json )
test_yaml_file( 2.6.yaml 2.6.json )
test_yaml_file( 2.7.yaml 2.7.json )
test_yaml_file( 2.8.yaml 2.8.json )
test_yaml_file( 2.9.yaml 2.9.json )
test_yaml_file( 2.10.yaml 2.10.json )
test_yaml_file( 2.11.yaml ) # not decoded properly
test_yaml_file( 2.12.yaml 2.12.json )
test_yaml_file( 2.13.yaml 2.13.json )
test_yaml_file( 2.14.yaml 2.14.json )
test_yaml_file( 2.15.yaml 2.15.json )
test_yaml_file( 2.16.yaml ) # not decoded properly
# test_yaml_file( 2.17.yaml 2.17.json ) # cannot decode
test_yaml_file( 2.18.yaml ) # not decoded properly
test_yaml_file( 2.19.yaml 2.19.json )
test_yaml_file( 2.20.yaml 2.20.json )
test_yaml_file( 2.21.yaml 2.21.json )
test_yaml_file( 2.22.yaml ) # not decoded properly
test_yaml_file( 2.23.yaml ) # not decoded properly
# test_yaml_file( 2.24.yaml 2.24.json ) # cannot decode
test_yaml_file( 2.25.yaml ) # not decoded properly
test_yaml_file( 2.26.yaml ) # not decoded properly
test_yaml_file( 2.27.yaml ) # not decoded properly
test_yaml_file( 2.28.yaml ) # not decoded properly

ecbuild_add_test( TARGET eckit_test_parser_yaml
SOURCES test_yaml.cc
LIBS eckit )
unset( test_yaml_file )

ecbuild_add_test( TARGET eckit_test_parser_yaml
SOURCES test_yaml.cc
LIBS eckit
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )

ecbuild_add_test( TARGET eckit_test_parser_stream_parser
SOURCES test_stream_parser.cc
Expand Down
Loading

0 comments on commit 19a2d35

Please sign in to comment.