Skip to content

Support custom defines for unittest definitions #104

Closed
@hlovdal

Description

@hlovdal

In the platform definitions it is possible to inject custom preprocessor defines to be used, e.g.

  leonardo:
    board: ...
    package: ...
    gcc:
      features:
      defines:
        - MY_CUSTOM_DEFINE
      warnings:
      flags:

What I am missing is for this to be possible to do for unittest definitions (UNITTEST_SCHEMA) in .arduino-ci.yaml as well, e.g.

unittest:
  libraries:
    - SomeLibrary
  defines:
    - SKIP_LCD_TESTS    # all unit tests
  platforms:
    - uno
        defines:
          - USE_FAKE_KEYBOARD    # only uno unit tests
    - leonardo

In addition to defines a compiler_argument option would be applicable to be able to give arguments like -g -O0 --coverage --std=c++98 ....

Currently I am just adding ret += [ "-DUNIT_TEST", "-g", "--coverage" ] in test_args, but it would be great to not have to modify arduino_ci.

This would be applicable for compile as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ci scriptsThe test runner scriptsnot yetAwaits better environmental conditionsunittest libsThe assert / assure / unittest reporting apparatus is affected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions