ppx_inline_test Last updated Mar 18, 2025

ppx_inline_test

load("@rules_ppx//build:rules.bzl", "ppx_inline_test")

ppx inline test doc…​

Attributes

Name Description Type Mandatory Default

name

A unique name for this macro instance. Normally, this is also the name for the macro's main or only target. The names of any other targets that this macro might create will be this name with a string suffix.

Name

required

data

Runtime dependencies: list of labels of data files needed by this executable at runtime.

List of labels

optional

None

cc_deps

Dictionary specifying C/C++ library dependencies. Key: a target label; value: a linkmode string, which determines which file to link. Valid linkmodes: 'default', 'static', 'dynamic', 'shared' (synonym for 'dynamic'). For more information see [CC Dependencies: Linkmode](../ug/cc_deps.md#linkmode).

Dictionary: Label -> String

optional

None

cc_libs

-

List of labels

optional

None

cc_linkall

True: use `-whole-archive` (GCC toolchain) or `-force_load` (Clang toolchain). Deps in this attribute must also be listed in cc_deps.

List of labels

optional

None

cc_linkopts

List of C/C++ link options. E.g. ["-lstd++"].

List of strings

optional

None

compatible_with

Inherited rule attribute

List of labels; nonconfigurable

optional

None

data_prefix_map

Map for replacing path prefixes of data files

Dictionary: String -> String

optional

None

deprecation

Inherited rule attribute

String; nonconfigurable

optional

None

diff_cmd

-

Label

optional

None

env

Env variables

Dictionary: String -> String

optional

None

epilogue

List of OCaml dependencies to be linked after `main`.

List of labels

optional

None

exe_name

By default, executable name is derived from 'name' attribute; use this to override.

String

optional

None

exec_compatible_with

Inherited rule attribute

List of labels; nonconfigurable

optional

None

exec_properties

Inherited rule attribute

Dictionary: String -> String

optional

None

features

Inherited rule attribute

List of strings

optional

None

flaky

Inherited rule attribute

Boolean; nonconfigurable

optional

None

force_archived_libdeps

Force archiving of library dependencies

Boolean

optional

None

local

Inherited rule attribute

Boolean; nonconfigurable

optional

None

opts

List of compile options; overrides configurable default options. Supports `+-no-+` prefix for each option; for example, `-no-linkall`.

List of strings

optional

None

package_metadata

Inherited rule attribute

List of labels; nonconfigurable

optional

None

prologue

List of OCaml dependencies to be linked before `main`.

List of labels

optional

None

restricted_to

Inherited rule attribute

List of labels; nonconfigurable

optional

None

runtime

Runtime to use. One of @rules_ocaml//rt:std, @rules_ocaml//rt:dbg, @rules_ocaml//rt:instrumented; or, label of an `ocaml_runtime` target creating a custom runtime.

@rules_ocaml//rt:dbg will set `-runtime-variant d`; @rules_ocaml//rt:instrumented will set `-runtime-variant i`; a custom label will set `-use-runtime`.

Label

optional

None

shard_count

Inherited rule attribute

Integer

optional

None

size

Inherited rule attribute

String; nonconfigurable

optional

None

tags

Inherited rule attribute

List of strings; nonconfigurable

optional

None

target_compatible_with

Inherited rule attribute

List of labels

optional

None

testonly

Inherited rule attribute

Boolean; nonconfigurable

optional

None

testsuites

testsuites ...

List of strings; nonconfigurable

required

timeout

Inherited rule attribute

String; nonconfigurable

optional

None

toolchains

Inherited rule attribute

List of labels

optional

None

visibility

The visibility to be passed to this macro's exported targets. It always implicitly includes the location where this macro is instantiated, so this attribute only needs to be explicitly set if you want the macro's targets to be additionally visible somewhere else.

List of labels; nonconfigurable

optional

vm_linkage

custom, dynamic or static. Custom means link with -custom flag; static with -output-complete-exe

String

optional

None