Build system: use SPDX identifiers The SPDX identifiers [1] are a legally binding shorthand, which can be used instead of the full boiler plate text. This is the first step towards implementing the full REUSE spec [2] to help with copyright and licensing audits and compliance. This will reduce a lot a manual work required for the licensing audit required in Debian on each update. For files that lacked copyright and licensing information, I used the following guidelines. If a clear author could be determined from the git history use it, otherwise use 'EfficiOS Inc.'. For build system files, use 'MIT', for documentation 'CC-BY-4.0' and for data files 'CC-1.0'. [1] https://spdx.org/ids-how [2] https://reuse.software/tutorial/ Change-Id: Ie507130c00b95606dc439616fda4fd9b1d35353d Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: use __noreturn__ for C11-compatibility The noreturn convenience macro provided by stdnoreturn.h might get included before urcu headers, use __noreturn__ for better compatibility with code using <stdnoreturn.h> header. Signed-off-by: Ondřej Surý <ondrej@sury.org> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Adjust shell scripts to allow Bash in other locations Linux-based OS for the most part provide Bash and being located in /bin, but on other OS's the shell would be in another location. Utilize env(1) and allow it to be located elsewhere. Signed-off-by: Brad Smith <brad@comstyle.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Change-Id: I9d4d4a3feaf993754c64b740ea91e42b336ba2b4
Improved test framework This is based on the babeltrace / librseq test framework with the objective of standardising across projects. Regroup all the configure detected values relevant to the test suite in a single generated file. This file will be automatically sourced by the test suite in most scenarios but can also be sourced in the shell of a user. * All user overridable variables start with 'URCU_TESTS_'. * The priority for variables is : Environment -> env.sh -> utils.sh (defaults). * A user can source 'env.sh', override some of the values and manually run test scripts. * The test suite can run without an 'env.sh' file present. Change-Id: Id94f7085ed1ea0e30207856cf1594ca30585536c Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Build and run regression and unit tests as C++ programs Build and run all tests under tests/regression and tests/unit as C++ programs in addition to C. This helps get confidence that urcu, when used from a C++ program, behaves well. Change-Id: Iacaa42dddbcbf59eff8e327edfd0352cce0b74b7 Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Import libtap from babeltrace Import the fixes to our local copy of libtap from the babeltrace repository. This will allow enabling stricter compiler warnings down the line. Change-Id: I557ad39345dfaf6a08219109a5790d1bf12abb78 Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure: standardise include path Use the same include setup as our other projects, set the default includes globally in configure.ac in AM_CPPFLAGS. This is part of an effort to standardise our autotools setup across project to simplify maintenance. Change-Id: Ia40344e22920bafca9ed34ea2867acf38a1807e3 Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests: Move tap-driver.sh out of the autotools aux directory We have made local modifications to this script, move it to the test suite directory so it doesn't get overwritten by an updated version from autotools. This is part of an effort to standardise our autotools setup across project to simplify maintenance. Change-Id: I4bc0bdbff05d03d8e4c0f9dcda51cf6a6cf7fec4 Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: tap array subscript has type char warning On architectures where "char" is signed, it should be cast to unsigned char before being passed as parameter to isdigit or isspace. Based on their man page: These functions check whether c, which must have the value of an unsigned char or EOF, falls into a certain character class according to the specified locale. Passing a signed char as parameter is invalid if the values fall into the negative range of the signed char. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: Don't override user variables within the build system Instead use the appropriatly prefixed AM_* variables as to not interfere when a user variable is passed to a make command. The proper use of flag variables is documented at : https://www.gnu.org/software/automake/manual/automake.html#Flag-Variables-Ordering Fixes #1095 Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cleanup: Re-organise source dir Re-organise the sources, add a top level "src" and "include" dir and move relevant files. Disable autotools automated includes and define them manually. This fixes problems with collision of header names with system headers. Include the autoconf config.h in the default includes and remove it where it's explicitely included. Remove _GNU_SOURCE defines since it's detected at configure for platforms that requires it and added to the config.h. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Refactor tests - Migrate benchmarks and regression tests to tap, - Replace the "bench" make target by "short_bench" and "long_bench". The short benchmark is 3 seconds per test, and the long one is 30 seconds per test, - make regtest now invokes the benchmarks with only 1 second per benchmark. - Now use "nproc" command to detect the number of available CPUs rather than hardcoding a value. - rcutorture in "stress" mode is now executed. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>