@Test public void runTests() { final ImmutableList<String> command = ImmutableList.of("hello", "world"); FakeCxxTest cxxTest = new FakeCxxTest() { @Override protected ImmutableList<String> getShellCommand(ExecutionContext context, Path output) { return command; } }; BuildContext buildContext = FakeBuildContext.NOOP_CONTEXT; ExecutionContext executionContext = TestExecutionContext.newInstance(); TestRunningOptions options = TestRunningOptions.builder() .setDryRun(false) .setTestSelectorList(TestSelectorList.empty()) .build(); ImmutableList<Step> actualSteps = cxxTest.runTests( buildContext, executionContext, options, FakeTestRule.NOOP_REPORTING_CALLBACK); CxxTestStep cxxTestStep = new CxxTestStep( new FakeProjectFilesystem(), command, ImmutableMap.<String, String>of(), cxxTest.getPathToTestExitCode(), cxxTest.getPathToTestOutput(), TEST_TIMEOUT_MS); assertEquals(cxxTestStep, Iterables.getLast(actualSteps)); }