From 519e24a79996f457ee48f9207074269bd0541c3b Mon Sep 17 00:00:00 2001 From: brodriguez8774 <brodriguez8774@gmail.com> Date: Sun, 22 Sep 2019 21:59:49 -0400 Subject: [PATCH] Create bash script to run all unit_tests --- documents/references.md | 4 +++- run_unit_tests.sh | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 run_unit_tests.sh diff --git a/documents/references.md b/documents/references.md index 7c8f4c3..f42d45e 100644 --- a/documents/references.md +++ b/documents/references.md @@ -7,7 +7,9 @@ All references to external logic. Includes anything from stack overflow links to ## New References References new to this project. -**None so far.** +### Bash "cd to Script's Directory" +Used to move to the "Script's Directory", regardless of where the script was launched from in the terminal. +<https://stackoverflow.com/a/3355423> ## Old References diff --git a/run_unit_tests.sh b/run_unit_tests.sh new file mode 100755 index 0000000..a4dd17c --- /dev/null +++ b/run_unit_tests.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# Script to run all unittests in project. + + +# Change to location of script's directory. +# Otherwise logic is inconsistent, based on where terminal initially is. +cd "$(dirname "$0")" + + +# Run unittests. +python -m unittest discover ./tests -p "*.py" -t ./ -- GitLab