title: How do I use a precompiled test runner in a bazel test rule?
body: <p>I'm trying to use Bazel with a .NET project, and am using NUnit for my tests. I'm able to use the <a href="https://github.com/bazelbuild/rules_dotnet" rel="nofollow noreferrer">Bazel project's .NET rules</a> to build my assemblies, but that rule set is not helpful for running NUnit3 tests, as the test rules don't respect the output name of the built assembly containing the tests, so I'm attempting my own rules for executing the tests.</p>
  
  <p>It seems like this shouldn't be hard. All I want to do is spawn <code>nunit3-console.exe</code> with the proper arguments using <code>bazel test</code>, but Bazel seems to expect that test rules build an executable binary. The test rule I'm attempting to construct does, indeed, build <em>something</em> (the assembly containing the tests), but not an executable, as I've already got one precompiled (and checked into my source tree, and available to be called).</p>
  
  <p>As near as I can tell, I have to either (1) set the <code>test</code> attribute of my rule to <code>False</code>, meaning it can't be run by <code>bazel test</code>, or (2) build something within the rule that Bazel can see as executable, even if I'm not really wanting to for that test rule. What am I missing? Should I be able to do this? If so, how, and is there a clear example I can examine and learn from?</p>