head	1.15;
access;
symbols
	pkgsrc-2026Q1:1.14.0.6
	pkgsrc-2026Q1-base:1.14
	pkgsrc-2025Q4:1.14.0.4
	pkgsrc-2025Q4-base:1.14
	pkgsrc-2025Q3:1.14.0.2
	pkgsrc-2025Q3-base:1.14
	pkgsrc-2025Q2:1.13.0.8
	pkgsrc-2025Q2-base:1.13
	pkgsrc-2025Q1:1.13.0.6
	pkgsrc-2025Q1-base:1.13
	pkgsrc-2024Q4:1.13.0.4
	pkgsrc-2024Q4-base:1.13
	pkgsrc-2024Q3:1.13.0.2
	pkgsrc-2024Q3-base:1.13
	pkgsrc-2024Q2:1.12.0.4
	pkgsrc-2024Q2-base:1.12
	pkgsrc-2024Q1:1.12.0.2
	pkgsrc-2024Q1-base:1.12
	pkgsrc-2023Q4:1.11.0.8
	pkgsrc-2023Q4-base:1.11
	pkgsrc-2023Q3:1.11.0.6
	pkgsrc-2023Q3-base:1.11
	pkgsrc-2023Q2:1.11.0.4
	pkgsrc-2023Q2-base:1.11
	pkgsrc-2023Q1:1.11.0.2
	pkgsrc-2023Q1-base:1.11
	pkgsrc-2022Q4:1.9.0.20
	pkgsrc-2022Q4-base:1.9
	pkgsrc-2022Q3:1.9.0.18
	pkgsrc-2022Q3-base:1.9
	pkgsrc-2022Q2:1.9.0.16
	pkgsrc-2022Q2-base:1.9
	pkgsrc-2022Q1:1.9.0.14
	pkgsrc-2022Q1-base:1.9
	pkgsrc-2021Q4:1.9.0.12
	pkgsrc-2021Q4-base:1.9
	pkgsrc-2021Q3:1.9.0.10
	pkgsrc-2021Q3-base:1.9
	pkgsrc-2021Q2:1.9.0.8
	pkgsrc-2021Q2-base:1.9
	pkgsrc-2021Q1:1.9.0.6
	pkgsrc-2021Q1-base:1.9
	pkgsrc-2020Q4:1.9.0.4
	pkgsrc-2020Q4-base:1.9
	pkgsrc-2020Q3:1.9.0.2
	pkgsrc-2020Q3-base:1.9
	pkgsrc-2020Q2:1.8.0.6
	pkgsrc-2020Q2-base:1.8
	pkgsrc-2020Q1:1.8.0.2
	pkgsrc-2020Q1-base:1.8
	pkgsrc-2019Q4:1.8.0.4
	pkgsrc-2019Q4-base:1.8
	pkgsrc-2019Q3:1.7.0.6
	pkgsrc-2019Q3-base:1.7
	pkgsrc-2019Q2:1.7.0.4
	pkgsrc-2019Q2-base:1.7
	pkgsrc-2019Q1:1.7.0.2
	pkgsrc-2019Q1-base:1.7
	pkgsrc-2018Q4:1.6.0.2
	pkgsrc-2018Q4-base:1.6
	pkgsrc-2018Q3:1.5.0.6
	pkgsrc-2018Q3-base:1.5
	pkgsrc-2018Q2:1.5.0.4
	pkgsrc-2018Q2-base:1.5
	pkgsrc-2018Q1:1.5.0.2
	pkgsrc-2018Q1-base:1.5
	pkgsrc-2017Q4:1.4.0.14
	pkgsrc-2017Q4-base:1.4
	pkgsrc-2017Q3:1.4.0.12
	pkgsrc-2017Q3-base:1.4
	pkgsrc-2017Q2:1.4.0.8
	pkgsrc-2017Q2-base:1.4
	pkgsrc-2017Q1:1.4.0.6
	pkgsrc-2017Q1-base:1.4
	pkgsrc-2016Q4:1.4.0.4
	pkgsrc-2016Q4-base:1.4
	pkgsrc-2016Q3:1.4.0.2
	pkgsrc-2016Q3-base:1.4
	pkgsrc-2016Q2:1.3.0.12
	pkgsrc-2016Q2-base:1.3
	pkgsrc-2016Q1:1.3.0.10
	pkgsrc-2016Q1-base:1.3
	pkgsrc-2015Q4:1.3.0.8
	pkgsrc-2015Q4-base:1.3
	pkgsrc-2015Q3:1.3.0.6
	pkgsrc-2015Q3-base:1.3
	pkgsrc-2015Q2:1.3.0.4
	pkgsrc-2015Q2-base:1.3
	pkgsrc-2015Q1:1.3.0.2
	pkgsrc-2015Q1-base:1.3;
locks; strict;
comment	@# @;


1.15
date	2026.06.11.07.20.58;	author wiz;	state Exp;
branches;
next	1.14;
commitid	jb3exjrtFQyBNlJG;

1.14
date	2025.07.23.08.09.09;	author pin;	state Exp;
branches;
next	1.13;
commitid	AOOuXVvsHBmQrQ3G;

1.13
date	2024.08.25.06.18.32;	author wiz;	state Exp;
branches;
next	1.12;
commitid	BcrSL94SO85mvanF;

1.12
date	2024.01.06.09.07.07;	author pin;	state Exp;
branches;
next	1.11;
commitid	v4Z4ln3r14sKTmTE;

1.11
date	2023.01.24.22.20.20;	author wiz;	state Exp;
branches;
next	1.10;
commitid	z0PbCaoVTRHorQaE;

1.10
date	2023.01.24.18.36.21;	author wiz;	state Exp;
branches;
next	1.9;
commitid	ve7xOYU4T11xcPaE;

1.9
date	2020.07.03.16.08.46;	author hauke;	state Exp;
branches;
next	1.8;
commitid	ObkASqTwhyXjrEeC;

1.8
date	2019.11.23.07.23.57;	author mef;	state Exp;
branches;
next	1.7;
commitid	UlZEJbemNbkmHWLB;

1.7
date	2019.01.21.07.39.48;	author maya;	state Exp;
branches;
next	1.6;
commitid	gFf7F4JrOOQFCC8B;

1.6
date	2018.12.03.15.16.33;	author adam;	state Exp;
branches;
next	1.5;
commitid	19RQ58uA9tu7Jm2B;

1.5
date	2018.02.02.10.31.07;	author jperkin;	state Exp;
branches;
next	1.4;
commitid	4sMsaKgrkATXUgpA;

1.4
date	2016.08.06.15.03.30;	author mef;	state Exp;
branches;
next	1.3;
commitid	QsC4yJGbFCtBWfhz;

1.3
date	2015.03.31.22.03.48;	author wiz;	state Exp;
branches;
next	1.2;
commitid	K6KE0mNfRvzs9Ofy;

1.2
date	2015.03.31.15.11.16;	author joerg;	state Exp;
branches;
next	1.1;
commitid	ZB1GJwyE8FWNRLfy;

1.1
date	2015.02.27.04.23.43;	author manu;	state Exp;
branches;
next	;
commitid	iGj8ay9UMHJljBby;


desc
@@


1.15
log
@cmocka: update to 2.0.2.

## [2.0.2] - 2026-01-12

### Fixed

- Fixed typo in `CMOCKA_NO_DEPRECATION_WARNINGS`

## [2.0.1] - 2025-12-19

### Added

- Option to disable deprecation warnings via `CMOCKA_NO_DEPRECATION_WARNINGS`

### Changed

- Documentation theme is now downloaded during `make docs` instead of at configure time

### Fixed

- Fixed const-correctness issues throughout the library

## [2.0.0] - 2025-12-04

### Added

#### Test Filtering
- Environment variable support for test filtering:
  - `CMOCKA_TEST_FILTER`: Filter tests to run by pattern
  - `CMOCKA_SKIP_FILTER`: Filter tests to skip by pattern
- Improved `cmocka_set_test_filter()` and `cmocka_set_skip_filter()` functions

#### Output Formats
- **TAP 14 support**: Updated Test Anything Protocol output to
  version 14 with YAML diagnostics
  - YAML-formatted error messages with proper indentation
  - `severity` field for distinguishing failures from errors
  - Improved SKIP directive format

#### Type-Safe Assertions and Mocking
- Type-safe assertion macros for integers:
  - `assert_int_equal()` / `assert_int_not_equal()`
  - `assert_uint_equal()` / `assert_uint_not_equal()`
  - `assert_int_in_range()` / `assert_int_not_in_range()`
  - `assert_uint_in_range()` / `assert_uint_not_in_range()`
  - `assert_int_in_set()` / `assert_int_not_in_set()`
  - `assert_uint_in_set()` / `assert_uint_not_in_set()`

- Type-safe mocking macros for different types:
  - `will_return_int()`, `will_return_uint()`,
    `will_return_float()`, `will_return_double()`,
    `will_return_ptr()`
  - `will_return_*_count()`, `will_return_*_always()`,
    `will_return_*_maybe()` variants
  - `will_set_parameter_int()`, `will_set_parameter_uint()`,
    `will_set_parameter_float()`, `will_set_parameter_double()`,
    `will_set_parameter_ptr()`
  - `will_set_parameter_*_count()`,
    `will_set_parameter_*_always()`,
    `will_set_parameter_*_maybe()` variants
  - `mock_int()`, `mock_uint()`, `mock_float()`, `mock_double()`,
    `mock_ptr()`

- Type-safe expect macros:
  - `expect_int_value()` / `expect_uint_value()`
  - `expect_int_not_value()` / `expect_uint_not_value()`
  - `expect_int_in_range()` / `expect_uint_in_range()`
  - `expect_int_not_in_range()` / `expect_uint_not_in_range()`
  - `expect_int_in_set()` / `expect_uint_in_set()`
  - `expect_int_not_in_set()` / `expect_uint_not_in_set()`
  - `expect_check_int()` / `expect_check_uint()`

#### Float and Double Support
- Floating-point assertion macros:
  - `assert_float_equal()` / `assert_float_not_equal()`
  - `assert_double_equal()` / `assert_double_not_equal()` with
    epsilon parameter
  - `assert_float_in_range()` / `assert_float_not_in_range()`
  - `assert_float_in_set()` / `assert_float_not_in_set()`

- Floating-point expect macros:
  - `expect_float()` / `expect_not_float()`
  - `expect_double()` / `expect_not_double()`
  - `expect_float_in_range()` / `expect_float_not_in_range()`
  - `expect_float_in_set()` / `expect_float_not_in_set()`

- `mock_double()` / `mock_parameter_double()` for mocking double
  values

#### Assertion Enhancements
- Pointer assertion macros with custom error messages:
  - `assert_ptr_equal_msg()` / `assert_ptr_not_equal_msg()`
  - `assert_null_msg()` / `assert_non_null_msg()`

- `assert_true()` and `assert_false()` now provide more verbose
  error messages

- Memory comparison improvements with better error display

#### Testing Features
- `has_mock()`: Check if a mock value is available before calling
  `mock()`
- `stop()`: New feature to stop test execution while allowing
  remaining tests to run
- `expect_check_data()`: New API for parameter validation with
  custom data (replaces deprecated `expect_check()`)
- `expect_check_data_any()`: Variant for checking pointer/struct
  parameters
- Errno mocking convenience macros: `will_set_errno()`,
  `will_set_errno_always()`

#### Output Customization
- Multiple simultaneous output formats support (can combine
  STANDARD, SUBUNIT, TAP, XML)
- Output function override capability via `cmocka_set_callbacks()`
- `cmocka_print_error()`: Public API for printing errors using
  configured output format

#### Documentation and Examples
- Improved API documentation with better examples
- Added `expect_check_data()` examples
- Added errno mocking examples
- Added parameter setting examples
- Better mock object examples

#### Build System and Compatibility
- CMake minimum required version bumped to 3.13
- CMake namespace support (`cmocka::cmocka`, `cmocka::static`)
- Meson build system support
- `extern "C"` wrapper for C++ compatibility
- Version header (`cmocka_version.h`)

### Changed

#### API Improvements
- Changed internal value handling to use `CMockaValueData` union
  for better type safety
- `_mock()` now returns `CMockaValueData` instead of raw values
- Improved error messages throughout the library
- Error messages now print to stdout instead of stderr
- Better display of memory comparison errors
- Enhanced string replacement implementation

#### Code Quality
- Use `bool` instead of `int` for boolean values throughout
- Use `stdint.h` types (`intmax_t`, `uintmax_t`) instead of
  custom types
- Reduced call stack consumption in printf functions
- Added compiler attributes to non-returning functions
- Use `__builtin_align_down` when available
- Better alignment handling (MALLOC_ALIGNMENT set to 16)

#### Build Configuration
- Require C99 standard
- C extensions enabled by default
- Windows DLL export improvements with `CMOCKA_DLLEXTERN`
- `WINDOWS_EXPORT_ALL_SYMBOLS` support
- Address sanitizer support for MSVC
- Stack protector flags always passed to linker

#### Documentation Improvements
- Enhanced API documentation with better organization
- Cleaned up internal functions from public documentation
- Better grouping of macros and functions
- Improved page layout and styling
- Updated README with more details

#### Examples
- Modernized and rebuilt calculator example
- Added new assert_macro examples demonstrating common assertions
- Removed deprecated allocate module example (use AddressSanitizer instead)

### Deprecated

- `expect_check()`: Use `expect_check_data()` instead
- `check_expected()`: Use `check_expected_int()` or
  `check_expected_uint()` instead
- `assert_in_range()`: Use `assert_int_in_range()` or
  `assert_uint_in_range()` instead
- `assert_not_in_range()`: Use `assert_int_not_in_range()` or
  `assert_uint_not_in_range()` instead
- `assert_in_set()`: Use `assert_int_in_set()` or
  `assert_uint_in_set()` instead
- `expect_in_range()`: Use `expect_int_in_range()` or
  `expect_uint_in_range()` instead
- `expect_not_in_range()`: Use `expect_int_not_in_range()` or
  `expect_uint_not_in_range()` instead
- `expect_value()`: Use `expect_int_value()` or
  `expect_uint_value()` instead
- `expect_not_value()`: Use `expect_int_not_value()` or
  `expect_uint_not_value()` instead
- `will_return()`: Use type-specific variants
  (`will_return_int()`, etc.) instead
- `will_return_count()`: Use type-specific variants instead
- `will_return_always()`: Use type-specific variants instead
- `will_set_parameter()`: Use type-specific variants instead
- Old MSVC support (pre-2008) dropped
- Cmockery legacy support removed

### Fixed

- Fixed missing `cmocka_version.h` in documentation
- Fixed TAP output for skipped tests
- Fixed floating-point comparison for `INFINITY` and `NAN`
- Fixed `expect_not_float()` implementation
- Fixed `mock_float()` implementation
- Fixed `assert_double_not_equal()` float handling
- Fixed `expect_function_calls()` for counts of 0
- Fixed NULL pointer dereference in `_function_called()`
- Fixed pointer assertions with function pointers
- Fixed segmentation fault handling in tests
- Fixed setjmp in `expect_assert_failure` macro
- Fixed unexpanded `%s` in leftover values error messages
- Fixed XML output duration formatting
- Fixed XML string sanitization (escape slashes and special
  characters)
- Fixed Windows x64 builds
- Fixed Windows UWP build errors (C4703)
- Fixed MinGW pkgconfig path relocation
- Fixed test calloc overflow checking
- Fixed symbol map freeing to avoid undefined behavior
- Fixed memory equal display implementation
- Fixed comparison between pointer and integer issues
- Fixed possible data loss on MSVC
- Fixed conversion warnings from `time_t` to `double`

### Infrastructure

- Added GitLab CI pipeline with multiple platforms:
  - Linux (Ubuntu, Fedora, Debian)
  - Windows (MinGW, MSVC)
  - FreeBSD
  - Code coverage analysis
  - Static analysis (Coverity, cppcheck)
  - Address and UB sanitizers
- Added SBOM template in CycloneDX format
- Added clang-format configuration
- Added .editorconfig
- Added CONTRIBUTING.md
- Added Coverity modeling files
@
text
@# $NetBSD: Makefile,v 1.14 2025/07/23 08:09:09 pin Exp $

DISTNAME=	cmocka-2.0.2
CATEGORIES=	devel
MASTER_SITES=	https://cmocka.org/files/${PKGVERSION_NOREV:R}/
EXTRACT_SUFX=	.tar.xz

MAINTAINER=	pkgsrc-users@@NetBSD.org
HOMEPAGE=	https://cmocka.org/
COMMENT=	Unit testing framework for C supporting mock objects
LICENSE=	apache-2.0

.include "../../devel/cmake/build.mk"
.include "../../mk/bsd.pkg.mk"
@


1.14
log
@devel/cmocka: update to 1.1.8

- Set CMOCKA_LIBRARIES in package config for backwards compatibility
- Improve c_strreplace implementation
- Sanitize XML strings
- Update check for uintptr_t
- Require cmake >= 3.10
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.13 2024/08/25 06:18:32 wiz Exp $
d3 1
a3 1
DISTNAME=	cmocka-1.1.8
a12 4
# GCC 4.3/4.4 provides wrong warnings:
# cmocka.c:3281: error: 'setup_name' may be used uninitialized in this function
CMAKE_CONFIGURE_ARGS+=	-DWITH_WERROR_UNINITIALIZED_FLAG=0

@


1.13
log
@*: replace CMAKE_ARGS with CMAKE_CONFIGURE_ARGS
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.12 2024/01/06 09:07:07 pin Exp $
d3 1
a3 1
DISTNAME=	cmocka-1.1.7
@


1.12
log
@devel/cmocka: update to 1.1.7

1.1.7
* Update ignore list for source tarball generation

1.1.6
* Added new assert macros to compare 2 double given an epsilon
* Added meson build system
* Added header with version to TAP13 output
* Fixed issues with MSVC
* Fixed TAP output for skipped tests
* Fixed issue with fail_msg
* CMake generated configs for find_package(cmocka)
* Documentation improvements
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.11 2023/01/24 22:20:20 wiz Exp $
d15 1
a15 1
CMAKE_ARGS+=	-DWITH_WERROR_UNINITIALIZED_FLAG=0
@


1.11
log
@cmocka: finish conversion to cmake/build.mk
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.10 2023/01/24 18:36:21 wiz Exp $
d3 1
a3 1
DISTNAME=	cmocka-1.1.5
@


1.10
log
@*: convert to cmake/build.mk
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.9 2020/07/03 16:08:46 hauke Exp $
a12 3
CONFIGURE_DIRS=	${WRKDIR}/build
CMAKE_ARG_PATH=	${WRKSRC}

a16 3
post-extract:
	${MKDIR} ${WRKDIR}/build

@


1.9
log
@Have a 't'...
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.8 2019/11/23 07:23:57 mef Exp $
a12 2
USE_CMAKE=	yes

d23 1
@


1.8
log
@(devel/cmocka) Updated 1.1.3 to 1.1.5

Thu Mar 28 2019 Andreas Schneider <asn@@cryptomilk.org>
    * cmocka version 1.1.5
    * Added cmocka_set_skip_filter()

Thu Mar 28 2019 Andreas Schneider <asn@@cryptomilk.org>
    * cmocka version 1.1.4
    * Added assert_float(_not)_equal()
    * Added expect_any_always()
    * Small bug fixes
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.7 2019/01/21 07:39:48 maya Exp $
d10 1
a10 1
COMMENT=	Unit testing framework for C supporing mock objects
@


1.7
log
@cmocka: avoid -Werror=uninitialized which incorrectly fires on wrong code
by GCC 4.3/4.4

Reported in https://github.com/NetBSD/pkgsrc/pull/41
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6 2018/12/03 15:16:33 adam Exp $
d3 1
a3 1
DISTNAME=	cmocka-1.1.3
@


1.6
log
@cmocka: updated to 1.1.3

cmocka version 1.1.3
* Fixed subunit output on failures
* Do not abort if a test is skipped
* Switched to Modern CMake

cmocka version 1.1.2
* Added function to filter tests (cmocka_set_test_filter)
* Added new mocking example (uptime)
* Fixed fixture error reporting
* Fixed compiler flags detection
* Some improvement for API documentation

cmocka: version 1.1.1
* Fixed TAP output
* Fixed cmocka on Windows x64
* Fixed xUnit output durations

cmocka: version 1.1.0
* Added support to catch multiple exceptions
* Added support to verify call ordering
* Added support to pass initial data to test cases
* Added will_return_maybe() for ignoring mock returns
* Added subtests for groups using TAP output
* Added support to write multiple XML files for groups
* Improved documentation
* Fixed XML output generataion
* Fixed Windows builds with VS2015
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.5 2018/02/02 10:31:07 jperkin Exp $
d18 4
@


1.5
log
@cmocka: Avoid insane build layout, no functional change.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.4 2016/08/06 15:03:30 mef Exp $
d3 1
a3 1
DISTNAME=	cmocka-1.0.1
d5 1
a5 1
MASTER_SITES=	https://cmocka.org/files/1.0/
d9 1
a9 1
HOMEPAGE=	https://cmocka.org/files/1.0/
@


1.4
log
@Updated devel/cmocka to 1.0.1
-----------------------------
Thu Mar 12 2015 Andreas Schneider <asn@@cryptomilk.org>
    * cmocka: version 1.0.1
    * Added a macro for assert_ptr_equal().
    * Fixed test_realloc() if 0 size is passed.
    * Fixed objects packaging bug.
    * Fixed building with newer gcc versions.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.3 2015/03/31 22:03:48 wiz Exp $
d14 3
a16 2
WRKSRC=		${WRKDIR}/${DISTNAME}/build
CMAKE_ARG_PATH=	${WRKDIR}/${DISTNAME}
d19 1
a19 2
		mkdir -p ${WRKSRC}
		rm -f ${WRKDIR}/${DISTNAME}/CMakeCache.txt
@


1.3
log
@Remove FETCH_USING, not package-setable.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.2 2015/03/31 15:11:16 joerg Exp $
d3 1
a3 1
DISTNAME=	cmocka-1.0.0
@


1.2
log
@Relocate build under ${WRKSRC} to simplify patching. Create build
directory in post-extract.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.1 2015/02/27 04:23:43 manu Exp $
a12 2
FETCH_USING=	curl

@


1.1
log
@Import cmocka-1.0.0, the successo of cmockery

cmocka is an elegant unit testing framework for C with support for
mock objects. It only requires the standard C library, works on a
range of computing platforms (including embedded) and with different
compilers.
@
text
@d1 1
a1 1
# $NetBSD$
d16 1
a16 1
WRKSRC=		${WRKDIR}/build
d19 1
a19 1
pre-configure:
@

