Procházet zdrojové kódy

add efficiency script

add single test option to test script
update gitignore
Jens Keim před 6 roky
rodič
revize
2a07010d96
2 změnil soubory, kde provedl 26 přidání a 2 odebrání
  1. 2 0
      .gitignore
  2. 24 2
      build.sh

+ 2 - 0
.gitignore

@@ -31,4 +31,6 @@ code_boost/src/cxx/cmake-build-debug/
 code_boost/src/cmake-build-debug/
 resources/test/ID2T_results
 
+id2t
 run_tests
+test_efficiency

+ 24 - 2
build.sh

@@ -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'"