LogoLogo
Open TrustInSoft CI
  • Overview
  • Introduction tutorial
    • Prepare the demo project
    • Set up the continuous analysis
    • Find the root cause of the undefined behavior
    • Prove the absence of undefined behaviors
    • Go beyond your test suite
  • C++ tutorial
    • Prerequisites
    • Identifiers, constructors and calling conventions
    • Learn more
  • Configuration files
    • Build preparation stage
    • Analyses configuration
    • Tips: Switching from a Global configuration to a Committed configuration
    • Tips: Generalize analyses for several architectures
    • Tips: Factorize options between several analyses
  • Get help
  • Changelog
  • Glossary
  • FAQ
  • REFERENCE
    • Supported architectures
    • Add a status badge
    • GitHub organizations
    • CWE coverage
Powered by GitBook
On this page
  • Build preparation script
  • Analyses configuration file
  1. Configuration files

Tips: Switching from a Global configuration to a Committed configuration

PreviousAnalyses configurationNextTips: Generalize analyses for several architectures

Last updated 3 years ago

It is recommended to read first the section which explain the differences between a Global configuration and a Committed configuration.

All examples in this section can be replayed with our repository, used for our . Feel free to fork this repository to try it by yourself.

Build preparation script

The only difference between the two kind of configurations for the Build preparation script is the current working directory (the root of the repository for a Global configuration and the .trustinsoftdirectory for a Committed configuration).

Hence adding a cd .. at the beginning of the script is enough to switch to a Committed configuration.

#!/bin/bash

set -e

autoconf && ./configure -f
bear make
#!/bin/bash

set -e

cd ..

autoconf && ./configure -f
bear make

Analyses configuration file

The only difference between the two kind of configurations for the Analyses configuration is the paths of files which are relative to the root of the repository for a Global configuration and to the .trustinsoftdirectory for a Committed configuration.

Hence using the for each analysis configuration object allows to switch from a Global configuration to a Committed configuration.

[
  {
    "name": "Test shift values 7 and -3",
    "files": [ "main.c", "caesar.c" ],
    "cpp-extra-args": "-I ."
  },
  {
    "name": "Test from program inputs",
    "files": [ "main.c", "caesar.c" ],
    "cpp-extra-args": "-I .",
    "main": "main_with_input",
    "val-program-name": "a.out",
    "val-args": "|People of Earth, your attention please|7"
  }
]
[
  {
    "prefix_path": "..",
    "name": "Test shift values 7 and -3",
    "files": [ "main.c", "caesar.c" ],
    "cpp-extra-args": "-I ."
  },
  {
    "prefix_path": "..",
    "name": "Test from program inputs",
    "files": [ "main.c", "caesar.c" ],
    "cpp-extra-args": "-I .",
    "main": "main_with_input",
    "val-program-name": "a.out",
    "val-args": "|People of Earth, your attention please|7"
  }
]

See also to learn how to efficiently add the "prefix_path"option to all your analysis configuration objects.

Tips: Factorize options between several analyses
Configuration files
demo-caesar
Introduction tutorial
option "prefix_path"