Skip to content

Commit

Permalink
Clean up temp .out files after execution
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar committed Nov 5, 2016
1 parent 01a0d68 commit cb413f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/tcframe/runner/Runner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ class Runner {
Config config = parseConfig(argv[0]);
Spec spec = buildSpec(config, runnerLogger);

int result;
if (args.command() == Args::Command::GEN) {
return generate(args, spec);
result = generate(args, spec);
} else {
return submit(args, spec);
result = submit(args, spec);
}
cleanUp();
return result;
} catch (...) {
return 1;
}
Expand Down Expand Up @@ -157,6 +160,10 @@ class Runner {
submitter->submit(spec.testSuite(), subtaskIds, submitterConfig);
return 0;
}

void cleanUp() {
os_->execute(ExecutionRequestBuilder().setCommand("rm _*.out").build());
}
};

}
2 changes: 2 additions & 0 deletions test/tcframe/runner/RunnerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class RunnerTests : public Test {
ON_CALL(runnerLoggerFactory, create(_)).WillByDefault(Return(&runnerLogger));
ON_CALL(generatorFactory, create(_, _, _, _)).WillByDefault(Return(&generator));
ON_CALL(submitterFactory, create(_, _)).WillByDefault(Return(&submitter));
ON_CALL(os, execute(_)).WillByDefault(Return(
ExecutionResult(ExecutionInfoBuilder().setExitCode(0).build(), nullptr, nullptr)));
}
};

Expand Down

0 comments on commit cb413f1

Please sign in to comment.