Don't generate junit report for functional test unless being asked to
Summary:
The current behavior is to generate the report by defauly, but the
feature is only used by CI. This diff changes this behavior to only
create the report file if the --junitoutput option is set.
This fixes an old issue where the test/tmp directory was not correctly
emptied after running the functional tests due to the junit file not
being removed.
Depends on D7004.
Test Plan:
ninja check-functional
Check the test/tmp dir is empty and not junit file is generated.
cmake -GNinja .. -DENABLE_JUNIT_REPORT=ON ninja check-functional
Check the test/junit directory contains the report and the test/tmp
directory is empty.
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D7058