#!/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 = 'Eigenvalues',
      to_re       = 'HOMO - LUMO',
      rel_tolerance   = 1.0e-5)
f.add(from_string = 'Energy eigenvalues in atomic units',
      to_re       = 'Total average',
      rel_tolerance   = 1.0e-4)

test.run(['4dcg_mmf_x.inp', '4dcg_mmf_xx.inp', '2dcg_x2c.inp', '2dcg_mmf.inp'], ['fo.mol'], f, args='--mw=110 --aw=120')

sys.exit(test.return_code)
