From 400d84d6b6692363ba3d2b490616fa0fc080b11c Mon Sep 17 00:00:00 2001 From: Leila011 Date: Wed, 7 Aug 2024 17:06:56 +0200 Subject: [PATCH] add test --- .../agat_sp_complement_annotations/test.sh | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/agat/agat_sp_complement_annotations/test.sh diff --git a/src/agat/agat_sp_complement_annotations/test.sh b/src/agat/agat_sp_complement_annotations/test.sh new file mode 100644 index 00000000..cf5446f3 --- /dev/null +++ b/src/agat/agat_sp_complement_annotations/test.sh @@ -0,0 +1,48 @@ +#!/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" \ + --ref "$test_dir/25_test.gff" \ + --add "$test_dir/9_test.gff";"$test_dir/9_test.gff" \ + --output "$out_dir/output.gff" + +echo ">> Checking output" +[ ! -f "$out_dir/output.gff" ] && echo "Output file output.gff does not exist" && exit 1 + +echo ">> Check if output is empty" +[ ! -s "$out_dir/output.gff" ] && echo "Output file output.gff is empty" && exit 1 + +echo ">> Check if output matches expected output" +diff "$out_dir/output.gff" "$test_dir/agat_sp_complement_annotations_1.gff" +if [ $? -ne 0 ]; then + echo "Output file output.gff does not match expected output" + exit 1 +fi + +rm -rf "$out_dir/output.gff" + +echo "> Run $meta_name with test data" +"$meta_executable" \ + --ref "$test_dir/agat_sp_complement_annotations_ref.gff" \ + --add "$test_dir/agat_sp_complement_annotations_add.gff" \ + --output "$out_dir/output.gff" + +echo ">> Checking output" +[ ! -f "$out_dir/output.gff" ] && echo "Output file output.gff does not exist" && exit 1 + +echo ">> Check if output is empty" +[ ! -s "$out_dir/output.gff" ] && echo "Output file output.gff is empty" && exit 1 + +echo ">> Check if output matches expected output" +diff "$out_dir/output.gff" "$test_dir/agat_sp_complement_annotations_2.gff" +if [ $? -ne 0 ]; then + echo "Output file output.gff does not match expected output" + exit 1 +fi +echo "> Test successful" \ No newline at end of file