#!/usr/bin/env python

import os
import sys

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

test = TestRun(__file__, sys.argv)

f = Filter()
f.add(from_string = 'Electronic energy',
      num_lines   = 8,
      rel_tolerance   = 1.0e-9)
f.add(from_string = 'Individual (non-zero) components',
      to_string   = 'Total contribution to principal components',
      rel_tolerance   = 1.0e-6)

test.run(['zerofield.inp'],           ['HF.p-ccpvdz.mol'], f, '--mw=140 --aw=160          --outcmo')
test.run(['scf.ccsd.1.inp'],          ['HF.p-ccpvdz.mol'], f, '--mw=140 --aw=160 --incmo          ')
test.run(['scf.ccsd.m1.inp'],         ['HF.p-ccpvdz.mol'], f, '--mw=140 --aw=160 --incmo          ')
test.run(['bss+mfsso.zerofield.inp'], ['HF.p-ccpvdz.mol'], f, '                           --outcmo')
test.run(['bss.zerofield.inp'],       ['HF.p-ccpvdz.mol'], f, '                  --incmo  --outcmo')
test.run(['bss.scf.ccsd.1.inp'],      ['HF.p-ccpvdz.mol'], f, '--mw=140 --aw=160 --incmo          ')
test.run(['bss.scf.ccsd.m1.inp'],     ['HF.p-ccpvdz.mol'], f, '--mw=140 --aw=160 --incmo          ')

sys.exit(test.return_code)
