Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CMakePP Org Documentation CI and Docs Cleanup #77

Merged
merged 14 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .cminx-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2023 CMakePP
zachcran marked this conversation as resolved.
Show resolved Hide resolved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

zachcran marked this conversation as resolved.
Show resolved Hide resolved
input:
# Whether undocumented functions should have documentation
# auto-generated.
include_undocumented_function: false

# Whether undocumented macros should have documentation
# auto-generated.
include_undocumented_macro: false

# Strips out any string matching this regex
# for parameter names. This is useful for when
# parameter names have a prefix/postfix to prevent
# name collisions. This affects function definitions.
#
# An example regex that strips the prefix "_abc_"
# from parameter names where "abc" is any combination of letters
# is below:
# function_parameter_name_strip_regex: "^_[a-zA-Z]*_"
function_parameter_name_strip_regex: "^_[a-zA-Z]+_"
zachcran marked this conversation as resolved.
Show resolved Hide resolved

# Strips out any string matching this regex
# for parameter names. This is useful for when
# parameter names have a prefix/postfix to prevent
# name collisions. This affects macro definitions
macro_parameter_name_strip_regex: "^_[a-zA-Z]+_"

# Strips out any string matching this regex
# for parameter names. This is useful for when
# parameter names have a prefix/postfix to prevent
# name collisions. This affects CMakePP
# class member definitions.
member_parameter_name_strip_regex: "^_[a-zA-Z]+_"
30 changes: 0 additions & 30 deletions .github/workflows/autodocs.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2021 CMakePP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Build and Deploy Documentation

on:
pull_request:
types:
- closed

# Allows manual triggering with the "Run workflow" button
workflow_dispatch:

jobs:
Build-Documentation:
if: github.event.pull_request.merged == true
uses: CMakePP/.github/.github/workflows/deploy_docs_master.yaml@main
with:
api_docs_module: 'cmake_test'
cmake_source_dir: '.'
docs_dir: 'docs'
python_version: '3.10'
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
32 changes: 19 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@
CMakeTest
=========

.. image:: https://github.com/CMakePP/CMakeTest/workflows/CMakeTest%20Unit%20Tests/badge.svg
:target: https://github.com/CMakePP/CMakeTest/workflows/CMakeTest%20Unit%20Tests/badge.svg

.. image:: https://github.com/CMakePP/CMakeTest/workflows/CMakeTest%20CI/badge.svg
:target: https://github.com/CMakePP/CMakeTest/workflows/CMakeTest%20CI/badge.svg
:alt:
.. image:: https://github.com/CMakePP/CMakeTest/workflows/deploy_docs.yml/badge.svg?branch=master
:target: https://github.com/CMakePP/CMakeTest/workflows/deploy_docs.yml/badge.svg?branch=master


CMake ships with ``ctest`` which helps integrate your project's tests into your
project's build system. ``ctest``\ , is a powerful solution for managing your
CMake ships with CTest_ which helps integrate your project's tests into your
project's build system. CTest is a powerful solution for managing your
project's tests, but it is designed to be decoupled from the framework used to
actually test the code. Thus for CMake development purposes we still need a
actually test the code. Thus, for CMake development purposes we still need a
testing framework to ensure our CMake modules behave correctly. That is where
CMakeTest comes in.

CMakeTest is modeled after the Catch2 testing framework for C++. CMakeTest is a
CMake module, written 100% in CMake. Unit testing with CMakeTest relies on the
use of ``ct_add_test`` and ``ct_add_section`` special declarations, followed by ``function``
blocks. Within these blocks users write their unit tests in native CMake;
no need for ugly escapes or workarounds. The user then relies on assertions
provided by CMakeTest to ensure that the program has the expected state. For
example we can ensure that a CMake code sets a particular variable using
``ct_assert_equal``. This looks like:
use of ``ct_add_test`` and ``ct_add_section`` special declarations, followed by
``function`` blocks. Within these blocks users write their unit tests in native
CMake; no need for ugly escapes or workarounds. The user then relies on
assertions provided by CMakeTest to ensure that the program has the expected
state. For example we can ensure that a CMake code sets a particular variable
using ``ct_assert_equal``. This looks like:

.. code-block:: .cmake

Expand All @@ -49,6 +49,7 @@ example we can ensure that a CMake code sets a particular variable using

Installation
------------

CMakeTest can be installed via :code:`FetchContent` or by manually placing the
:code:`cmake_test` directory on your :code:`CMAKE_MODULES_PATH`.

Expand Down Expand Up @@ -95,4 +96,9 @@ The following CMake code allows one to install CMakeTest via FetchContent:

Documentation and Tutorials
---------------------------

Documentation can be found `here <https://cmakepp.github.io/CMakeTest/>`_

.. References

.. _CTest: https://cmake.org/cmake/help/latest/manual/ctest.1.html
22 changes: 22 additions & 0 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. Copyright 2023 CMakePP
..
.. Licensed under the Apache License, Version 2.0 (the "License");
.. you may not use this file except in compliance with the License.
.. You may obtain a copy of the License at
..
.. http://www.apache.org/licenses/LICENSE-2.0
..
.. Unless required by applicable law or agreed to in writing, software
.. distributed under the License is distributed on an "AS IS" BASIS,
.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
.. See the License for the specific language governing permissions and
.. limitations under the License.

###
API
###

.. toctree::
:maxdepth: 2

generated_docs/cmake_test/index
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ CMakeTest
faqs
writing_tests/index
tutorials/index
api/index
zachcran marked this conversation as resolved.
Show resolved Hide resolved
developer/index