From b89f43810803b703bfe9e83b9c83dff389f02030 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Wed, 25 Sep 2013 19:54:42 -0400 Subject: [PATCH 1/5] Don't care where test.sh is run from We were trying to run ./test/test.sh and it didn't work because test.sh assumed we were in ./test/. This change moves into ./test/ for us. --- test/test.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test.sh b/test/test.sh index ff7d1c9..a633ebd 100755 --- a/test/test.sh +++ b/test/test.sh @@ -4,9 +4,12 @@ function msg() { echo $(date +%T) "$@" } +# Move to a predictable place. +cd $(dirname $0) + failures=0 total=0 -mydir=$(cd $(dirname $0); pwd) +mydir=$(pwd) files=$(echo *.txt) for dir in ../[0-9][0-9]-* ; do cd $dir From 19f91cd6a2b7b7dac6bbd510a91aecd908353034 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Wed, 25 Sep 2013 20:07:54 -0400 Subject: [PATCH 2/5] Make two tf scripts executable that weren't test.sh checks for this, so these two weren't being tested. --- 17-introspective/tf-17.py | 0 18-reflective/tf-18.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 17-introspective/tf-17.py mode change 100644 => 100755 18-reflective/tf-18.py diff --git a/17-introspective/tf-17.py b/17-introspective/tf-17.py old mode 100644 new mode 100755 diff --git a/18-reflective/tf-18.py b/18-reflective/tf-18.py old mode 100644 new mode 100755 From 7f28c7e434a6820bf6804988f937ea0c2729e626 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Wed, 25 Sep 2013 20:14:03 -0400 Subject: [PATCH 3/5] Add an arg to test.sh, for the style number Now you can do `./test/test.sh 18` or `./test.sh 18`. --- test/test.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/test.sh b/test/test.sh index a633ebd..1cf2753 100755 --- a/test/test.sh +++ b/test/test.sh @@ -10,8 +10,15 @@ cd $(dirname $0) failures=0 total=0 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 From 740a1cd04bc03c7ea7e0d48247c7b5387d5be291 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Wed, 25 Sep 2013 20:18:20 -0400 Subject: [PATCH 4/5] Wrap README at 80 chars --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2c86e81..5842071 100644 --- a/README.md +++ b/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 From 27946113ba579816f53676ab4b446d85cee28a67 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Wed, 25 Sep 2013 20:19:48 -0400 Subject: [PATCH 5/5] Add initial doco of test.sh --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 5842071..238c08d 100644 --- a/README.md +++ b/README.md @@ -34,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,