Both fxrunner's main and fxrecorder's main did basically the same thing
(set up a logger, read options from the command-line, and then call a
function with the logger and options). In addition, both called
functions also read in a config file, where the path was given by the
command-line options. They also redefined the same Error enum.
This has been abstracted into the `fxrecord::run` function, which does
all of the above. We are now returning a `Result<(), Box<dyn Error>>`
because at the top level all errors are unexpected. Additionally, A
`CommonOptions` trait has been introduced so that `fxrecord::run` can
load the config to pass to the runnable.
This crate is split up into a library and two binaries:
- fxrunner: the binary responsible for running Firefox on the reference
hardware;
- fxrecorder: the binary responsible for doing frame capture; and
- fxrecord: the library with common code for both fxrunner and
fxrecorder.
The configuration for both fxrunner and fxrecorder is parsed from a TOML
file (configurable via the `--config` command-line option). For ease of
development, the fxrunner and fxrecorder configuration are both able to
be included in a single config file (`fxrecord.toml`) using sections. An
example configurationf ile (`fxrecord.example.toml`) is provided.