Use 'dump' consistently to mean 'to screen' (stderr), and 'save' to mean
'to disk'.
This commit is contained in:
Kartik Agaram 2018-07-25 22:25:12 -07:00
parent 15152795ce
commit b2e36ec827
4 changed files with 8 additions and 8 deletions

View File

@ -117,7 +117,7 @@ struct trace_stream {
return *curr_stream;
}
void dump() {
void save() {
ofstream fout("last_run");
fout << readable_contents("");
fout.close();
@ -220,7 +220,7 @@ struct lease_tracer {
lease_tracer::lease_tracer() { Trace_stream = new trace_stream; }
lease_tracer::~lease_tracer() {
if (!Trace_stream) return; // in case tests close Trace_stream
if (Save_trace) Trace_stream->dump();
if (Save_trace) Trace_stream->save();
delete Trace_stream, Trace_stream = NULL;
}
:(before "End Includes")

View File

@ -227,7 +227,7 @@ transform_all();
//? DUMP("");
//? exit(0);
if (trace_contains_errors()) {
if (Start_tracing && Trace_stream) Trace_stream->dump();
if (Start_tracing && Trace_stream) Trace_stream->save();
return 1;
}
save_snapshots();
@ -245,7 +245,7 @@ if (!Run_tests && contains_key(Recipe_ordinal, "main") && contains_key(Recipe, g
trace(2, "run") << "=== Starting to run" << end();
assert(Num_calls_to_transform_all == 1);
run_main(argc, argv);
if (Start_tracing && Trace_stream) Trace_stream->dump();
if (Start_tracing && Trace_stream) Trace_stream->save();
}
:(code)
void run_main(int argc, char* argv[]) {
@ -266,7 +266,7 @@ else if (is_equal(*arg, "--trace")) {
void cleanup_main() {
if (!Trace_stream) return;
if (Save_trace)
Trace_stream->dump();
Trace_stream->save();
delete Trace_stream;
Trace_stream = NULL;
}
@ -422,7 +422,7 @@ void run(const string& form) {
transform_all();
if (tmp.empty()) return;
if (trace_contains_errors()) {
if (Start_tracing && Trace_stream) Trace_stream->dump();
if (Start_tracing && Trace_stream) Trace_stream->save();
return;
}
// if a test defines main, it probably wants to start there regardless of

View File

@ -179,7 +179,7 @@ case _SAVE_TRACE: {
}
:(before "End Primitive Recipe Implementations")
case _SAVE_TRACE: {
if (Save_trace) Trace_stream->dump();
if (Save_trace) Trace_stream->save();
break;
}

View File

@ -229,7 +229,7 @@ void run_mu_scenario(const scenario& s) {
if (!Hide_errors && trace_contains_errors() && !Scenario_testing_scenario)
Passed = false;
if (not_already_inside_test && Trace_stream) {
if (Save_trace) Trace_stream->dump();
if (Save_trace) Trace_stream->save();
delete Trace_stream;
Trace_stream = NULL;
}