Skip to content

Commit

Permalink
Add new test script
Browse files Browse the repository at this point in the history
  • Loading branch information
evolarjun committed Aug 26, 2021
1 parent 8670311 commit 322b9ca
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions test_amrfinder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

if [ "$1" == "path" ]
then
echo "Testing amrfinder command in your \$PATH"
which amrfinder
AMRFINDER=amrfinder
else
echo "Testing ./amrfinder"
AMRFINDER=./amrfinder
fi

if ! $AMRFINDER --plus -p test_prot.fa -g test_prot.gff -O Escherichia > test_prot.got \
|| ! diff -q test_prot.expected test_prot.got
then
echo "Test failed: "
echo " $AMRFINDER --plus -p test_prot.fa -g test_prot.gff -O Escherichia > test_prot.got"
echo " diff test_prot.expected test_prot.got "
exit 1
fi

if ! $AMRFINDER --plus -n test_dna.fa -O Escherichia --mutation_all test_dna_mut_all.got > test_dna.got \
|| ! diff -q test_dna.expected test_dna.got
then
echo "Test failed: "
echo " $AMRFINDER --plus -n test_dna.fa -O Escherichia --mutation_all test_dna_mut_all.got > test_dna.got"
echo " diff test_dna.expected test_dna.got"
exit 1
fi
if ! diff -q test_dna_mut_all.expected test_dna_mut_all.got
then
echo "Test failed: "
echo " $AMRFINDER --plus -n test_dna.fa -O Escherichia --mutation_all test_dna_mut_all.got > test_dna.got"
echo " diff test_dna_mut_all.expected test_dna_mut_all.got"
exit 1
fi

if ! $AMRFINDER --plus -n test_dna.fa -p test_prot.fa -g test_prot.gff -O Escherichia > test_both.got \
|| ! diff -q test_both.expected test_both.got
then
echo "Test failed: "
echo " $AMRFINDER --plus -n test_dna.fa -p test_prot.fa -g test_prot.gff -O Escherichia > test_both.got"
echo " diff test_both.expected test_both.got "
exit 1
fi

echo "Success!"

0 comments on commit 322b9ca

Please sign in to comment.