Skip to content

Commit

Permalink
get toolchain for test execution from test target
Browse files Browse the repository at this point in the history
Summary:
Currently, we use the toolchain from the test_binary target. This makes it impossible to select the toolchain we execute tests with on a target level.

With this change we can no use the _toolchain attribute on the test targets.

Reviewed By: jcpetruzza

Differential Revision: D51031426

fbshipit-source-id: 3e98253985df16147d1cdf0bdba6303278560b3f
  • Loading branch information
TheGeorge authored and facebook-github-bot committed Nov 8, 2023
1 parent 75d7098 commit 444399c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion prelude/erlang/erlang_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,14 @@ def erlang_test_impl(ctx: AnalysisContext) -> list[Provider]:
# Config files for ct
config_files = [config_file[DefaultInfo].default_outputs[0] for config_file in ctx.attrs.config_files]

test_binary = ctx.attrs._test_binary[RunInfo]
test_binary = ctx.attrs._test_binary[DefaultInfo].default_outputs

trampoline = ctx.attrs._trampoline
cmd = cmd_args([])
if trampoline:
cmd.add(trampoline[RunInfo])

cmd.add(primary_toolchain.otp_binaries.escript)
cmd.add(test_binary)

suite = ctx.attrs.suite
Expand Down

0 comments on commit 444399c

Please sign in to comment.