-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42d0107
commit 175db2e
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Introduction | ||
The files in this directory are used to post-process test files | ||
that are extracted from the documentation examples. | ||
|
||
# Main Files | ||
- `processTests.sh` : processes all doc tests and moves them into `tst/files/doc`. | ||
|
||
# Instructions | ||
In order to post-process the tests and move them into `tst/files/doc` automatically, one needs to execute `processTests.sh` from any place. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# go to root of repo | ||
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
cd $script_dir/../.. | ||
echo "Working in folder $(pwd)" | ||
|
||
# get operating system | ||
unameOut="$(uname -s)" | ||
case "${unameOut}" in | ||
Linux*) machine=Linux;; | ||
Darwin*) machine=Mac;; | ||
CYGWIN*) machine=Cygwin;; | ||
MINGW*) machine=MinGw;; | ||
*) machine="UNKNOWN:${unameOut}" | ||
esac | ||
|
||
|
||
# Post-processing for the extracted examples from the documentation. | ||
# - Add a "\n" to all Print executions. | ||
# - Move files into test_dir | ||
test_dir="tst/files/doc" | ||
mkdir -p $test_dir | ||
files=($(ls -1 tst/lins*.tst)) | ||
echo "Found ${#files[@]} test file(s)" | ||
for file in ${files[@]}; do | ||
echo "Processing $file" | ||
if [ "${machine}" == "Mac" ]; then | ||
sed -i "" 's|Print(\(.*\));|Print(\1, \"\\n\");|g' $file | ||
elif [ "${machine}" == "Linux" ]; then | ||
sed -i 's|Print(\(.*\));|Print(\1, \"\\n\");|g' $file | ||
else | ||
echo "ERROR: Unsupported operating system ${machine}" | ||
exit 1 | ||
fi; | ||
mv $file $test_dir/${file#"tst/"} | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,5 @@ AutoDoc( rec( scaffold := rec( | |
"license.xml", | ||
], | ||
), | ||
extract_examples := true, | ||
autodoc := true ) ); |