Skip to content
Snippets Groups Projects
  • Nat Goodspeed's avatar
    2ae9f921
    Refactor llprocesslauncher_test.cpp for better code reuse. · 2ae9f921
    Nat Goodspeed authored
    Instead of free python() and python_out() functions containing a local
    temporary LLProcessLauncher instance, with a 'tweak' callback param to
    "do stuff" to that inaccessible object, change to a PythonProcessLauncher
    class that sets up a (public) LLProcessLauncher member, then allows you to
    run() or run() and then readfile() the output. Now you can construct an
    instance and tweak to your heart's content -- without funky callback syntax --
    before running the script.
    Move all such helpers from TUT fixture struct to namespace scope. While
    fixture-struct methods can freely call one another, introducing a nested class
    gets awkward: constructor must explicitly require and bind a fixture-struct
    pointer or reference. Namespace scope solves this.
    (Truthfully, I only put them in the fixture struct originally because I
    thought it necessary for calling ensure() et al. But ensure() and friends are
    free functions; need only qualify them with tut:: namespace.)
    2ae9f921
    History
    Refactor llprocesslauncher_test.cpp for better code reuse.
    Nat Goodspeed authored
    Instead of free python() and python_out() functions containing a local
    temporary LLProcessLauncher instance, with a 'tweak' callback param to
    "do stuff" to that inaccessible object, change to a PythonProcessLauncher
    class that sets up a (public) LLProcessLauncher member, then allows you to
    run() or run() and then readfile() the output. Now you can construct an
    instance and tweak to your heart's content -- without funky callback syntax --
    before running the script.
    Move all such helpers from TUT fixture struct to namespace scope. While
    fixture-struct methods can freely call one another, introducing a nested class
    gets awkward: constructor must explicitly require and bind a fixture-struct
    pointer or reference. Namespace scope solves this.
    (Truthfully, I only put them in the fixture struct originally because I
    thought it necessary for calling ensure() et al. But ensure() and friends are
    free functions; need only qualify them with tut:: namespace.)
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
llprocesslauncher_test.cpp 19.08 KiB