[test] Environment variable on forcing stats tests
Statistics checker-related tests should be forced in an environment
which contains an underlying Clang that supports this feature.
Automatic detection is not enough because there may be a bug in the
automatic detection itself.
""" statistics collector feature test. """
+from distutils import util
import os
import unittest
import shlex
@@ -48,6 +49,13 @@ class TestSkeleton(unittest.TestCase):
print("'analyze' reported statistics collector-compatibility? " +
str(self.stats_capable))
+ if not self.stats_capable:
+ try:
+ self.stats_capable = bool(util.strtobool(
+ os.environ['CC_TEST_FORCE_STATS_CAPABLE']))
+ except (ValueError, KeyError):
+ pass
+
test_project_path = self._testproject_data['project_path']
test_project_build = shlex.split(self._testproject_data['build_cmd'])
test_project_clean = shlex.split(self._testproject_data['clean_cmd'])
