Skip to content
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

Merged
merged 1 commit into from
Jan 25, 2023
Merged

Use initlog() in more tests. #14719

merged 1 commit into from
Jan 25, 2023

Commits on Jan 24, 2023

  1. Use initlog() in more 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")
    drwells committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    d59afbd View commit details
    Browse the repository at this point in the history