Merge pull request #4 from whit537/master
improve the test framework a bit
This commit is contained in:
0
17-introspective/tf-17.py
Normal file → Executable file
0
17-introspective/tf-17.py
Normal file → Executable file
0
18-reflective/tf-18.py
Normal file → Executable file
0
18-reflective/tf-18.py
Normal file → Executable file
14
README.md
14
README.md
@@ -1,12 +1,14 @@
|
||||
Exercises in Programming Style
|
||||
==============================
|
||||
|
||||
Comprehensive collection of well-known, and not so well-known, programming styles using a simple computational task, term frequency.
|
||||
Comprehensive collection of well-known, and not so well-known, programming
|
||||
styles using a simple computational task, term frequency.
|
||||
|
||||
Additions are welcome!
|
||||
|
||||
You can contribute:
|
||||
- an example program that follows one of the existing styles, but written in a different programming language
|
||||
- an example program that follows one of the existing styles, but written in a
|
||||
different programming language
|
||||
- an entirely new programming style
|
||||
- new names for the existing styles
|
||||
- discussion of names, pros and cons of each style
|
||||
@@ -32,6 +34,14 @@ should not be here)
|
||||
Contributions of new names and discussion should be done under Issues
|
||||
or on the Wiki part of this repo.
|
||||
|
||||
To test your work, make sure your script is executable and then run:
|
||||
|
||||
```
|
||||
./test/test.sh NN
|
||||
```
|
||||
|
||||
Where `NN` is the number prefix of the directory you're adding.
|
||||
|
||||
Never stop exercising!
|
||||
|
||||
Love,
|
||||
|
||||
14
test/test.sh
14
test/test.sh
@@ -4,11 +4,21 @@ function msg() {
|
||||
echo $(date +%T) "$@"
|
||||
}
|
||||
|
||||
# Move to a predictable place.
|
||||
cd $(dirname $0)
|
||||
|
||||
failures=0
|
||||
total=0
|
||||
mydir=$(cd $(dirname $0); pwd)
|
||||
mydir=$(pwd)
|
||||
if [ -z "$1" ]; then
|
||||
styles_to_test=$(echo ../[0-9][0-9]-*)
|
||||
else
|
||||
styles_to_test=../$1-*
|
||||
fi
|
||||
|
||||
files=$(echo *.txt)
|
||||
for dir in ../[0-9][0-9]-* ; do
|
||||
|
||||
for dir in $styles_to_test ; do
|
||||
cd $dir
|
||||
for file in $files ; do
|
||||
for exe in * ; do
|
||||
|
||||
Reference in New Issue
Block a user