#!/usr/bin/env python
"""Test cppcheck-htmlreport."""
import os
import contextlib
import shutil
import subprocess
import sys
import tempfile
if sys.version_info < (2, 7):
# For TestCase.assertIn().
import unittest2 as unittest
else:
import unittest
ROOT_DIR = os.path.split(os.path.abspath(os.path.dirname(__file__)))[0]
CPPCHECK_BIN = os.path.join(ROOT_DIR, 'cppcheck')
HTML_REPORT_BIN = os.path.join(os.path.abspath(os.path.dirname(__file__)),
'cppcheck-htmlreport')
class TestHTMLReport(unittest.TestCase):
def testReportError(self):
with runCheck(os.path.join(
ROOT_DIR,
'samples', 'memleak', 'bad.c')) as (report, output_directory):
self.assertIn('