diff --git a/src/bd_rhapsody/bd_rhapsody_make_reference/test.sh b/src/bd_rhapsody/bd_rhapsody_make_reference/test.sh index 3637160a..845c1739 100644 --- a/src/bd_rhapsody/bd_rhapsody_make_reference/test.sh +++ b/src/bd_rhapsody/bd_rhapsody_make_reference/test.sh @@ -11,21 +11,18 @@ assert_file_doesnt_exist() { [ ! -f "$1" ] || { echo "File '$1' exists but shouldn't" && exit 1; } } assert_file_empty() { - # () will execute in a shubshell, could you use {;}? [ ! -s "$1" ] || { echo "File '$1' is not empty but should be" && exit 1; } } assert_file_not_empty() { - # [ -s "$1" ] || (echo "File '$1' is empty but shouldn't be" && exit 1) [ -s "$1" ] || { echo "File '$1' is empty but shouldn't be" && exit 1; } } assert_file_contains() { - # grep -q "$2" "$1" || (echo "File '$1' does not contain '$2'" && exit 1) grep -q "$2" "$1" || { echo "File '$1' does not contain '$2'" && exit 1; } } assert_file_not_contains() { - # grep -q "$2" "$1" && (echo "File '$1' contains '$2' but shouldn't" && exit 1) grep -q "$2" "$1" && { echo "File '$1' contains '$2' but shouldn't" && exit 1; } } +############################################# in_fa="$meta_resources_dir/test_data/reference_small.fa" in_gtf="$meta_resources_dir/test_data/reference_small.gtf" diff --git a/src/cutadapt/test.sh b/src/cutadapt/test.sh index 1d6d9c18..28248742 100644 --- a/src/cutadapt/test.sh +++ b/src/cutadapt/test.sh @@ -6,25 +6,25 @@ set -eo pipefail ############################################# # helper functions assert_file_exists() { - [ -f "$1" ] || (echo "File '$1' does not exist" && exit 1) + [ -f "$1" ] || { echo "File '$1' does not exist" && exit 1; } } assert_file_doesnt_exist() { - [ ! -f "$1" ] || (echo "File '$1' exists but shouldn't" && exit 1) + [ ! -f "$1" ] || { echo "File '$1' exists but shouldn't" && exit 1; } } assert_file_empty() { - [ ! -s "$1" ] || (echo "File '$1' is not empty but should be" && exit 1) + [ ! -s "$1" ] || { echo "File '$1' is not empty but should be" && exit 1; } } assert_file_not_empty() { - [ -s "$1" ] || (echo "File '$1' is empty but shouldn't be" && exit 1) + [ -s "$1" ] || { echo "File '$1' is empty but shouldn't be" && exit 1; } } assert_file_contains() { - grep -q "$2" "$1" || (echo "File '$1' does not contain '$2'" && exit 1) + grep -q "$2" "$1" || { echo "File '$1' does not contain '$2'" && exit 1; } } assert_file_not_contains() { - grep -q "$2" "$1" && (echo "File '$1' contains '$2' but shouldn't" && exit 1) + grep -q "$2" "$1" && { echo "File '$1' contains '$2' but shouldn't" && exit 1; } } - ############################################# + mkdir test_multiple_output cd test_multiple_output diff --git a/src/star/star_align_reads/test.sh b/src/star/star_align_reads/test.sh index a15ea599..bd78094d 100644 --- a/src/star/star_align_reads/test.sh +++ b/src/star/star_align_reads/test.sh @@ -7,35 +7,34 @@ meta_executable="target/docker/star/star_align_reads/star_align_reads" meta_resources_dir="src/star/star_align_reads" ## VIASH END -######################################################################################### - +############################################# # helper functions assert_file_exists() { - [ -f "$1" ] || (echo "File '$1' does not exist" && exit 1) + [ -f "$1" ] || { echo "File '$1' does not exist" && exit 1; } } assert_file_doesnt_exist() { - [ ! -f "$1" ] || (echo "File '$1' exists but shouldn't" && exit 1) + [ ! -f "$1" ] || { echo "File '$1' exists but shouldn't" && exit 1; } } assert_file_empty() { - [ ! -s "$1" ] || (echo "File '$1' is not empty but should be" && exit 1) + [ ! -s "$1" ] || { echo "File '$1' is not empty but should be" && exit 1; } } assert_file_not_empty() { - [ -s "$1" ] || (echo "File '$1' is empty but shouldn't be" && exit 1) + [ -s "$1" ] || { echo "File '$1' is empty but shouldn't be" && exit 1; } } assert_file_contains() { - grep -q "$2" "$1" || (echo "File '$1' does not contain '$2'" && exit 1) + grep -q "$2" "$1" || { echo "File '$1' does not contain '$2'" && exit 1; } } assert_file_not_contains() { - grep -q "$2" "$1" && (echo "File '$1' contains '$2' but shouldn't" && exit 1) + grep -q "$2" "$1" && { echo "File '$1' contains '$2' but shouldn't" && exit 1; } } assert_file_contains_regex() { - grep -q -E "$2" "$1" || (echo "File '$1' does not contain '$2'" && exit 1) + grep -q -E "$2" "$1" || { echo "File '$1' does not contain '$2'" && exit 1; } } assert_file_not_contains_regex() { - grep -q -E "$2" "$1" && (echo "File '$1' contains '$2' but shouldn't" && exit 1) + grep -q -E "$2" "$1" && { echo "File '$1' contains '$2' but shouldn't" && exit 1; } } +############################################# -######################################################################################### echo "> Prepare test data" cat > reads_R1.fastq <<'EOF'