Skip to content

Commit

Permalink
[v2.1.0] Merge branch 'bleeding' (Version release)
Browse files Browse the repository at this point in the history
  • Loading branch information
Snaipe committed Sep 21, 2015
2 parents d93f0c9 + 7efbac9 commit 3148348
Show file tree
Hide file tree
Showing 75 changed files with 2,582 additions and 906 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.0.2
current_version = 2.1.0
commit = False

[bumpversion:file:CMakeLists.txt]
Expand Down
26 changes: 26 additions & 0 deletions .cmake/Modules/Gcov.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

if (NOT DEFINED ENV{GCOV})
find_program(GCOV_EXECUTABLE gcov)
else()
find_program(GCOV_EXECUTABLE $ENV{GCOV})
endif()

#file(GLOB_RECURSE GCNO_FILES "${CMAKE_CURRENT_BINARY_DIR}/*.gcno")
if (WIN32)
file(GLOB_RECURSE GCDA_FILES "${COV_PATH}\\*.gcda")
else ()
file(GLOB_RECURSE GCDA_FILES "${COV_PATH}/*.gcda")
endif ()

#execute_process(
# COMMAND ${GCOV_EXECUTABLE} -lcp ${GCNO_FILES}
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
#)

foreach (GCDA ${GCDA_FILES})
get_filename_component(DIR ${GCDA} PATH)
execute_process(
COMMAND ${GCOV_EXECUTABLE} -lcp -o ${DIR} ${GCDA}
WORKING_DIRECTORY ${COV_PATH}
)
endforeach ()
47 changes: 28 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,39 @@ addons:
packages:
- gcc-4.9
- g++-4.9
env:
global:
GCOV: gcov-4.9
CXX: g++-4.9
matrix:
- CONFIGURATION=Debug COVERAGE=ON
- CONFIGURATION=Release COVERAGE=OFF
- CONFIGURATION=RelWithDebInfo COVERAGE=OFF

before_install:
- export GCOV="gcov-4.9"
- export LOCAL_INSTALL="$HOME"
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib
- export CFLAGS="-g -O0"
- export CXX="g++-4.9"
script:
- mkdir -p build
- cd build
- cmake -DCOVERALLS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=$HOME -DCMAKE_INSTALL_PREFIX=criterion-${TRAVIS_TAG} ..
- make
- make criterion_tests
- make test
- mkdir -p build
- cd build
- >
cmake
-Wno-dev
-DCOVERALLS=${COVERAGE}
-DCMAKE_BUILD_TYPE=${CONFIGURATION}
-DCMAKE_INSTALL_PREFIX=criterion-${TRAVIS_TAG}
..
- make
- make criterion_tests
- make test

after_success:
- make coveralls
- make gcov
- bash <(curl -s https://codecov.io/bash)

after_failure:
- cat Testing/Temporary/LastTest.log samples/*.{out,err} ../samples/tests/*.{out,err}
env:
global:
secure: bzZcWjdqoTgceC40kEBucx7NuWYJPk+rxgF3UJJDXi+ijQAFYPv70p5eVsGR6rfc+XgqXCxcUFQtuL4ZVt7QEfVk1ZOJITNeHbKIeKaEYS4nX8mFf+CBeEm9bJGZ04KiQJdJu5mzzAHvXbW7roGXDGWe1Bjnk5wwA+dNUCa7H04=
- cat Testing/Temporary/LastTest.log samples/*.{out,err} ../samples/tests/*.{out,err}

before_deploy:
- make install
- tar -cvjf criterion-${TRAVIS_TAG}-${TRAVIS_OS_NAME}-x86_64.tar.bz2 criterion-${TRAVIS_TAG}
- make install
- tar -cvjf criterion-${TRAVIS_TAG}-${TRAVIS_OS_NAME}-x86_64.tar.bz2 criterion-${TRAVIS_TAG}

deploy:
provider: releases
Expand All @@ -50,3 +58,4 @@ deploy:
on:
repo: Snaipe/Criterion
tags: true
condition: $CONFIGURATION = RelWithDebInfo
76 changes: 49 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ add_subdirectory(dependencies/libcsptr/ EXCLUDE_FROM_ALL)
add_subdirectory(dependencies/dyncall/ EXCLUDE_FROM_ALL)

include_directories(
/usr/local/include/
dependencies/libcsptr/include/
dependencies/dyncall/dyncall/
)
Expand All @@ -28,7 +29,7 @@ endif ()

# Project setup & environment variables

set(PROJECT_VERSION "2.0.2")
set(PROJECT_VERSION "2.1.0")
set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
set(GettextTranslate_ALL 1)
set(GettextTranslate_GMO_BINARY 1)
Expand Down Expand Up @@ -75,39 +76,52 @@ find_package(PCRE)
# List sources and headers

set(SOURCE_FILES
src/abort.c
src/abort.h
src/event.c
src/event.h
src/report.c
src/report.h
src/runner.c
src/runner.h
src/process.c
src/process.h
src/stats.c
src/stats.h
src/core/abort.c
src/core/abort.h
src/core/report.c
src/core/report.h
src/core/runner.c
src/core/runner.h
src/core/worker.c
src/core/worker.h
src/core/stats.c
src/core/stats.h
src/core/ordered-set.c
src/core/theories.c
src/compat/internal.h
src/compat/pipe.c
src/compat/pipe.h
src/compat/section.c
src/compat/section.h
src/compat/process.c
src/compat/process.h
src/compat/basename.c
src/compat/basename.h
src/compat/mockfile.c
src/compat/time.c
src/compat/time.h
src/compat/posix.h
src/compat/alloc.c
src/compat/alloc.h
src/io/redirect.c
src/io/event.c
src/io/event.h
src/io/asprintf.c
src/io/file.c
src/log/logging.c
src/log/tap.c
src/log/normal.c
src/options.c
src/timer.c
src/timer.h
src/i18n.c
src/i18n.h
src/ordered-set.c
src/posix-compat.c
src/theories.c
src/asprintf.c
src/file.c
src/main.c
src/entry.c
src/string/i18n.c
src/string/i18n.h
src/entry/options.c
src/entry/main.c
src/entry/entry.c
)

if (PCRE_FOUND)
set (SOURCE_FILES ${SOURCE_FILES}
src/extmatch.c
src/extmatch.h
src/string/extmatch.c
src/string/extmatch.h
)
set(HAVE_PCRE 1)
endif ()
Expand All @@ -128,6 +142,7 @@ set(INTERFACE_FILES
include/criterion/asprintf-compat.h
include/criterion/designated-initializer-compat.h
include/criterion/preprocess.h
include/criterion/alloc.h
)

# Generate the configure file
Expand Down Expand Up @@ -170,6 +185,13 @@ install(TARGETS criterion

add_custom_target(criterion_tests)

add_custom_target(gcov
"${CMAKE_COMMAND}"
-DSOURCE_FILES="${SOURCE_FILES}"
-DCOV_PATH="${CMAKE_CURRENT_BINARY_DIR}"
-P "${CMAKE_MODULE_PATH}/Gcov.cmake"
)

enable_testing()
add_subdirectory(samples)
add_subdirectory(test)
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ be merged.
|- .cmake/: CMake modules
|- dependencies/: dependencies for building libcriterion
|- doc/: Sphinx documentation files
|- dev/: Developer files
|- include/criterion/: Public API
|- src/: Sources for libcriterion
| `- log/: Output providers, all the output logic in general
| |- compat/: Cross-platform abstractions for platform-dependent code
| |- core/: Core mechanisms used to run the tests
| |- entry/: Entry-point related sources, and default main function
| |- io/: IO related functions, redirections
| |- log/: Output providers, all the output logic in general
| `- string/: String manipulation functions, i18n
|- po/: Translation files, i18n stuff
|- test/: Unit tests for libcriterion
`- samples/: Sample files
Expand Down
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2015-09-21 Franklin "Snaipe" Mathieu <franklinmathieu@gmail.com>

* criterion: version 2.1.0
* Addition: Added file mocking utilities
* Addition: Added parameterized tests

2015-09-20 Franklin "Snaipe" Mathieu <franklinmathieu@gmail.com>

* criterion: version 2.0.2
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![Unix Build Status](https://travis-ci.org/Snaipe/Criterion.svg?branch=bleeding)](https://travis-ci.org/Snaipe/Criterion)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/Snaipe/Criterion?svg=true&branch=bleeding)](https://ci.appveyor.com/project/Snaipe/Criterion/branch/bleeding)
[![Coverage Status](https://coveralls.io/repos/Snaipe/Criterion/badge.svg?branch=bleeding)](https://coveralls.io/r/Snaipe/Criterion?branch=bleeding)
[![Coverage Status](https://img.shields.io/codecov/c/github/Snaipe/Criterion/bleeding.svg)](https://codecov.io/github/Snaipe/Criterion?branch=bleeding)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/Snaipe/Criterion/blob/master/LICENSE)
[![Version](https://img.shields.io/github/tag/Snaipe/Criterion.svg?label=version&style=flat)](https://github.com/Snaipe/Criterion/releases)

Expand Down Expand Up @@ -32,16 +32,17 @@ the user would have with other frameworks:
* [x] Test are isolated in their own process, crashes and signals can be
reported and tested.
* [x] Unified interface between C and C++: include the criterion header and it *just* works.
* [x] There is a support for theories alongside tests
* [x] Supports parameterized tests and theories.
* [x] Progress and statistics can be followed in real time with report hooks.
* [x] TAP output format can be enabled with an option.
* [x] Runs on Linux, FreeBSD, Mac OS X, and Windows (Compiling with MinGW GCC and Visual Studio 2015+).

## Downloads

* [Linux (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.0.2/criterion-v2.0.2-linux-x86_64.tar.bz2)
* [OS X (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.0.2/criterion-v2.0.2-osx-x86_64.tar.bz2)
* [Windows (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.0.2/criterion-v2.0.2-windows-x86_64.tar.bz2)
* [Linux (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.1.0/criterion-v2.1.0-linux-x86_64.tar.bz2)
* [OS X (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.1.0/criterion-v2.1.0-osx-x86_64.tar.bz2)
* [Windows (MSVC - x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.1.0/criterion-v2.1.0-windows-msvc-x86_64.tar.bz2)
* [Windows (MinGW - x86_64)](https://github.com/Snaipe/Criterion/releases/download/v2.1.0/criterion-v2.1.0-windows-mingw-x86_64.tar.bz2)

If you have a different platform, you can still [build the library from source](http://criterion.readthedocs.org/en/latest/setup.html#installation)

Expand Down
12 changes: 8 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2.0.2_b{build}-{branch}
version: 2.1.0_b{build}-{branch}

os: Visual Studio 2015

Expand All @@ -11,7 +11,6 @@ environment:
secure: 5nuCg+faxFPeppoNNcSwVobswAVFUf8ut83vw8CX/4W2y0kZkGmwEfCUxSQWiQDU
CI_NAME: appveyor
CI_JOB_ID: $(APPVEYOR_JOB_ID)
LOCAL_INSTALL: $(APPVEYOR_BUILD_FOLDER)
GCOV_PREFIX: $(APPVEYOR_BUILD_FOLDER)
matrix:
- COMPILER: mingw
Expand All @@ -22,9 +21,13 @@ environment:
clone_depth: 5

platform:
- x86
- x86_64

configuration: Release
configuration:
- Debug
- Release
- RelWithDebInfo

install:
- ps: $env:RELEASE_NAME = $env:APPVEYOR_REPO_BRANCH -replace "/", "-"
Expand All @@ -36,7 +39,7 @@ install:
cmake
-Wno-dev
-DCMAKE_INSTALL_PREFIX="criterion-%RELEASE_NAME%"
-DCMAKE_PREFIX_PATH="%LOCAL_INSTALL%"
-DCMAKE_BUILD_TYPE="%CONFIGURATION%"
-G "%GENERATOR%"
..
Expand Down Expand Up @@ -73,3 +76,4 @@ deploy:
prerelease: false
on:
appveyor_repo_tag: true
configuration: RelWithDebInfo
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# built documents.
#
# The short X.Y version.
version = '2.0.2'
version = '2.1.0'
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
11 changes: 2 additions & 9 deletions doc/hooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ The flow of the test process goes as follows:
Hook Parameters
---------------

A report hook may take zero or one parameter. If a parameter is given, it
is undefined behaviour if it is not a pointer type and not of the proper pointed
type for that phase.

A report hook takes exactly one parameter.
Valid types for each phases are:

* ``struct criterion_test_set *`` for ``PRE_ALL``.
Expand All @@ -56,17 +53,13 @@ Valid types for each phases are:
* ``struct criterion_suite_stats *`` for ``POST_SUITE``.
* ``struct criterion_global_stats *`` for ``POST_ALL``.

For instance, these are valid report hook declarations for the ``PRE_TEST`` phase:
For instance, this is a valid report hook declaration for the ``PRE_TEST`` phase:

.. code-block:: c
#include <criterion/criterion.h>
#include <criterion/hooks.h>
ReportHook(PRE_TEST)() {
// not using the parameter
}
ReportHook(PRE_TEST)(struct criterion_test *test) {
// using the parameter
}
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Criterion
assert
hooks
env
parameterized
theories
internal
faq
Loading

0 comments on commit 3148348

Please sign in to comment.