mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-16 15:21:14 -03:00
Split up sphinx HTML and MAN file generation
This test is the one with the longest runtime. Splitting the two targets into separate tests allows them to run in parallel, which can speed up the tests.
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
#RUN: fish_indent=%fish_indent fish=%fish %fish %s
|
||||
#REQUIRES: command -v sphinx-build
|
||||
|
||||
set -g tmp_dir (mktemp -d)
|
||||
|
||||
function build_docs --argument-names builder
|
||||
set -l repo_root (status dirname)/../..
|
||||
set -l docsrc $repo_root/doc_src
|
||||
set -l doctree $tmp_dir/doctree
|
||||
set -l output_dir $tmp_dir/$builder
|
||||
# sphinx-build needs fish_indent in $PATH
|
||||
set -lxp PATH (path dirname $fish_indent)
|
||||
sphinx-build \
|
||||
-j auto \
|
||||
-q \
|
||||
-W \
|
||||
-E \
|
||||
-b $builder \
|
||||
-c $docsrc \
|
||||
-d $doctree \
|
||||
$docsrc \
|
||||
$output_dir
|
||||
end
|
||||
|
||||
set -l success true
|
||||
build_docs man || set -l success false
|
||||
build_docs html || set -l success false
|
||||
|
||||
rm -r $tmp_dir
|
||||
|
||||
if test $success = false
|
||||
exit 1
|
||||
end
|
||||
7
tests/checks/sphinx-html.fish
Normal file
7
tests/checks/sphinx-html.fish
Normal file
@@ -0,0 +1,7 @@
|
||||
#RUN: fish_indent=%fish_indent fish=%fish %fish %s
|
||||
#REQUIRES: command -v sphinx-build
|
||||
|
||||
set -l build_script (status dirname)/../test_functions/sphinx-shared.sh
|
||||
# sphinx-build needs fish_indent in $PATH
|
||||
set -lxp PATH (path dirname $fish_indent)
|
||||
$build_script html
|
||||
7
tests/checks/sphinx-man.fish
Normal file
7
tests/checks/sphinx-man.fish
Normal file
@@ -0,0 +1,7 @@
|
||||
#RUN: fish_indent=%fish_indent fish=%fish %fish %s
|
||||
#REQUIRES: command -v sphinx-build
|
||||
|
||||
set -l build_script (status dirname)/../test_functions/sphinx-shared.sh
|
||||
# sphinx-build needs fish_indent in $PATH
|
||||
set -lxp PATH (path dirname $fish_indent)
|
||||
$build_script man
|
||||
28
tests/test_functions/sphinx-shared.sh
Executable file
28
tests/test_functions/sphinx-shared.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cleanup () {
|
||||
if [ -n "$tmp_dir" ] && [ -e "$tmp_dir" ]; then
|
||||
rm -r "$tmp_dir"
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT INT TERM HUP
|
||||
|
||||
repo_root=$(dirname "$0")/../..
|
||||
builder=$1
|
||||
docsrc=$repo_root/doc_src
|
||||
tmp_dir=$(mktemp -d)
|
||||
doctree=$tmp_dir/doctree
|
||||
output_dir=$tmp_dir/$builder
|
||||
sphinx-build \
|
||||
-j auto \
|
||||
-q \
|
||||
-W \
|
||||
-E \
|
||||
-b "$builder" \
|
||||
-c "$docsrc" \
|
||||
-d "$doctree" \
|
||||
"$docsrc" \
|
||||
"$output_dir"
|
||||
Reference in New Issue
Block a user