Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Leila011 committed Aug 8, 2024
1 parent af06f69 commit a552172
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/agat/agat_sp_extract_attributes/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

## VIASH START
## VIASH END

test_dir="${meta_resources_dir}/test_data"
out_dir="${meta_resources_dir}/out_data"

echo "> Run $meta_name with test data"
"$meta_executable" \
--gff "$test_dir/1.gff" \
--attribute protein_id \
--output "$out_dir/output.txt"

echo ">> Checking output"
[ ! -f "$out_dir/output_protein_id.txt" ] && echo "Output file output_protein_id.txt does not exist" && exit 1

echo ">> Check if output is empty"
[ ! -s "$out_dir/output_protein_id.txt" ] && echo "Output file output_protein_id.txt is empty" && exit 1

echo ">> Check if output matches expected output"
diff "$out_dir/output_protein_id.txt" "$test_dir/agat_sp_extract_attributes_1.txt"
if [ $? -ne 0 ]; then
echo "Output file output_protein_id.txt does not match expected output"
exit 1
fi

echo "> Test successful"

0 comments on commit a552172

Please sign in to comment.