Documentation files (both in text and HTML format):
src: Project source
data: Project data files
tests: Source directory for AUnits tests
features: The feature files to test xreq
obj: Built objects directory
bin: Built executables directory
doc: Contains the documentation
coverage: Contains coverage reports
reports: Contains other reports
tools: Various useful scripts for the project
*.gpr: GPRBuild project files, invoked by
Makefile: Build script
Makefile.xreq: XReq Project file for GPS
README: README file
reports.html: HTML file with easy access to all generated reports
COPYING: Licensing information
features directory contains many different
.feature files that describe
features of wspec using the cucumber syntax. It also
cucumber: This contains the cucumber features that do not apply to xreq yet. They should be modified to fit xreq in the future.
step_definitions: The step definitions written in Ada that translate the sentances in the feature files in code that can be executed
tests: Contains the tests generated by xreq from the feature files. The tests generated have the same name as the feature file but with a
data directory contains features files used as input to test
XReq. They do not test anything, but are used only to stress some features of
First, you need to build the project. First, just run
XReq will be installed where gprbuild is installed. The GPS plugin will be installed where GPS is installed. If GPS is not installed, the plugin will be left out (unless you provide a location for it to be installed).
You can run
make help to see all the paths where the different files will be
installed. The variables shown can be overriden with the make syntax:
make VAR=VALUE TARGET
In order to install XReq, you just have to run:
Remark: you can use the
DESTDIR variable to install everything under a
tempoary location. This can be very useful if you want to create a package. The
paths hardcoded during installation will not use
DESTDIR at all. If you just
want to install the program somewhere else, use
PREFIX instead. This variable
will change other paths as well.
Tests are generated using
You can run unit tests by executing
bin/unit_tests. The acceptance test suite
generated by XReq is executed by running
You can also execute cucumber on the acceptance test suite (quicker) by using one of the following commands:
make run-features: Run features (XReq and cucumber) for everything
make run-features-ada: Run features (XReq and cucumber) for Ada code
make run-features-c: Run features (XReq and cucumber) for C code
make run-cucumber: Run cucumber on everything
make run-cucumber-ada: Run cucumber on XReq tests generating Ada code
make run-cucumber-c: Run cucumber on XReq tests generating C code
make run-xreq: Run xreq generated test suite for everything
make run-xreq-ada: Run xreq generated test suite for Ada code
make run-xreq-c: Run xreq generated test suite for C code
Testing code coverage using gcov
WARNING: DO NOT WORK CURRENTLY :(
The project is compiled with code coverage information. To measure the code
covered by the tests, you can simpely run
make coverage. The coverage
information is generated in the
For this to work, you need
Checking the code with gnatcheck
make gnatcheck and
gnatcheck.out will be created in the
directory. The file
gnatcheck.rules contain the rules
2011-12-05: Problem parsing step definitions
You should define the procedures on the step definition packages in one line. If you split the procedure on two lines, the procedure name will not be detected properly.
If you have a body part in your package, the step definition generation will put the generated procedures in the body part of the package.
2010-11-22: Storage_Error in XReqLib
Check that the library has been elaborated.
2010-06-07: Cannot run coverage test twice for Cucumber-Ada
The second time, I get a lot of Program_Error: adjust/finalize raised STORAGE_ERROR: stack overflow (or erroneous memory access)
I don't know what to think of that. Solution:
git clean -fdx
I hate arcane and obscure things.
2010-05-19: Installation without debug symbols fails
Undefined reference to `gnat__traceback__symbolic__symbolic_traceback__2'.
This looks like a problem I already had. I hate it.
Workaround: install the debug version. You can change which version you install
INSTALL_CONFIG variable with either
2010-05-10: Code coverage doesn't work
There are errors running tests:
/usr/bin/ld: hidden symbol `__gcov_merge_add' in /usr/lib/gcc/i686-redhat-linux/4.4.3/libgcov.a(_gcov_merge_add.o) is referenced by DSO /usr/bin/ld: final link failed: Nonrepresentable section on output
It seems that the shared library does have undefined gcov symbols:
$ nm -u lib/coverage/libxreq.so | grep gcov U __gcov_init U __gcov_merge_add
As the gcov library is static, it should probably have been linked with
libxreq.so directly. A solution has been found and seems to work.
2010-04-28: Problem with XReqLib and symbolic traceback
It seems that while I use the library with Ada programs only, eerything works
file. But when creating a library for C programs, everything goes wrong. In
particular, the symbolic traceback is not available to dynamic libraries
So, as a workaround, dynamic libraries unfortunately won't use
GNAT.Traceback.Symbolic.Symbolic_Traceback. No more advanced debug facilities.
2010-02-05: Coverage tests fail because all lines tagged with '-'
gcov detected no executable line (all lines were tagged with '-') because an
empty package was added to the source directory (
util-string.ads). The solution was to remove those empty packages.
The commit that introduced the problem is
a48f66ca0bf4c1d461200ad6c04006ac636634cb (Added util packages) and it was
d97c0c824a085d9251f1309029921bfdbce6304b (Fix coverage tests by
removing some empty packages).