New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use initlog() in more tests. #14719
Use initlog() in more tests. #14719
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the conversion did not completely work for a small number of tests.
These required a small amount of manual tidying-up but the script I used to generate most of the changes is #!/usr/bin/env python3 import sys lines = list() skip_next_if_blank = False with open(sys.argv[1], 'r') as handle: for line in handle: if line != 'std::ofstream logfile("output");\n': if "deallog.attach" not in line: if skip_next_if_blank and line == "\n": pass else: lines.append(line.replace("logfile", "deallog.get_file_stream()")) skip_next_if_blank = False else: skip_next_if_blank = True found_main = False line_after_main = -1 with open(sys.argv[1], 'w') as handle: for line in lines: handle.write(line) if line.startswith("main("): found_main = True if found_main: line_after_main = line_after_main + 1 if line_after_main == 1: handle.write(" initlog();\n")
The tests passed locally for me but it's worth cleaning things up - both comments should now be fixed in all files. |
@tamiko is still blocking the merge. I'll let him comment/pull the trigger. |
@bangerth Feel free to simply dismiss such a change request from me as "resolved" in the future. |
Part of #4250. I was reminded of this when reviewing one of the PETSc patches - its pretty easy to automatically convert many of these with a python script.