From a2adb1798f59a2de53e6203ecbc506da7176a461 Mon Sep 17 00:00:00 2001 From: tgaspe Date: Mon, 22 Jul 2024 15:09:21 -0300 Subject: [PATCH] More tests --- src/fastqc/test.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/fastqc/test.sh b/src/fastqc/test.sh index fddc2bab..f4c6420f 100644 --- a/src/fastqc/test.sh +++ b/src/fastqc/test.sh @@ -27,6 +27,32 @@ CACTTGTAAGGGCAGGCCCCCTTCACCCTCCCGCTCCTGGGGGANNNNNNNNNNANNNCGAGGCCCTGGGGTAGAGGGNN @?@DDDDDDHHH?GH:?FCBGGB@C?DBEGIIIIAEF;FCGGI######################################################### EOL +cat > "test_data/expected_summary.txt" < "test_data/expected_summary2.txt" < Run Test without options" [ ! -s "../test_data/input_1_fastqc.zip" ] \ && echo "Output ZIP file is empty." && exit 1 +# Unzip the zip file +unzip "../test_data/input_1_fastqc.zip" -d "../test_data/test1/" + +# Check if the summary.txt was extracted +[ ! -f "../test_data/test1/input_1_fastqc/summary.txt" ] && echo "Extracted files not found." && exit 1 + +# Check if the summary.txt is correct +diff -a "../test_data/expected_summary.txt" "../test_data/test1/input_1_fastqc/summary.txt" \ + || (echo "Output summary file does not match expected output" && exit 1) + echo "- test succeeded -" cd .. @@ -74,6 +110,20 @@ echo "-> Run Test with multiple inputs" [ ! -s "../test_data/input_1_fastqc.zip" ] && [ ! -s "../test_data/input_2_fastqc.zip" ] \ && echo "Output ZIP files are empty." && exit 1 +# Unzip the zip files +unzip "../test_data/input_1_fastqc.zip" -d "../test_data/test2/" +unzip "../test_data/input_2_fastqc.zip" -d "../test_data/test2/" + +# Check if the summary.txt was extracted +[ ! -f "../test_data/test2/input_1_fastqc/summary.txt" ] && echo "Extracted files not found." && exit 1 +[ ! -f "../test_data/test2/input_2_fastqc/summary.txt" ] && echo "Extracted files not found." && exit 1 + +# Check if the summary.txt is correct +diff -a "../test_data/expected_summary.txt" "../test_data/test2/input_1_fastqc/summary.txt" \ + || (echo "Output summary file does not match expected output" && exit 1) +diff -a "../test_data/expected_summary2.txt" "../test_data/test2/input_2_fastqc/summary.txt" \ + || (echo "Output summary file does not match expected output" && exit 1) + echo "- test succeeded -" cd ..