forked from Josee9988/Josee9988
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"improved documentation of the scripts"
- Loading branch information
Showing
4 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,36 @@ | ||
#!/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: [email protected] | ||
#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# | ||
|
||
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)" | ||
padding="$(printf '%0.1s' +{1..500})" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: [email protected] | ||
#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# | ||
|
||
TESTS_TRASH_DIR="tests/.ignore.tests_trash" | ||
USERNAME="FAKE_USERNAME_TESTS" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: [email protected] | ||
#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~# | ||
|
||
TESTS_TRASH_DIR="tests/.ignore.tests_trash" | ||
USERNAME="FAKE_USERNAME_TESTS" | ||
|