Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 6.44 KB

fsharp_test.md

File metadata and controls

54 lines (42 loc) · 6.44 KB

Rule for compiling and running test binaries.

This rule can be used to compile and run any F# binary and run it as a Bazel test.

fsharp_test

load("@rules_dotnet//dotnet/private/rules/fsharp:test.bzl", "fsharp_test")

fsharp_test(name, deps, srcs, data, resources, out, appsetting_files, compile_data,
            compiler_options, defines, envs, generate_documentation_file, internals_visible_to,
            keyfile, langversion, nowarn, project_sdk, roll_forward_behavior, target_frameworks,
            treat_warnings_as_errors, warning_level, warnings_as_errors, warnings_not_as_errors,
            winexe)

Compile a F# executable and runs it as a test

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
deps Other libraries, binaries, or imported DLLs List of labels optional []
srcs The source files used in the compilation. List of labels optional []
data Runtime files. It is recommended to use the @rules_dotnet//tools/runfiles library to read the runtime files. List of labels optional []
resources A list of files to embed in the DLL as resources. List of labels optional []
out File name, without extension, of the built assembly. String optional ""
appsetting_files A list of appsettings files to include in the output directory. List of labels optional []
compile_data Additional compile time files. List of labels optional []
compiler_options Additional options to pass to the compiler. This attribute should only be used if the compiler flag has not already been exposed as an attribute. List of strings optional []
defines A list of preprocessor directive symbols to define. List of strings optional []
envs A dictionary of environment variables to set when the binary is run. Supports make variable expansion Dictionary: String -> String optional {}
generate_documentation_file Whether or not to generate a documentation file. Boolean optional True
internals_visible_to Other libraries that can see the assembly's internal symbols. Using this rather than the InternalsVisibleTo assembly attribute will improve build caching. List of strings optional []
keyfile The key file used to sign the assembly with a strong name. Label optional None
langversion The version string for the language. String optional ""
nowarn List of warnings that should be ignored List of strings optional []
project_sdk The project SDK that is being targeted. See https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview String optional "default"
roll_forward_behavior The roll forward behavior that should be used: https://learn.microsoft.com/en-us/dotnet/core/versions/selection#control-roll-forward-behavior String optional "Major"
target_frameworks A list of target framework monikers to buildSee https://docs.microsoft.com/en-us/dotnet/standard/frameworks List of strings required
treat_warnings_as_errors Treat all compiler warnings as errors. Note that this attribute can not be used in conjunction with warnings_as_errors. Boolean optional False
warning_level The warning level that should be used by the compiler. Integer optional 3
warnings_as_errors List of compiler warning codes that should be considered as errors. Note that this attribute can not be used in conjunction with treat_warning_as_errors. List of strings optional []
warnings_not_as_errors List of compiler warning codes that should not be considered as errors. Note that this attribute can only be used in conjunction with treat_warning_as_errors. List of strings optional []
winexe If true, output a winexe-style executable, otherwiseoutput a console-style executable. Boolean optional False