Usage - adrianzap/softwipe GitHub Wiki

Usage

Basic usage

Softwipe can be run as follows:

softwipe.py [-c | -C] [-M | -m | -l target [target ...]] [-e EXECUTEFILE] programdir

Where:

-c tells softwipe that your program is C, and -C tells softwipe that you program is C++.

-M tells softwipe to build your program using CMake, -m using make, and -l using clang. The -l option takes as arguments the files to compile.

-e specifies the path to an "execute file" which contains a command line that actually executes your program. This is required, to conduct the memory checks (e.g., leaks, invalid accesses, etc.) using clang sanitizers.

Some other options are:

-x excludes files and directories specified. Multiple files/directories may be specified using commas (no spaces!), e.g. -x lib1/,lib2/,....

-o specifies a file in which the user can list the compiler options that are needed for a correct compilation of the program (since softwipe overwrites the variable ${CFLAGS} if it was used in the Makefile).

-f specifies a chain of commands that are to be executed for a correct build of a make-based project.

-p specifies a list of paths (separated by commas) that should be added to the PATH environment variable. Use this if you have a dependency installed but not accessible via your default PATH.

--no-execution does not execute the program and skips the clang sanitizer check (which should fix any asan and ubsan related compilation problems if they can't be fixed otherwise).

--exclude-compilation skips the compilation phase (both clang and infer compilations) and excludes it from the score.

There is also the possibility to exclude the static analysis tools from the score (they will not be executed) --exclude-assertions, --exclude-lizard, --exclude-cppcheck, --exclude-clang-tidy, --exclude-kwstyle, --exclude-infer.

programdir specifies the root directory of your target program.

Here is an example command line for a CMake-based C++ program:

softwipe.py -CM path/to/program -e path/to/executefile

For more options and further information, run softwipe.py --help.