cucumber / cucumber-cpp

Support for writing Cucumber step definitions in C++
MIT License
306 stars 131 forks source link

Inconsistent naming of CMake options #213

Closed ghost closed 5 years ago

ghost commented 5 years ago

Non-systematic naming makes it harder to run config from command line:

Solution

Mark old options deprecated and replace them with new ones. Don't invert. Prefer STATIC when option is linkage-related, like in Boost_USE_STATIC_LIBS.

New naming №1

Shorter options that all start with CUKE_

Old name                   Default   |  New name                   Default   |  Note
-------------------------------------+---------------------------------------+------
BUILD_SHARED_LIBS          OFF       |  CUKE_STATIC_LIBS           ON        |
CUKE_USE_STATIC_BOOST      ${WIN32}  |  CUKE_STATIC_BOOST          ${WIN32}  |
CUKE_USE_STATIC_GTEST      ON        |  CUKE_STATIC_GOOGLE_TEST    ON        |  [1]
CUKE_DISABLE_BOOST_TEST    OFF       |  CUKE_BOOST_TEST            ON        |
CUKE_DISABLE_GTEST         OFF       |  CUKE_GOOGLE_TEST           ON        |  [1]
CUKE_DISABLE_UNIT_TESTS    OFF       |  CUKE_UNIT_TESTS            ON        |
CUKE_DISABLE_E2E_TESTS     OFF       |  CUKE_E2E_TESTS             ON        |
CUKE_ENABLE_EXAMPLES       OFF       |  CUKE_EXAMPLES              OFF       |
CUKE_DISABLE_QT            OFF       |  CUKE_QT                    ON        |
VALGRIND_TESTS             OFF       |  CUKE_VALGRIND_TESTS        OFF       |

  [1]  Replace `GTEST` with `GOOGLE_TEST` to match `BOOST_TEST`

New naming № 2

Options start with:

Old name                   Default   |  New name                         Default  |  Note
-------------------------------------+--------------------------------------------+------
BUILD_SHARED_LIBS          OFF       |  CUKE_USE_STATIC_LIBS             ON       |
CUKE_USE_STATIC_GTEST      ON        |  CUKE_USE_STATIC_GOOGLE_TEST      ON       |  [1]
CUKE_DISABLE_BOOST_TEST    OFF       |  CUKE_ENABLE_BOOST_TEST           ON       |
CUKE_DISABLE_GTEST         OFF       |  CUKE_ENABLE_GOOGLE_TEST          ON       |  [1]
CUKE_DISABLE_UNIT_TESTS    OFF       |  CUKE_ENABLE_UNIT_TESTS           ON       |
CUKE_DISABLE_E2E_TESTS     OFF       |  CUKE_ENABLE_E2E_TESTS            ON       |
CUKE_DISABLE_QT            OFF       |  CUKE_ENABLE_QT                   ON       |
VALGRIND_TESTS             OFF       |  CUKE_ENABLE_VALGRIND_TESTS       OFF      |

  [1]  Replace `GTEST` with `GOOGLE_TEST` to match `BOOST_TEST`

Doesn't change:
  CUKE_USE_STATIC_BOOST
  CUKE_ENABLE_EXAMPLES
paoloambrosio commented 5 years ago

Thanks for raising this.

Points where I disagree:

On the DISABLE and ENABLE flags I agree that it makes sense to standardise them.

Features prefixed with CUKE_ENABLE_

Old name                   Default  |  New name                  Default
------------------------------------+-----------------------------------
CUKE_DISABLE_BOOST_TEST    OFF      |  CUKE_ENABLE_BOOST_TEST    ON
CUKE_DISABLE_GTEST         OFF      |  CUKE_ENABLE_GTEST         ON
CUKE_DISABLE_QT            OFF      |  CUKE_ENABLE_QT            ON
CUKE_ENABLE_EXAMPLES       OFF      |  CUKE_ENABLE_EXAMPLES      OFF

Test suites could be prefixed with CUKE_TESTS_ to make it clear that they are not features:

Old name                   Default  |  New name                  Default
------------------------------------+-----------------------------------
CUKE_DISABLE_UNIT_TESTS    OFF      |  CUKE_TESTS_UNIT           ON
CUKE_DISABLE_E2E_TESTS     OFF      |  CUKE_TESTS_E2E            ON
VALGRIND_TESTS             OFF      |  CUKE_TESTS_VALGRIND       OFF
ghost commented 5 years ago

@paoloambrosio Could you, please, review PR #216 for this issue?