#!/usr/bin/env python

import os
import sys
import subprocess

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 = ' Energy eigenvalues in atomic units',
      to_re       = 'Relative real eigenvalues in other units;',
      rel_tolerance   = 2.0e-5)

f.add(from_string = 'Isotropic oscillator strengths (full light-matter interaction) above threshold',
      to_string   = 'Sum of oscillator strengths (general length) :',
      ignore_below = 1.0e-12,
      rel_tolerance   = 2.0e-4)

f.add(from_string = 'Anisotropic oscillator strengths (full light-matter interaction) above threshold',
      to_string   = 'Sum of oscillator strengths (general length) :',
      rel_tolerance   = 2.0e-4)

test.run(['AnisotropicKedge.inp'], ['H2O.xyz'], f)

sys.exit(test.return_code)
