Add begin/end hooks to scan_action

This is so that we can have code to generate reports in a generic
manner (i.e. from the generic 'report' subcommand).  Some output formats
may want to print a header or footer and we shouldn't do that from the
caller code on a case-by-case basis.
Add the utils::text::escape_xml function

This allows escaping XML special characters so that we can output
verbatim text as part of an XML/HTML file.
Add a JUnit output format to the 'report' command

This is mostly so that we can transparently plug the results of the
execution of the FreeBSD test suite into Jenkins.
Merge branch 'report-junit'

This adds a new 'junit' format to the existing report command.

However, I am now not too happy about this for the same reasons I
originally created the separate 'report-html' command.  For example:
the --show-context and --results-filter flags to junit don't really
make any sense given that we should be including these unconditionally
in the output.  Why?  Because outputting the context has no
ill-effects and applying a filter (the default!) causes the junit
test counts to be broken.

Stay tuned... I may need to revert the generalization applied to the
'report' command earlier on.  Luckily, this has not been pushed out
in a release yet!
Fix infinite loop when parsing very long results

If the result reason is big enough and it contains newlines, the expanded
version that we construct by replacing '\n' with '<<NEWLINE>>' triggers a
bug that causes our algorithm to get stuck in an infinite loop.  This is
because fgets() with a 1-byte long buffer won't ever return any data as
the function is guaranteed to NULL-terminate the buffer.

Workaround this problem and add a test for it.
Add a new 'report-junit' command

Because of the semantics of the JUnit output, it does not make much sense
to try to shovel this format into the 'report' command.  For example:
there is no reason to honor the --show-context flag, and honoring the
--results-filter flag means that the generated reports are misleading due
to invalid total test counts.  (My original separation of the HTML format
into 'report-html' seems to have proven right...)

Removal of the JUnit support from the 'report' command, as well as other
reorganizations, will come later.
Remove multiformat support from the report command

This re-removes the ability to specify the format type from the report
command.  We have separate commands for each of the supported output
formats given that the customization options they support are different
from each other.
Misc improvements to the kyua-report* manpages

Cross-reference the various report generation commands from each other.
Also do not mention that the database is created when it does not exist;
it is not.
Get rid of the file_writer object

Instead, just use a simple function to obtain a pointer to the ostream
to use for output, be it cout, cerr or any other file.
Remove unused results filtering from report-junit

This is a leftover from when the JUnit output was part of the regular
'report' command and is not necessary any longer.
Merge the console report hooks into the command

Now that 'report' is once again used specifically for the console
reports, merge the report generation hooks back into the command
itself.
Move report_junit to the engine

Generating a JUnit report does not belong in the frontend given that the
contents of this report are defined externally by the JUnit format and not
our interface.
Remove unused context filtering from report-junit

This is a leftover from when the JUnit output was part of the regular
'report' command and is not necessary any longer.
Add a close() method to the store::backend

This is only so that we can close the store explicitly without having
to make it go out of context -- which looks quite ugly in tests.
Add unit-tests for the report_junit module
Add test case metadata values to the JUnit output

Because the JUnit schema is unable to represent this, we have to abuse
the stderr of the test case to write this information to.
Add support for expected failures to JUnit reports

Because the JUnit report does not support this test case result, just
record this fact and the corresponding reason in the test's stderr.
Merge branch 'report-junit-refactor'

This merge moves the JUnit report format to its own 'report-junit' command
and therefore undoes most of the recent refactorings to make the 'report'
command more generic.  Because of the significantly different behavior of
all different output types, it does not make sense to try to funnel them
through a single command.

Additionally, this improves the JUnit report format by adding new features
such as the ability to record the test case metadata, the ability to
represent expected failures and much improved testing.
Add skipped result reasons to JUnit reports

Do as we did with expected failures: attach the reason for skipped results
to the stderr of the test cases.
Merge remote-tracking branch 'upstream/master'