#!/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 = 'Sum of all contributions to the energy',
      num_lines   = 2,
      rel_tolerance   = 1.0e-9)
f.add(from_string = '  Retrieving MP2 density matrix from file',
      to_string   = '* Electric field at nuclei',
      rel_tolerance   = 0.001)
f.add(from_string = '* Electric field at nuclei:',
      to_string   = '1 a.u. = 234.96474170 MHz',
      rel_tolerance   = 0.00002)

test.run(['mp2_gradient.inp','mp2mmf_gradient.inp'], ['H2O2.mol'], f, args='--mw=60 --aw=140')

sys.exit(test.return_code)
