|
@@ -58,14 +58,36 @@ SCRIPT_PATH=\${ID2T_DIR%/*}
|
|
|
cd \$SCRIPT_PATH/code
|
|
|
# Execute tests
|
|
|
set -e
|
|
|
-PYTHONWARNINGS="ignore" coverage run --source=. -m unittest discover -s Test/ >/dev/null
|
|
|
+testpath="discover -s Test/"
|
|
|
+if [ -e "Test/test_\$1.py" ]; then
|
|
|
+ testpath="Test/test_\$1.py"
|
|
|
+fi
|
|
|
+PYTHONWARNINGS="ignore" coverage run --source=. -m unittest \$testpath >/dev/null
|
|
|
coverage html
|
|
|
coverage report -m
|
|
|
EOF
|
|
|
|
|
|
+# Create the test script
|
|
|
+cat >./test_efficiency <<EOF
|
|
|
+#!/bin/sh
|
|
|
+# Find the executable
|
|
|
+if [ $(uname) = 'Darwin' ]; then
|
|
|
+ alias readlink='greadlink'
|
|
|
+fi
|
|
|
+ID2T_DIR=\$(readlink -f \$0)
|
|
|
+SCRIPT_PATH=\${ID2T_DIR%/*}
|
|
|
+cd \$SCRIPT_PATH/code
|
|
|
+# Execute tests
|
|
|
+set -e
|
|
|
+python -m unittest Test/efficiency_testing.py
|
|
|
+EOF
|
|
|
+
|
|
|
chmod +x ./code/CLI.py
|
|
|
chmod +x ./id2t
|
|
|
chmod +x ./run_tests
|
|
|
+chmod +x ./test_efficiency
|
|
|
|
|
|
echo -e "\n\nAll is set. ID2T is ready."
|
|
|
-echo -e "\nRun ID2T with the command './id2t'"
|
|
|
+echo -e "\nRun efficiency tests with the command './test_efficiency'"
|
|
|
+echo -e "Run unit tests with the command './run_tests'"
|
|
|
+echo -e "Run ID2T with the command './id2t'"
|