Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Ian Bowman
Hippocampus Gene Expression Atlas -- CIC Data Integrated Software
Commits
84692399
Commit
84692399
authored
8 years ago
by
Ian Bowman
Browse files
Options
Download
Email Patches
Plain Diff
Better tests
parent
a17c539c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
6 deletions
+43
-6
run_tests.sh
run_tests.sh
+21
-0
tests/test_char_cmt_str.sh
tests/test_char_cmt_str.sh
+10
-2
tests/test_convert_io_tbl_to_row_col_ctx_mat.sh
tests/test_convert_io_tbl_to_row_col_ctx_mat.sh
+12
-4
No files found.
run_tests.sh
0 → 100755
View file @
84692399
#!/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
"
\n
OK
\n
"
set
+e
exit
0
This diff is collapsed.
Click to expand it.
tests/test_char_cmt_str.sh
View file @
84692399
#!/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
...
...
This diff is collapsed.
Click to expand it.
tests/test_convert_io_tbl_to_row_col_ctx_mat.sh
View file @
84692399
#!/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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment