Christopher Piro | 094823a | 2007-07-18 00:26:12 +0000 | [diff] [blame] | 1 | # for testing erlang files directly. The set up for a |
David Reiss | 0c90f6f | 2008-02-06 22:18:40 +0000 | [diff] [blame] | 2 | # this type of test would be |
| 3 | # files to test reside in lib/<app_name>/src and the test files which are |
Christopher Piro | 094823a | 2007-07-18 00:26:12 +0000 | [diff] [blame] | 4 | # just plain erlang code reside in lib/<app_name>/test |
| 5 | # |
| 6 | # This color codes emitted while the tests run assume that you are using |
| 7 | # a white-on-black display schema. If not, e.g. if you use a white |
| 8 | # background, you will not be able to read the "WHITE" text. |
| 9 | # You can override this by supplying your own "white" color, |
| 10 | # which may in fact be black! You do this by defining an environment |
| 11 | # variable named "MY_WHITE" and setting it to $'\e[0;30m' (which is |
| 12 | # simply bash's way of specifying "Escape [ 0 ; 3 0 m"). |
| 13 | # Similarly, you can set your versions of the standard colors |
| 14 | # found in colors.mk. |
| 15 | |
| 16 | test: |
| 17 | @TEST_MODULES=`ls *_test.erl`; \ |
| 18 | trap "echo $(OFF)$(NO_COLOR); exit 1;" 1 2 3 6; \ |
| 19 | for d in $$TEST_MODULES; do \ |
| 20 | echo $${MY_GREEN:-$(GREEN)}"Testing File $$d" $${MY_WHITE:-$(WHITE)}; \ |
| 21 | echo -n $${MY_BLUE:-$(BLUE)}; \ |
| 22 | erl -name $(APP_NAME) $(TEST_LIBS) \ |
| 23 | -s `basename $$d .erl` all -s init stop -noshell; \ |
| 24 | if [ $$? -ne 0 ]; then \ |
| 25 | echo $${MY_LRED:-$(LRED)}"$$d Test Failed"; \ |
| 26 | fi; \ |
| 27 | echo -n $(OFF)$(NO_COLOR); \ |
David Reiss | 0c90f6f | 2008-02-06 22:18:40 +0000 | [diff] [blame] | 28 | done |
Christopher Piro | 094823a | 2007-07-18 00:26:12 +0000 | [diff] [blame] | 29 | |