build+ci: add code coverage support

This commit also adds GlobalConfigurationFixture to ensure that running
unit tests doesn't interact with system configuration (e.g., doesn't use
or alter user certificates).

Change-Id: I621ce14425a777c94d41b8132cd2858d91235b4d
Refs: #3808
diff --git a/wscript b/wscript
index 07a7524..42cb690 100644
--- a/wscript
+++ b/wscript
@@ -9,7 +9,8 @@
 
 def options(opt):
     opt.load(['compiler_cxx', 'gnu_dirs'])
-    opt.load(['default-compiler-flags', 'sanitizers', 'sphinx_build', 'boost'],
+    opt.load(['default-compiler-flags', 'coverage', 'sanitizers', 'boost',
+              'sphinx_build'],
              tooldir=['.waf-tools'])
 
     opt.add_option('--with-tests', action='store_true', default=False,
@@ -33,6 +34,9 @@
         boost_libs += ' unit_test_framework'
     conf.check_boost(lib=boost_libs)
 
+    # Loading "late" to prevent tests from being compiled with profiling flags
+    conf.load('coverage')
+
     conf.recurse('tools')
 
     conf.load('sanitizers')