#!/usr/bin/env python

import os
import sys


sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dirac import Filter, TestRun
from exacorr_environment import set_exacorr_environment

set_exacorr_environment()

test = TestRun(__file__, sys.argv)

#f1 = Filter()
#f1.add(from_string = 'Total energy',
#      num_lines   = 1,
#      rel_tolerance   = 1.0e-9)

f2 = Filter()
f2.add(from_string = 'Final results from EXACORR',
      num_lines   = 8,
      abs_tolerance   = 1.0e-6)
f2.add(from_string = 'Norm of Fock matrix (OO',
      num_lines   = 1,
      abs_tolerance   = 1.0e-4)
f2.add(from_string = 'Norm of Fock matrix (OV',
      num_lines   = 1,
      abs_tolerance   = 1.0e-3)
f2.add(from_string = 'Norm of Fock matrix (VV',
      num_lines   = 1,
      abs_tolerance   = 1.0e-2)

#test.run(['scf_beh.inp'], ['BeH_nosym.mol'], f1,"--get='X2CMAT AOMOMAT DFCOEF'")
test.run(['talsh_cc_beh.inp'], ['BeH_nosym.mol'], f2, "--put='X2CMAT AOMOMAT'")
test.run(['talsh_cc_beh_level.inp'], ['BeH_nosym.mol'], f2, "--put='X2CMAT AOMOMAT'")

sys.exit(test.return_code)
