Skip to content

feat(cmake): add option for disabling tests#15

Merged
aduh95 merged 1 commit intonodejs:mainfrom
GunniBusch:cmake-test
Apr 9, 2026
Merged

feat(cmake): add option for disabling tests#15
aduh95 merged 1 commit intonodejs:mainfrom
GunniBusch:cmake-test

Conversation

@GunniBusch
Copy link
Copy Markdown
Contributor

This pull request updates the project's CMakeLists.txt to improve how testing is enabled and managed. The main changes introduce a new option for controlling test builds, conditionally include test dependencies and directories, and improve reproducibility by specifying a hash for the googletest dependency.

Testing configuration improvements:

  • Added a new CMake option NBYTES_ENABLE_TESTING to control whether testing is enabled, defaulting to the value of BUILD_TESTING (option(NBYTES_ENABLE_TESTING "Enable testing" ${BUILD_TESTING})).
  • Now only adds the tests subdirectory and fetches googletest if testing is enabled, making test dependencies optional for non-testing builds.
  • Added a SHA256 hash for the googletest dependency to ensure consistent and secure downloads.

General build system improvements:

  • Moved the addition of the src subdirectory to occur before the conditional test logic, ensuring core sources are always included.

PS: Only the pr description was generated via ai.
PPS: Tests are on by default and can be controlled via BUILD_TESTING or NBYTES_ENABLE_TESTING.

@aduh95 aduh95 merged commit e1c6be3 into nodejs:main Apr 9, 2026
6 checks passed
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