Azure / Azure/umock-c

MOCKABLE_FUNCTION ->header ->code

Open
#242 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
36
Forks
27
Avg merge
32m
Merged PRs (30d)
3

Description

Right now the behavior or MOCKABLE_FUNCTION is that between `#define ENABLE_MOCKS` / `#undef ENABLE_MOCKS` will generate code.

This improvement wants to have MOCKABLE_FUNCTION generate SEPARATE "proper declarations for a header" and "proper definitions for a source file", possibly based on some more #defines, suggestions would be along the lines of `ENABLE_HEADER_MOCKS` / `ENABLE_SOURCE_MOCKS`.

This will greatly reduce compilation time, as the "source file" would only need be compiled once (and then used as object). This would also allow use of precompiled headers (maybe), but would greatly reduce our huge compilation times as we'd have a c_util_mocks library that would be compiled/linked once and re-used everywhere where any component of it would be used.

Best Regards,
Andrei Porumb

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the MOCKABLE_FUNCTION macro and the ENABLE_MOCKS / #undef ENABLE_MOCKS usage described in the issue. Define how separate header declarations and source definitions should be generated, including the proposed mock-library reuse, then verify that the resulting source compiles once and can be linked by consumers.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.