Import('env')
Import('pdb2pqr')
Import('setupTest')
import sys


commandLineStart = sys.executable + ' ' + str(pdb2pqr[0])
testList = []

#PDB2PKA Test

for residue in ('1a1p', '1etm', '1yzm', '2gus', '2m0w', '4g3o'):

    runTest = env.Command([residue+'/pdb2pka-output-user', residue+'/test-output-user.pqr'], residue+'/'+residue+'.pdb',
	                      commandLineStart + ' --with-ph=7.00 --ph-calc-method=pdb2pka --pdb2pka-out=${TARGETS[0]} --ff=PARSE $SOURCE ${TARGETS[1]}')

    validateTitrationCurveResult = env.Command(residue+'/titcurve.result', [residue+'/pdb2pka-output-user', residue+'/pdb2pka-output-correct'],
	                                			CompareTitCurves('$TARGET', '${SOURCES[0]}', '${SOURCES[1]}'))

    validatePQRResult = env.Command(residue+'/pqr.result', [residue+'/test-output-user.pqr', residue+'/test-output-correct.pqr'],
	                                ComparePQR('$TARGET', '${SOURCES[0]}', '${SOURCES[1]}'))

    env.Clean(runTest, residue+'/pdb2pka-output-user')

    aliasObj = setupTest('pdb2pka-test', runTest, [validateTitrationCurveResult, validatePQRResult])