#!/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 = ' Overview of calculated energies',
      num_lines   = 12,
      rel_tolerance   = 1.0e-7)
f.add(from_string = 'Dipole length: X',
      to_string   = 's0 = T : Expectation value zero by point group symmetry.',
      rel_tolerance   = 1.0e-5,
      ignore_below = 1.0e-9)

mol_files = []
mol_files.append('C2H4Cl2_ec1_c2v.mol')
mol_files.append('C2H4Cl2_sta_c2h.mol')
mol_files.append('C2H4Cl2_ec2_c2.mol')
mol_files.append('C2H4Cl2_ec1_cs2.mol')
mol_files.append('C2H4Cl2_sta_ci.mol')
mol_files.append('C2H4Cl2_ec2_c1.mol')
mol_files.append('C2H4Cl2_ec1_cs1.mol')
mol_files.append('C2H4Cl2_sta_cs.mol')
mol_files.append('C2H4Cl2_ec1_c2.mol')
mol_files.append('C2H4Cl2_sta_c2.mol')
mol_files.append('C2H4Cl2_ec1_c1.mol')
mol_files.append('C2H4Cl2_sta_c1.mol')

test.run(['cc.inp'], mol_files, f)

sys.exit(test.return_code)
