Skip to content

Latest commit

 

History

History
98 lines (69 loc) · 3.43 KB

README.md

File metadata and controls

98 lines (69 loc) · 3.43 KB

Features

The library allows to disable certain features at compile time. This simplifies the process of figuring out which code is dependent on which feature by for instance relying on compiler warnings to help trim the redundant code down. We then also want the test suite to pass on all these different configuration options of course.

At one point manually maintaining all those different possible combinations of options particularly for the combinatorial tester became very tedious (an earlier version of this README.md file had a 11 step process to add a new feature).

Feature List

Now we automatically generate the code from the following files:

  • features.csv is a list of options to disable features and their description
  • clashing.csv is a list of pairs of clashing options (incompatible options)
  • implied.csv is a list of implications (one option implies another)

The utility generate compiled from generate.c will read those files above, perform extensive sanity checking, then computes transitive implications and finally generates the following set of files files.

Shell Scripts

The first set consists of files read and used by ../configure:

  • check.sh checks that options are not implied nor clashing
  • define.sh produces corresponding C preprocessor flags '-N...'
  • init.sh initializes 'configure' option variables
  • parse.sh is used for command line argument parsing
  • usage.sh prints usage for all the options

Preprocessor Options

The second set is read by ../features.h:

  • check.h checks implied and clashing options
  • diagnose.h diagnoses and prints final set of options
  • init.h initializes additional (implied) options

Support for Combinatorial Testing

The third set is read by ../gencombi to generate test configurations:

  • invalid.h contains pairs of invalid options (implied and clashing)
  • list.h contains list of all options (in C syntax)

Version Information

And finally we read from ../config.c (generated by ../mkconfig.sh):

  • version.h extends VERSION by the list of options

Build Process

The build process for generate is standard. Just use

./configure && make

to build 'generate' which uses the following files.

The build process of generate does not depend on the configuration of the main library. You also do no need to compile generate at all if you do not change the 'CSV' files. Otherwise just call

./generate

to generate all the files above. These generate files are also under revision control since changing features is rare. This avoids building and executing generate during the build process of the solver but requires that you update the generated files (by calling generate) manually after changing one of the "CSV" files.

You can also use the following command instead.

./generate -v

It produces some more information as verbose messages.