Difference between pages "r7.1.1:Building Guide (test)" and "r7.1.1:Building Guide (testing)"

From liblfds.org
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
m (1 revision imported)
 
Line 1: Line 1:
{{DISPLAYTITLE:Building Guide (test)}}
{{DISPLAYTITLE:Building Guide (testing)}}
==Introducton==
==Introducton==
The ''test'' binary is a thin command line veneer which provides convenient access to the test functionality in ''libtest''.  The binary depends on ''liblfds711'', ''libtest'' and ''libshared''.
Each data structure is provided with a range of tests.  These tests are implemented in a library, ''libtest'', which offers a small and simple API, so it can be used on arbitrary platforms.  The ''libtest'' library depends on ''liblfds'' itself and also on a third library, ''libshared''.  Finally, a convenience thin command line veneer, ''test'', is provided, which is used from the command line to run the test suite and see the results.


The ''test'' library uses a porting abstraction layer to mask platform differencesBuilding ''test'' requires build files (makefile, etc) for your toolchain (GCC, gnumake, etc) and a port of the abstraction layer to your platform.
It is intended that ''libtest'' and ''libshared'' will target bare C89 implementations.  This is not yet the caseThe ''libtest'' library still requires a hosted implementation, as it calls ''time'', and ''libshared'' where it provides an abstraction for starting and waiting for threads, depends on threads.


A small number of popular toolchains are supported out-of-the-box, along with porting abstraction layers which cover Windows (user-mode) and Linux (user-mode).
Building guides exist for all these components.


==Supported Toolchains==
* [[r7.1.1:Building Guide (liblfds)|Building Guide (liblfds)]]
The supported toolchains are;
* [[r7.1.1:Building Guide (libshared)|Building Guide (libshared)]]
 
* [[r7.1.1:Building Guide (libtest)|Building Guide (libtest)]]
* GCC and gnumake
* [[r7.1.1:Building Guide (test)|Building Guide (test)]]
* MSVC and gnumake (yes, gnumake, not nmake)
 
Note that in 7.1.1, Visual Studio solution files are not provided.  This is because there are over ''liblfds'' and the ''benchmark'' and ''benchmark'' libraries and programmes (seven projects in all) in the end due to the multple build variants (debug, release, library, DLL, kernel library, kernel DLL, and repeated twice, once for VS2012 and once for VS2013) what comes to something like ten thousand settings, all of which have to be set using a mouse and a GUI, which is not only extraordinarily time-consuming and error-prone, but emotionally agonizing.
 
Mac support is not available due to lack of access to a Mac.
 
==Directory Structure==
└── test_and_benchmark
    └── test                  : test command line veneer
        ├── bin              : output directory - the binary ends up here
        ├── build            : build configuration directory - contains one directory per platform
        │  ├── gcc_gnumake  : GCC, gnumake, hosted implementation
        │  └── msvc_gnumake  : Microsoft Visual C (command line compiler) and gnumake
        ├── obj              : temporary directory for object files
        └── src              : the source files
 
==Building==
The library directory tree contains at its top level directory called ''build''.
 
This directory contains one directory per supported toolchain, where each such directory contains the files necessary to build for that toolchain.  Detailed descriptions of how to build for each toolchain are given below, with one heading per toolchain.
 
The ''test'' binary depends on ''liblfds711'', ''libtest'' and ''libshared''.  The ''test'' build files are harcoded with relative paths to find the output from these libraries, so these libraries do not need to be installed.
 
On all platforms, you need to clean between changing build types (debug, release, static, dynamic, profiled, etc), as there is only one directory used to hold object files.
 
==Per-Toolchain Build Instructions==
 
===GCC and gnumake===
└── test_and_benchmark
    └── test
        └── build
            └── gcc_gnumake
                    Makefile
 
To build, install GCC and gnumake, enter the build directory and type;
 
make
 
The following targets are available;
 
cov    : coverage
dbg    : debug
prof    : profiling
rel    : release
tsan    : thread sanitizer
vanilla : no specific-build arguments
clean  : what you'd expect
 
When switching from one target to another, ''clean'' must be made.
 
If building ''*_ar_tsan'', ''libtsan'' must be installed. This is not necessary if building ''*_so_tsan''.
 
If building for ARM32 with shared object versions of the ''liblfds'' libraries, linking will fail, with the error ''"/usr/bin/ld: ../../bin/test: hidden symbol `__aeabi_uidiv' in /usr/lib/gcc/arm-linux-gnueabihf/4.9/libgcc.a(_udivsi3.o) is referenced by DSO"''.  This means something has attempted to divide a 64 bit value by a 64 bit value, an operation which apparently is costly and usually unnecessary, a 32 bit divisor apparently is normally adequate, and as such is intentionally caught in a link-breaking way.
 
Unfortunately, as far as can be determined, ''liblfds'' itself is not performing this operation - and as such, it is not obvious how to fix it.
 
===MSVC and gnumake===
└── test_and_benchmark
    └── test
        └── build
            └── msvc_gnumake
                    makefile
 
To build, install an MSVC command line compiler, enter the build directory and type;
 
make
 
The following targets are available;
 
dlldbg  : debug  (with ''liblfds'' libs built as DLLs)
dllrel  : release (with ''liblfds'' libs built as DLLs)
libdbg  : debug  (with ''liblfds'' libs built as libs)
librel  : release (with ''liblfds'' libs built as libs)
clean  : what you'd expect
 
When switching from one target to another, clean must be made.


==See Also==
==See Also==
* [[r7.1.1:Building Guide (testing)|Building Guide (testing)]]
* [[r7.1.1:Release_7.1.1_Documentation|Release 7.1.1 Documentation]]

Latest revision as of 20:16, 17 February 2017

Introducton

Each data structure is provided with a range of tests. These tests are implemented in a library, libtest, which offers a small and simple API, so it can be used on arbitrary platforms. The libtest library depends on liblfds itself and also on a third library, libshared. Finally, a convenience thin command line veneer, test, is provided, which is used from the command line to run the test suite and see the results.

It is intended that libtest and libshared will target bare C89 implementations. This is not yet the case. The libtest library still requires a hosted implementation, as it calls time, and libshared where it provides an abstraction for starting and waiting for threads, depends on threads.

Building guides exist for all these components.

See Also