diff --git a/bin/FUNCTION_HELPERS.sh b/bin/FUNCTION_HELPERS.sh index e1516bc..7c18636 100644 --- a/bin/FUNCTION_HELPERS.sh +++ b/bin/FUNCTION_HELPERS.sh @@ -8,7 +8,7 @@ # VERSION: See in CHANGELOG.md # NOTES: This script will auto remove itself, and in case of wanting to run it again, the user must download # it again or do a 'git stash' and revert the changes. -# BASH_VERSION: 5.0.17(1)-release +# BASH_VERSION: 5.1.4(1)-release (x86_64-pc-linux-gnu) # LICENSE: see in ../LICENSE (project root) or https://github.com/Josee9988/project-template/blob/master/LICENSE # GITHUB: https://github.com/Josee9988/ # REPOSITORY: https://github.com/Josee9988/project-template diff --git a/tests/TESTS_RUNNER.sh b/tests/TESTS_RUNNER.sh index 31e3771..5820df9 100755 --- a/tests/TESTS_RUNNER.sh +++ b/tests/TESTS_RUNNER.sh @@ -1,9 +1,23 @@ #!/bin/bash +#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# +# PURPOSE: Main test script that will call all the individual unitary tests. +# TITLE: TESTS_RUNNER +# AUTHOR: Jose Gracia +# VERSION: See in CHANGELOG.md +# NOTES: This script does not contain any test, it only calls all the tests one by one. +# BASH_VERSION: 5.1.4(1)-release (x86_64-pc-linux-gnu) +# LICENSE: see in ../LICENSE (project root) or https://github.com/Josee9988/project-template/blob/master/LICENSE +# GITHUB: https://github.com/Josee9988/ +# REPOSITORY: https://github.com/Josee9988/project-template +# ISSUES: https://github.com/Josee9988/project-template/issues +# MAIL: jgracia9988@gmail.com +#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# + LGREEN='\033[0;32m' NC='\033[0m' # No Color TESTS_TRASH_DIR="tests/.ignore.tests_trash/" -declare -a files=("tests/project_scaffolding_test.sh" "tests/custom_data_test.sh") # all the tests +declare -a test_files=("tests/project_scaffolding_test.sh" "tests/custom_data_test.sh") # all the tests center() { term_width="$(tput cols)" @@ -11,9 +25,12 @@ center() { echo -e "\n${LGREEN}$(printf '%*.*s %s %*.*s\n' 0 "$(((term_width - 2 - ${#1}) / 2))" "$padding" "$1" 0 "$(((term_width - 1 - ${#1}) / 2))" "$padding")${NC}" } -for file in "${files[@]}"; do - mkdir -p tests/.ignore.tests_trash +rm -r $TESTS_TRASH_DIR 2>/dev/null || : # remove any possible old test run trash files + +# run all the tests +for file in "${test_files[@]}"; do + mkdir -p tests/.ignore.tests_trash # create the files where the tests will attack upon center "TEST: running test ./$file" - ./"$file" - rm -r $TESTS_TRASH_DIR + ./"$file" # run the test + rm -r $TESTS_TRASH_DIR # remove the previously created files done diff --git a/tests/custom_data_test.sh b/tests/custom_data_test.sh index 7c69650..a2cf902 100755 --- a/tests/custom_data_test.sh +++ b/tests/custom_data_test.sh @@ -1,5 +1,19 @@ #! /bin/bash -# file: examples/custom_data_test.sh + +#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# +# PURPOSE: Test suite for testing the modified custom data, after executing the SETUP_TEMPLATE script.ยบ +# TITLE: Custom Data tests +# AUTHOR: Jose Gracia +# VERSION: See in CHANGELOG.md +# NOTES: This script is called by the TESTS_RUNNER.sh script. And it unit tests all the custom data modified +# by the SETUP_TEMPLATE script. +# BASH_VERSION: 5.1.4(1)-release (x86_64-pc-linux-gnu) +# LICENSE: see in ../LICENSE (project root) or https://github.com/Josee9988/project-template/blob/master/LICENSE +# GITHUB: https://github.com/Josee9988/ +# REPOSITORY: https://github.com/Josee9988/project-template +# ISSUES: https://github.com/Josee9988/project-template/issues +# MAIL: jgracia9988@gmail.com +#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# TESTS_TRASH_DIR="tests/.ignore.tests_trash" USERNAME="FAKE_USERNAME_TESTS" diff --git a/tests/project_scaffolding_test.sh b/tests/project_scaffolding_test.sh index 9b36d7e..e6ffb48 100755 --- a/tests/project_scaffolding_test.sh +++ b/tests/project_scaffolding_test.sh @@ -1,5 +1,19 @@ #! /bin/bash -# file: examples/project_scaffolding_test.sh + +#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# +# PURPOSE: Test suite for testing the proejct scaffolding after executing the SETUP_TEMPLATE script. +# TITLE: Project Scaffolding tests +# AUTHOR: Jose Gracia +# VERSION: See in CHANGELOG.md +# NOTES: This script is called by the TESTS_RUNNER.sh script. And it unit tests the newly generated scaffolding +# generated by the SETUP_TEMPLATE script. +# BASH_VERSION: 5.1.4(1)-release (x86_64-pc-linux-gnu) +# LICENSE: see in ../LICENSE (project root) or https://github.com/Josee9988/project-template/blob/master/LICENSE +# GITHUB: https://github.com/Josee9988/ +# REPOSITORY: https://github.com/Josee9988/project-template +# ISSUES: https://github.com/Josee9988/project-template/issues +# MAIL: jgracia9988@gmail.com +#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# TESTS_TRASH_DIR="tests/.ignore.tests_trash" USERNAME="FAKE_USERNAME_TESTS"