From: Raphaƫl Gertz Date: Tue, 5 Jul 2016 16:02:25 +0000 (+0200) Subject: Add cunittest X-Git-Tag: v0.1~4 X-Git-Url: https://git.rapsys.eu/carabistouilles/commitdiff_plain/d905bc5e628d16c0d67a2942ace13591a7564ee5?hp=417b15919d381565b8bd6766c535ed5dcf6b87d8 Add cunittest Add missing test in perl Update readme --- diff --git a/cunittest b/cunittest new file mode 100755 index 0000000..e330bb5 --- /dev/null +++ b/cunittest @@ -0,0 +1,122 @@ +#! /bin/sh + +TEST=`./analyse sirens_0_0.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Unique: 0, duplicate: 0" ]; then + echo "./analyse sirens_0_0.txt test failed"; + exit 1; +fi + +TEST=`./analyse sirens_0_1.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Unique: 0, duplicate: 1" ]; then + echo "./analyse sirens_0_1.txt test failed"; + exit 2; +fi + +TEST=`./analyse sirens_0_2.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Unique: 0, duplicates: 2" ]; then + echo "./analyse sirens_0_2.txt test failed"; + exit 3; +fi + +TEST=`./analyse sirens_0_3.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Unique: 0, duplicates: 3" ]; then + echo "./analyse sirens_0_3.txt test failed"; + exit 4; +fi + +TEST=`./analyse sirens_1_0.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Unique: 1, duplicate: 0" ]; then + echo "./analyse sirens_1_0.txt test failed"; + exit 5; +fi + +TEST=`./analyse sirens_1_1.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Unique: 1, duplicate: 1" ]; then + echo "./analyse sirens_1_1.txt test failed"; + exit 6; +fi + +TEST=`./analyse sirens_1_2.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Unique: 1, duplicates: 2" ]; then + echo "./analyse sirens_1_2.txt test failed"; + exit 7; +fi + +TEST=`./analyse sirens_1_3.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Unique: 1, duplicates: 3" ]; then + echo "./analyse sirens_1_3.txt test failed"; + exit 8; +fi + +TEST=`./analyse sirens_2_0.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Uniques: 2, duplicate: 0" ]; then + echo "./analyse sirens_2_0.txt test failed"; + exit 9; +fi + +TEST=`./analyse sirens_2_1.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Uniques: 2, duplicate: 1" ]; then + echo "./analyse sirens_2_1.txt test failed"; + exit 10; +fi + +TEST=`./analyse sirens_2_2.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Uniques: 2, duplicates: 2" ]; then + echo "./analyse sirens_2_2.txt test failed"; + exit 11; +fi + +TEST=`./analyse sirens_2_3.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Uniques: 2, duplicates: 3" ]; then + echo "./analyse sirens_2_3.txt test failed"; + exit 12; +fi + +TEST=`./analyse sirens_3_0.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Uniques: 3, duplicate: 0" ]; then + echo "./analyse sirens_3_0.txt test failed"; + exit 13; +fi + +TEST=`./analyse sirens_3_1.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Uniques: 3, duplicate: 1" ]; then + echo "./analyse sirens_3_1.txt test failed"; + exit 14; +fi + +TEST=`./analyse sirens_3_2.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Uniques: 3, duplicates: 2" ]; then + echo "./analyse sirens_3_2.txt test failed"; + exit 15; +fi + +TEST=`./analyse sirens_3_3.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Uniques: 3, duplicates: 3" ]; then + echo "./analyse sirens_3_3.txt test failed"; + exit 16; +fi + +TEST=`./analyse sirens_fxt.txt`; +RET=$? +if [ "$RET" != "0" -o "$TEST" != "Uniques: 77445, duplicates: 2256" ]; then + echo "./analyse sirens_fxt.txt test failed"; + exit 17; +fi + +echo "All test passed successfully"