From 6e168cced1fee5d7399a16d85cd13a94f6fbdb4e Mon Sep 17 00:00:00 2001 From: gwirn <71886945+gwirn@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:22:27 +0100 Subject: [PATCH] added tests --- tests/test.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/test.sh diff --git a/tests/test.sh b/tests/test.sh new file mode 100644 index 0000000..6b8dcfe --- /dev/null +++ b/tests/test.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +nomiss=$(../target/debug/psatm ../example/gb1.pdb ./gb1_test_out.pdb) +onemiss=$(../target/debug/psatm ../example/gb1_missing.pdb ./gb1_missing_test_out.pdb ) + +if [[ ! $(echo $nomiss | wc -l) -eq 1 ]]; then + echo "FAILED: Warning when could not generate all pseudoatoms even no atoms are missing" + echo $nomiss + exit 1 +else + echo "PASS: Warning pseudoatom with no missing atoms" +fi + +if echo $onemiss | grep -q 'Not able to calculate pseudoatom for \[ GLU A 42 \]'; then + echo "FAILED: Warning for wrong output for one missing side chain (GLU A 42) that should yield in one impossible calculation" + echo $onemiss + exit 1 +else + echo "PASS: Warning pseudoatom calculation with one missing side chain" +fi + +if ! cmp --silent ../example/gb1_out.pdb ./gb1_test_out.pdb;then + echo "FAILED: no missing sidechain generates wrong output file" + exit 1 +else + echo "PASS: No missing side chain file generated" +fi + +if ! cmp --silent ../example/gb1_missing_out.pdb ./gb1_missing_test_out.pdb;then + echo "FAILED: missing sidechain generates wrong output file" + exit 1 +else + echo "PASS: missing side chain file generated" +fi