Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
61 changes: 60 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
enable_pr_coverage: false # Disabled: Too many issues with lcov
enable_cygwin: false
depinst_args: --include doc/examples
depinst_args: --include doc/modules
enable_mingw: false
enable_multiarch: false
timeout: 360
Expand All @@ -62,3 +62,62 @@ jobs:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} Disabled: Too many issues with lcov
COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}

antora:
name: Antora docs
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Install packages
uses: alandefreitas/cpp-actions/package-install@v1.8.8
with:
apt-get: git cmake

- name: Clone Boost.Test
uses: actions/checkout@v4

# MrDocs compiles an umbrella translation unit against the rest of Boost,
# so the dependencies have to be on disk. `scan-modules-ignore: test`
# keeps the clone from bringing in a second copy of this library.
- name: Clone Boost
uses: alandefreitas/cpp-actions/boost-clone@v1.8.8
id: boost-clone
with:
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
boost-dir: ../boost-source
scan-modules-dir: .
scan-modules-ignore: test

- uses: actions/setup-node@v4
with:
node-version: 18

- name: Build Antora docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global --add safe.directory "$(pwd)"

cd ..
BOOST_SRC_DIR="$(pwd)/boost-source"
export BOOST_SRC_DIR

cd test/doc
bash ./build_antora.sh

# Antora returns zero even when it fails, so check the site exists.
# build_antora.sh additionally passes --log-failure-level=warn when
# CI is set, which makes an unresolved xref or include fatal.
if [ ! -d "html" ]
then
echo "Antora build failed"
exit 1
fi

- name: Create Antora docs artifact
uses: actions/upload-artifact@v4
with:
name: antora-docs
path: doc/html
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![boosttest logo](doc/html/images/boost.test.logo.png)
![boosttest logo](doc/modules/ROOT/images/boost.test.logo.png)

# What is Boost.Test?
Boost.Test is a C++11/14/17 unit testing library, available on a wide range of platforms and compilers.
Expand Down
7 changes: 4 additions & 3 deletions build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,12 @@ set_target_properties(boost_test_framework_shared PROPERTIES FOLDER "UTF")
# Documentation files (files only, no target)
file(GLOB_RECURSE
BOOST_UTF_DOC_FILES
${BOOST_TEST_ROOT_DIR}/doc/*.qbk)
${BOOST_TEST_ROOT_DIR}/doc/modules/ROOT/pages/*.adoc
${BOOST_TEST_ROOT_DIR}/doc/modules/ROOT/nav.adoc)
add_custom_target(
quickbook
documentation
SOURCES ${BOOST_UTF_DOC_FILES})
set_property(TARGET quickbook PROPERTY FOLDER "Documentation/")
set_property(TARGET documentation PROPERTY FOLDER "Documentation/")

# Unit tests
add_subdirectory(${BOOST_TEST_ROOT_DIR}/test tmp_folders_tests)
7 changes: 7 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
html/
node_modules/
build/
reference-output/
antora.log
.superproject-playbook.yml
mrdocs.yml.bak
52 changes: 52 additions & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# Copyright (c) 2003 Boost.Test contributors
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Standalone project whose only purpose is to give MrDocs a compilation
# database for mrdocs.cpp, the umbrella translation unit that includes the
# public headers. Nothing is built: MrDocs only configures this project and
# reads compile_commands.json.
#
# The library's own CMakeLists.txt cannot serve this purpose because it is a
# modular-Boost library that has to be added from the superproject. So this
# project adds the superproject instead, restricted to Boost.Test and its
# dependencies, and picks up the include paths from the Boost::unit_test_framework
# target's interface.

cmake_minimum_required(VERSION 3.8...3.22)

project(boost_test_mrdocs LANGUAGES CXX)

# MrDocs forces CMAKE_EXPORT_COMPILE_COMMANDS=ON, which would dump every target
# of the superproject into the compilation database. Turn it off globally and
# switch it on for our target alone.
set(CMAKE_EXPORT_COMPILE_COMMANDS OFF)

if(NOT DEFINED ENV{BOOST_SRC_DIR})
message(FATAL_ERROR
"BOOST_SRC_DIR is not set. It normally comes from the cpp-reference "
"extension's `dependencies` block in the Antora playbook; build_antora.sh "
"also derives it from a surrounding Boost superproject checkout.")
endif()

# Configure only what Boost.Test needs; the superproject resolves the
# dependencies listed in ../CMakeLists.txt for us.
set(BOOST_INCLUDE_LIBRARIES test)
add_subdirectory($ENV{BOOST_SRC_DIR} deps/boost EXCLUDE_FROM_ALL)

# An object library, not an executable: unit_test.hpp brings in a main()
# that wants init_unit_test_suite(), and there is nothing here to link.
add_library(mrdocs OBJECT mrdocs.cpp)

# This worktree's headers must win over whatever the Boost checkout carries,
# which matters when BOOST_SRC_DIR is a clone rather than the superproject this
# library sits in.
get_filename_component(BOOST_TEST_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../include" ABSOLUTE)
target_include_directories(mrdocs BEFORE PRIVATE ${BOOST_TEST_INCLUDE_DIR})
target_link_libraries(mrdocs PRIVATE Boost::unit_test_framework)
set_target_properties(mrdocs PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
EXPORT_COMPILE_COMMANDS ON)
198 changes: 55 additions & 143 deletions doc/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -5,152 +5,64 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#

using quickbook ;
using doxygen ;
using boostbook ;

########################################################################
# Standalone HTML documentation

import doxygen ;

path-constant TEST_ROOT : .. ;

doxygen doxygen_reference_generated_doc
:
$(TEST_ROOT)/include/boost/test/debug_config.hpp
$(TEST_ROOT)/include/boost/test/detail/global_typedef.hpp
$(TEST_ROOT)/include/boost/test/debug.hpp
$(TEST_ROOT)/include/boost/test/execution_monitor.hpp
$(TEST_ROOT)/include/boost/test/framework.hpp
$(TEST_ROOT)/include/boost/test/tools/assertion_result.hpp
$(TEST_ROOT)/include/boost/test/unit_test.hpp
$(TEST_ROOT)/include/boost/test/tree/observer.hpp

# logs and formatters
$(TEST_ROOT)/include/boost/test/unit_test_log.hpp
$(TEST_ROOT)/include/boost/test/output/xml_log_formatter.hpp
$(TEST_ROOT)/include/boost/test/output/plain_report_formatter.hpp
$(TEST_ROOT)/include/boost/test/output/compiler_log_formatter.hpp

# reports
$(TEST_ROOT)/include/boost/test/output/xml_report_formatter.hpp
$(TEST_ROOT)/include/boost/test/unit_test_log_formatter.hpp
$(TEST_ROOT)/include/boost/test/results_reporter.hpp
$(TEST_ROOT)/include/boost/test/results_collector.hpp

# progress monitor
$(TEST_ROOT)/include/boost/test/progress_monitor.hpp

# test cases and suites
$(TEST_ROOT)/include/boost/test/tree/test_unit.hpp
$(TEST_ROOT)/include/boost/test/parameterized_test.hpp

# execution monitor source files
$(TEST_ROOT)/include/boost/test/execution_monitor.hpp

# output test stream
$(TEST_ROOT)/include/boost/test/tools/output_test_stream.hpp

# datasets
$(TEST_ROOT)/include/boost/test/data/monomorphic/fwd.hpp
$(TEST_ROOT)/include/boost/test/data/test_case.hpp
$(TEST_ROOT)/include/boost/test/data/for_each_sample.hpp
$(TEST_ROOT)/include/boost/test/data/size.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/delayed.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/initializer_list.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/array.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/collection.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/generate.hpp


$(TEST_ROOT)/include/boost/test/data/monomorphic/grid.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/join.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/singleton.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/zip.hpp

# datasets generators
$(TEST_ROOT)/include/boost/test/data/config.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/generators.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/generators/keywords.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/generators/random.hpp
$(TEST_ROOT)/include/boost/test/data/monomorphic/generators/xrange.hpp

# utils
$(TEST_ROOT)/include/boost/test/utils/algorithm.hpp
$(TEST_ROOT)/include/boost/test/utils/named_params.hpp
$(TEST_ROOT)/include/boost/test/tools/floating_point_comparison.hpp
$(TEST_ROOT)/include/boost/test/utils/is_forward_iterable.hpp

# BOOST_TEST related functions
$(TEST_ROOT)/include/boost/test/tools/detail/bitwise_manip.hpp
$(TEST_ROOT)/include/boost/test/tools/detail/lexicographic_manip.hpp
$(TEST_ROOT)/include/boost/test/tools/detail/per_element_manip.hpp
$(TEST_ROOT)/include/boost/test/tools/detail/tolerance_manip.hpp

# others
$(TEST_ROOT)/include/boost/test/unit_test_parameters.hpp
:
<doxygen:param>EXTRACT_ALL=YES
<doxygen:param>"PREDEFINED=\"BOOST_TEST_DECL=\" \\
\"BOOST_TEST_DOXYGEN_DOC__=1\"
"
<doxygen:param>HIDE_UNDOC_MEMBERS=NO
<doxygen:param>AUTOLINK_SUPPORT=YES
<doxygen:param>HIDE_UNDOC_CLASSES=NO
<doxygen:param>INLINE_INHERITED_MEMB=YES
<doxygen:param>EXTRACT_PRIVATE=NO
<doxygen:param>ENABLE_PREPROCESSING=YES
<doxygen:param>MACRO_EXPANSION=YES
<doxygen:param>EXPAND_ONLY_PREDEF=YES
<doxygen:param>SEARCH_INCLUDES=YES
<doxygen:param>INCLUDE_PATH=$(TEST_ROOT)/include
<doxygen:param>EXAMPLE_PATH=$(TEST_ROOT)/doc/examples
<doxygen:param>BRIEF_MEMBER_DESC=YES
<doxygen:param>REPEAT_BRIEF=YES
<doxygen:param>ALWAYS_DETAILED_SEC=YES
<doxygen:param>MULTILINE_CPP_IS_BRIEF=YES
<doxygen:param>CASE_SENSE_NAMES=YES
<doxygen:param>INTERNAL_DOCS=NO
<doxygen:param>SUBGROUPING=YES
<doxygen:param>SHORT_NAMES=YES
;



########################################################################
# HTML documentation for $(BOOST_ROOT)/doc/html

xml test_doc
:
test.qbk
;

explicit test_doc ;

path-constant images_location : html ;

boostbook standalone
:
test_doc
:
<xsl:param>boost.root=../../../..
<xsl:param>html.stylesheet=boostbook.css
<xsl:param>chapter.autolabel=0
<xsl:param>toc.max.depth=3
<xsl:param>toc.section.depth=10
<xsl:param>chunk.section.depth=4
<xsl:param>chunk.first.sections=1
<xsl:param>generate.section.toc.level=3
<format>pdf:<xsl:param>img.src.path=$(images_location)/
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/test/doc/html
<dependency>doxygen_reference_generated_doc
# The documentation is built by Antora, driven by build_antora.sh. The API
# reference inside it is generated by MrDocs. Neither Quickbook, Doxygen nor
# BoostBook is involved any more.

import generate ;
import path ;
import property-set ;
import virtual-target ;

path-constant HERE : . ;

make html/index.html : build_antora.sh : @run-script ;
generate files-to-install : html/index.html : <generating-rule>@delayed-glob ;
install install
: files-to-install
: <location>html
<install-source-root>html/test
;

explicit test ;
explicit html/index.html files-to-install ;

# this runs the antora script
actions run-script
{
bash $(>)
}

# this globs after its sources are created
rule delayed-glob ( project name : property-set : sources * )
{
for local src in $(sources)
{
# the next line causes the source to be generated immediately
# and not later (which it normally would)
UPDATE_NOW [ $(src).actualize ] ;
}

# we need to construct the path to the globbed directory;
# this path would be <current-project>/html
local root = [ path.root html [ $(project).location ] ] ;
local files ;

# actual globbing happens here
for local file in [ path.glob-tree $(root) : * ]
{
# we have to skip directories, because our match expression accepts anything
if [ CHECK_IF_FILE $(file) ]
{
# we construct a list of targets to copy
files += [ virtual-target.from-file $(file:D=) : $(file:D) : $(project) ] ;
}
}

# we prepend empty usage requirements to the result
return [ property-set.empty ] $(files) ;
}

###############################################################################
alias boostdoc ;
explicit boostdoc ;
alias boostrelease : standalone ;
alias boostrelease : install ;
explicit boostrelease ;
Loading