#!/usr/bin/env python

import subprocess
import os

def setup_module(module):
    THIS_DIR = os.path.dirname(os.path.abspath(__file__))
    os.chdir(THIS_DIR)

def teardown_module(module):
    cmd = ["make clean"]
    cmdOutput = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)


def test_1():
    cmd = ["make"]
    cmdOutput = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)

    passed = False
    for l in cmdOutput.decode('utf-8').split("\n"):
        if "#FPCHECKER: main() found" in l:
            passed = True

    assert passed == True


[(8, 'os.chdir', 'os.chdir', False, 'import os\n'), (12, 'subprocess.check_output', 'subprocess.check_output', False, 'import subprocess\n'), (17, 'subprocess.check_output', 'subprocess.check_output', False, 'import subprocess\n'), (7, 'os.path.abspath', 'os.path.abspath', False, 'import os\n')]