Leonardus
Loading...
Searching...
No Matches
TOOLS

The following scripts can be found in the Tools directory:

Git Hooks

These scripts can be copied to .git/hooks to support the development work flow.

Tools/post-commit

It simply extracts the commit message and automatically adds it to the
CHANGELOG.md. Place it in your .git/hooks with access 775 to activate it.

Automation Scripts

These scripts are used by the makefile.

Tools/coproc.sh

coproc.sh
Interactivity test with a coproc.
Syntax: coproc.sh [options]
Options:
-h ... this text
-v ... verbose output
Exit codes:
0 .... success
5 .... command line issues, environment issues and test failures

Tools/ctest.sh

ctest.sh
Command line test harness.
Syntax: ctest.sh [options]
Options:
-2 ... level 2 - include checks against artifacts of documentation (man pages)
-h ... this text
-v ... verbose output
Runs command line tests and
is used for code coverage tests, too.
Exit codes:
0 .... success
5 .... command line issues, environment issues and test failures

Tools/customdocker.sh

customdocker.sh
Builds custom Docker images.
Syntax: customdocker.sh [options]
Options:
-h ... this text
-v ... verbose output
The underlying Docker images are pulled,
the custom Docker images for the project are
build and pushed to Docker hub
customdocker.sh expects a valid login to "docker.io".
Exit codes:
0 .... success
1 .... error

Tools/dockerstart.sh

dockerstart.sh
Start script for the docker image "leonardus"
Syntax: dockerstart.sh [options]
Options:
-h ......... this text
This script is for internal use only.

Tools/dolcov.sh

dolcov.sh
Code coverage run.
Syntax: dolcov.sh [options]
Options:
-A ... suppresses ANSI escape codes
-h ... prints this text
-U ... excludes utest coverage to analyze gaps from etest/ctest
-v ... sets verbose output
Runs
- etest, all end-to-end test suites, and
- utest BOOST unit tests and
- ctest command line tests
with coverage statistics to produce the public/lcov HTML report.
Additionally produces a 'lines...... : xx.x%' console output for
the GitLab 'coverage:' feature.
dolcov.sh generates only a dummy index.html, if one of the artifacts is
not of build type COVERAGE.
Exit codes:
0 .... success
1 .... error

Tools/e2e.sh

e2e.sh: end-to-end test harness
Usage: e2e.sh [options] dir1[ dir2 [...]]]
Options:
-a accepts the first difference and saves the current output in the expected output file
-d print diff output in case of differences
-h this text
-n dry run mode
-v verbose output
The test suite directories contain file triplets for every test case: testxxx.leo, optionally testxxx.leon, and testxxx.out.
Each directory contains at least test001.leo with a test suite header.
A shell script 'suite.inc' is sourced in, if existing, for each suite to set following variables:
SUITE_CHECKLEON=1|0 # to check the pass 1 output. Default is 1.
SUITE_BOOTLEO=0|1 # to include boot.leo. Default is 0.
SUITE_WILCARD=0|1 # accept bash wild cards in test*.out files. Default is 0.
SUITE_VOCABULARY=dirname1[,dirname2[...]] # source in the vocabularies from given vocabularies/dirname1 etc. Default is empty.
TESTxxx_EC_PARSER=0|y # parser should honour test case xxx with exit code y. Default is 0.
TESTxxx_EC_LEON=0|y # leon should honour test case xxx with exit code y. Default is 0.
e2e.sh stops at the first occurrence of a difference between the software under test and the given expected output.
e2e.sh also stops at the first difference between produced and expected exit code.
Exit codes:
0 .... success
5 .... command line issues, environment issues and test failures

Tools/mdcli.sh

mdcli.sh
Markdown CLI extraction
Syntax: mdcli.sh [options] tools1 [tools2 [tools3 ...]]
toolsX ..... tools with -h option
Options:
-f file .... adds file after generated header.
-h ......... this text
-T title ... title text
-v ......... verbose output
Extracts a markdown documentation of the command line interfaces
from all the given tools to standard out.
It uses the '-h' option of all the given tools.
Generates empty output for Python files, if the interpreter can not be found.
Exit codes:
0 .... success
1 .... error

Tools/mdextract.sh

mdextract.sh
Markdown extraction.
Syntax: mdextract.sh [options] file1 [file2 [file3 ...]]
fileX ... LeoScript with embedded notes.
Options:
-h ...... this text
-v ...... verbose output
Extracts markdown texts from the given files.
The rules are: Every line starting with %%! is extracted.
The leading characters %%! are removed.
The filenames are converted to markdown headers.
An empty line is inserted between extractions.
Exit codes:
0 .... success
1 .... error

Tools/ptest.sh

ptest.sh
Performance test harness.
Syntax: ptest.sh [options]
Options:
-h ... this text
-v ... verbose output
Runs performance tests from directory 'Performance/'
and writes reports to 'Performance/gp_*.txt' reports.
The 'leon' binary has to of build type PERFORM.
ptest.sh deletes all old reports.
Exit codes:
0 .... success
5 .... command line issues, environment issues and test failures

Tools/singletxt.sh

singletxt.sh
Packs the project to a single tmp/leonardus_tracked_<timestamp>.txt.
Syntax: singletxt.sh [options]
Options:
-h ...... this text
-v ...... verbose output
Can be used to feed an AI bot.
Exit codes:
0 .... success
1 .... error

Tools/tasktags.sh

tasktags.sh
Task tag extraction
Syntax: tasktags.sh [options]
Options:
-h ... this text
-t ... produce a HTML table
-m ... produce a Markdown table
-v ... verbose output
Extracts task tags from source code and markdown documents.
Exit codes:
0 .... success
1 .... error

Tools/udocker.sh

udocker.sh
Runs Leonardus docker image with the rights of the user currently logged in.
Syntax: udocker.sh [options]
Options:
-h ......... this text

Tools/analyze_private.py

usage: analyze_private.py [-h] [-v]
Identify public methods that are not called internally and can be refactored to private.
options:
-h, --help show this help message and exit
-v, --verbose enable verbose output
Input: 'tmp/methods.json'.
Output: List of methods eligible for refactoring to private.
Requires:
- tmp/methods.json generated by public_methods.py
- compile-commands.json
- clang-query (part of LLVM/Clang toolchain)
Exit Codes:
0 .... success
1 .... error

Tools/public_methods.py

usage: public_methods.py [-h] [-v]
Extract public methods from Doxygen XML output to a JSON file.
options:
-h, --help show this help message and exit
-v, --verbose enable verbose output
Input: Doxygen XML files from 'xml/'.
Output: JSON file written to 'tmp/methods.json'.
Exit Codes:
0 .... success
1 .... error