Skip to content

:unity

Configure Unity’s features

Example :unity YAML

:unity:
  :defines:
    - UNITY_INT_WIDTH=16   # 16 bit processor without support for 32 bit instructions
    - UNITY_EXCLUDE_FLOAT  # No floating point unit

:defines

Adds list of symbols used to configure Unity’s features in its source and header files at compile time.

See Using Unity, CMock & CException for much more on configuring and making use of these frameworks in your build.

To manage overall command line length, these symbols are only added to compilation when a Unity C source file is compiled.

Note

No symbols must be set unless Unity’s defaults are inappropriate for your environment and needs.

Default: [] (empty)

:use_param_tests

Configures Unity test runner generation and #defines for test compilation to support Unity’s parameterized test cases.

Example parameterized test case:

TEST_RANGE([5, 100, 5])
void test_should_handle_divisible_by_5_for_parameterized_test_range(int num) {
  TEST_ASSERT_EQUAL(0, (num % 5));
}

See Unity documentation for more on parameterized test cases.

Default: false

:shuffle_tests

Configures the Unity test runner to shuffle (randomize) the order in which test cases run within a test executable. This is useful for surfacing bugs caused by tests that depend on execution order or on state left behind by an earlier test.

The randomization seed can be pinned to a fixed value for reproducible ordering — see :test_runner ↳ :rng_seed.

Ceedling’s delta builds also work together with shuffled test.

Default: false