Skip to content

CMake: Adding full CMake support for building and testing - #7

Merged
kris-jusiak merged 1 commit into
cpp-testing:masterfrom
qknight:cmake_adding_support
Jul 15, 2021
Merged

kris-jusiak merged 1 commit into
cpp-testing:masterfrom
qknight:cmake_adding_support

Conversation

@qknight

@qknight qknight commented Jul 14, 2021 •

Copy link
Copy Markdown

This PR is adding full CMake support. The only thing left do do is to figure out why 3 of the tests fail:

Motivation

We want to be able to do our of source builds and since we use lots of CMake already this was the only submodule which still forced us to Makefiles.

Also we can now use ninja to build all our source code.

It is now easy to include this code base using CMakeLists.txt from the parent:

add_subdirectory(libs/gherkin-cpp)
link_libraries(PUBLIC gherkin-cpp::gherkin-cpp)

The link_libraries will then also add the headers to the search path.

Tests

What test(s) still fail:

  • ./testdata/good/incomplete_scenario.feature
  • ./testdata/good/several_examples.feature
  • ./testdata/good/incomplete_scenario_outline.feature

All other work! But I think that I did not cause those fails. Probably the tests need updates...

$ make test.run
[  3%] Built target fmem
[ 91%] Built target gherkin
[ 96%] Built target gherkin-cpp
[100%] Built target test
Running the tests
                        ./testdata/good/example_token_multiple.feature -> OK
                                    ./testdata/good/background.feature -> OK
                   ./testdata/good/scenario_outlines_with_tags.feature -> OK
                           ./testdata/good/incomplete_scenario.feature -> FAIL
                                    ./testdata/good/datatables.feature -> OK
                                    ./testdata/good/i18n_emoji.feature -> OK
                          ./testdata/good/incomplete_feature_3.feature -> OK
                   ./testdata/good/scenario_outline_no_newline.feature -> OK
                                       ./testdata/good/minimal.feature -> OK
                            ./testdata/good/spaces_in_language.feature -> OK
                                    ./testdata/good/docstrings.feature -> OK
                                 ./testdata/good/escaped_pipes.feature -> OK
                                          ./testdata/good/tags.feature -> OK
                          ./testdata/good/incomplete_feature_2.feature -> OK
                       ./testdata/good/incomplete_background_1.feature -> OK
                              ./testdata/good/several_examples.feature -> FAIL
                                      ./testdata/good/language.feature -> OK
                                       ./testdata/good/i18n_no.feature -> OK
                     ./testdata/good/example_tokens_everywhere.feature -> OK
                                  ./testdata/good/descriptions.feature -> OK
                   ./testdata/good/incomplete_scenario_outline.feature -> FAIL
                              ./testdata/good/scenario_outline.feature -> OK
                       ./testdata/good/incomplete_background_2.feature -> OK
                          ./testdata/good/incomplete_feature_1.feature -> OK
                                         ./testdata/good/empty.feature -> OK
                                ./testdata/good/readme_example.feature -> OK
                                       ./testdata/good/i18n_fr.feature -> OK
                               ./testdata/bad/invalid_language.feature -> OK
                            ./testdata/bad/single_parser_error.feature -> OK
                                    ./testdata/bad/not_gherkin.feature -> OK
                        ./testdata/bad/inconsistent_cell_count.feature -> OK
                                 ./testdata/bad/unexpected_eof.feature -> OK
                         ./testdata/bad/multiple_parser_errors.feature -> OK
Compare the *.feature.out to the *.feature.result for each failed test
----------------------------------------------------------------------
At least one test failed, so this script exits with an error (exit code 1)
make[3]: *** [test/CMakeFiles/test.run.dir/build.make:62: test.run] Error 1
make[2]: *** [CMakeFiles/Makefile2:249: test/CMakeFiles/test.run.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:256: test/CMakeFiles/test.run.dir/rule] Error 2

@qknight
qknight force-pushed the cmake_adding_support branch from 5f5cbb2 to 4db1714 Compare July 15, 2021 07:11
@qknight qknight mentioned this pull request Jul 15, 2021
@kris-jusiak
kris-jusiak merged commit 0581a0f into cpp-testing:master Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants