Commit 84692399 authored by Ian Bowman's avatar Ian Bowman
Browse files

Better tests

parent a17c539c
#!/bin/bash
set -e
#first run unit tests, simple enough
printf "IF 'OK' IS LAST LINE THEN NO ERRORS\n"
printf "RUNNING UNIT TESTS\n"
python -m unittest discover
#now find all smoke tests and run them
printf "RUNNING SMOKE TESTS\n"
files=`find tests/test*.sh`
for file in $files
do
printf "running $file...\n"
$file src test_data
done;
printf "\nOK\n"
set +e
exit 0
#!/bin/bash
set -e
python ../src/char_cmt_str.py -H -i ../test_data/simple_dir_row_col_mat_gamma-1.00_runs-0010.csv > char_cmt_str_simple_dir_row_col_mat_gamma-1.00_runs-0010.csv
if [ ! -n "$2" ]
then
echo "Usage: `basename $0` <src-dir> <test-data-dir>"
exit 1
fi
src_dir=$1
test_data_dir=$2
python $src_dir/char_cmt_str.py -H -i $test_data_dir/simple_dir_row_col_mat_gamma-1.00_runs-0010.csv > char_cmt_str_simple_dir_row_col_mat_gamma-1.00_runs-0010.csv
if ! diff -w ../test_data/char_cmt_str_simple_dir_row_col_mat_gamma-1.00_runs-0010.csv char_cmt_str_simple_dir_row_col_mat_gamma-1.00_runs-0010.csv; then
if ! diff -w $test_data_dir/char_cmt_str_simple_dir_row_col_mat_gamma-1.00_runs-0010.csv char_cmt_str_simple_dir_row_col_mat_gamma-1.00_runs-0010.csv; then
echo "ERROR: characterized community structure incorrect"
exit 1
fi
......
#!/bin/bash
set -e
if [ ! -n "$2" ]
then
echo "Usage: `basename $0` <src-dir> <test-data-dir>"
exit 1
fi
src_dir=$1
test_data_dir=$2
#TEST ALL TO ALL
python ../src/convert_io_tbl_to_row_col_ctx_mat.py -i ../test_data/simple_dir_io_tab.csv -s all -d all -n test_row_col_conversion
python $src_dir/convert_io_tbl_to_row_col_ctx_mat.py -i $test_data_dir/simple_dir_io_tab.csv -s all -d all -n test_row_col_conversion
if ! diff -w ../test_data/simple_dir_row_col_mat_all_to_all.csv test_row_col_conversion_all_to_all.csv; then
if ! diff -w $test_data_dir/simple_dir_row_col_mat_all_to_all.csv test_row_col_conversion_all_to_all.csv; then
echo "ERROR: all to all conversion from io table to row column matrix failed"
exit 1
fi
......@@ -13,9 +21,9 @@ rm test_row_col_conversion_all_to_all.csv
rm test_row_col_conversion_all_to_all.p
#TEST HIPPO TO HIPPO
python ../src/convert_io_tbl_to_row_col_ctx_mat.py -i ../test_data/simple_dir_io_tab.csv -s hippo -d hippo -n test_row_col_conversion
python $src_dir/convert_io_tbl_to_row_col_ctx_mat.py -i $test_data_dir/simple_dir_io_tab.csv -s hippo -d hippo -n test_row_col_conversion
if ! diff -w ../test_data/simple_dir_row_col_mat_hippo_to_hippo.csv test_row_col_conversion_hippo_to_hippo.csv; then
if ! diff -w $test_data_dir/simple_dir_row_col_mat_hippo_to_hippo.csv test_row_col_conversion_hippo_to_hippo.csv; then
echo "ERROR: hippo to hippo conversion from io table to row column matrix failed"
exit 1
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment