Skip to content

Commit

Permalink
[TESTS] Enhancements made to easily locate failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Vanhems committed Jun 28, 2017
1 parent c95e2cf commit ebcd4c2
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/bash
set -ev
if [ "$TRAVIS_BRANCH" = "unstable" ]; then

RED='\033[1;32m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

TEST_DIR='test'

DATASETS=''
Expand All @@ -15,28 +21,29 @@ if [ "$TRAVIS_BRANCH" = "unstable" ]; then

if ! [ -f bin/dinamo ]
then
echo "Error : executable could not be found"
echo -e "${RED}Error : executable could not be found${NC}"
exit 1
fi

for DATASET in $DATASETS
do
echo "Testing ChIP-Seq mode on $DATASET with -l 6 -d 6..."
echo -e "Testing ChIP-Seq mode on $DATASET with -l 6 -d 6..."
bin/dinamo -pf $TEST_DIR/$DATASET/$SIG_FILE -nf $TEST_DIR/$DATASET/$CTRL_FILE -l 6 -d 6 -o temp.meme --no-log > /dev/null
diff temp.meme $TEST_DIR/$DATASET/dinamo_6_6.meme
if [ $? -ne 0 ]; then
echo "Test failed; the program did not output the expected file." >&2
exit 1;
echo -e "${RED}\u2716${NC} Test failed; the program did not output the expected file." >&2
exit 1
else
echo "Test passed, no difference found."
echo -e "${GREEN}\u2714${NC} Test passed, no difference found."
fi
echo "Testing ChIP-Seq mode on $DATASET with -l 7 -d 3..."
echo -e "Testing ChIP-Seq mode on $DATASET with -l 7 -d 3..."
bin/dinamo -pf $TEST_DIR/$DATASET/$SIG_FILE -nf $TEST_DIR/$DATASET/$CTRL_FILE -l 7 -d 3 -o temp.meme --no-log > /dev/null
diff temp.meme $TEST_DIR/$DATASET/dinamo_7_3.meme
if [ $? -ne 0 ]; then
echo "Test failed; the program did not output the expected file." >&2
exit 1;
echo -e "${RED}\u2716${NC} Test failed; the program did not output the expected file." >&2
exit 1
else
echo "Test passed, no difference found."
echo -e "${GREEN}\u2714${NC} Test passed, no difference found."
fi
done
rm temp.meme
Expand Down

0 comments on commit ebcd4c2

Please sign in to comment.