Changeset 641
- Timestamp:
- 08/28/10 19:54:24 (14 years ago)
- Files:
-
- trunk/test/do_test.sh (modified) (1 diff)
- trunk/test/Makefile (modified) (1 diff)
- trunk/test/runnable/extra-files/statictor.d.out (added)
- trunk/test/runnable/extra-files/statictor-postscript.sh (added)
- trunk/test/runnable/imports/test41a.d (added)
- trunk/test/runnable/statictor.d (added)
- trunk/test/runnable/test41.d (added)
- trunk/test/runnable/testhtml2.html (added)
- trunk/test/runnable/testhtml3.html (added)
- trunk/test/runnable/testhtml.html (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/test/do_test.sh
r623 r641 1 1 #!/bin/bash 2 2 3 3 # enable debugging 4 4 # set -x 5 5 6 6 # cmd line args 7 7 input_dir=$1 # ex: runnable 8 8 test_name=$2 # ex: pi 9 test_extension=$3 # ex: d html or sh 9 10 10 11 # env vars 11 12 # ARGS == default set of dmd command line args to test combinatorially 12 13 # DMD == compiler path and filename 13 14 # RESULTS_DIR == directory for temporary files and output 14 15 15 16 # enable support for expressions like *( ) in substitutions 16 17 shopt -s extglob 17 18 18 input_file=${input_dir}/${test_name}. d19 input_file=${input_dir}/${test_name}.${test_extension} 19 20 output_dir=${RESULTS_DIR}/${input_dir} 20 output_file=${output_dir}/${test_name}. d.out21 output_file=${output_dir}/${test_name}.${test_extension}.out 21 22 test_app=${output_dir}/${test_name} 22 23 23 24 rm -f ${output_file} 24 25 25 26 r_args=`grep REQUIRED_ARGS ${input_file} | tr -d \\\\r\\\\n` 26 27 if [ ! -z "${r_args}" ]; then 27 28 r_args="${r_args/*REQUIRED_ARGS:*( )/}" 28 29 if [ ! -z "${r_args}" ]; then 29 30 extra_space=" " 30 31 fi 31 32 fi 32 33 33 34 p_args=`grep PERMUTE_ARGS ${input_file} | tr -d \\\\r\\\\n` 34 35 if [ -z "${p_args}" ]; then 35 36 if [ "${input_dir}" != "fail_compilation" ]; then 36 37 p_args="${ARGS}" 37 38 fi 38 39 else 39 40 p_args="${p_args/*PERMUTE_ARGS:*( )/}" 40 41 fi trunk/test/Makefile
r623 r641 25 25 # default: (none) 26 26 # 27 27 # EXTRA_SOURCES: list of extra files to build and link along with the test 28 28 # default: (none) 29 29 # 30 30 # PERMUTE_ARGS: the set of arguments to permute in multiple $(DMD) invocations 31 31 # default: the make variable ARGS (see below) 32 32 # 33 33 # POST_SCRIPT: name of script to execute after test run 34 34 # default: (none) 35 35 # 36 36 # REQUIRED_ARGS: arguments to add to the $(DMD) command line 37 37 # default: (none) 38 38 39 39 SHELL=/bin/bash 40 40 QUIET=@ 41 41 export DMD=../src/dmd 42 42 export RESULTS_DIR=test_results 43 43 export ARGS=-inline -release -gc -O -unittest -fPIC 44 44 45 runnable_tests=$(wildcard runnable/*.d) 45 runnable_tests=$(wildcard runnable/*.d) $(wildcard runnable/*.html) 46 46 runnable_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(runnable_tests))) 47 47 48 48 compilable_tests=$(wildcard compilable/*.d) 49 49 compilable_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(compilable_tests))) 50 50 51 51 fail_compilation_tests=$(wildcard fail_compilation/*.d) 52 52 fail_compilation_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(fail_compilation_tests))) 53 53 54 54 $(RESULTS_DIR)/runnable/%.d.out: runnable/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/combinations $(DMD) 55 $(QUIET) ./do_test.sh $(<D) $* 55 $(QUIET) ./do_test.sh $(<D) $* d 56 57 $(RESULTS_DIR)/runnable/%.html.out: runnable/%.html $(RESULTS_DIR)/.created $(RESULTS_DIR)/combinations $(DMD) 58 $(QUIET) ./do_test.sh $(<D) $* html 56 59 57 60 $(RESULTS_DIR)/compilable/%.d.out: compilable/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/combinations $(DMD) 58 $(QUIET) ./do_test.sh $(<D) $* 61 $(QUIET) ./do_test.sh $(<D) $* d 59 62 60 63 $(RESULTS_DIR)/fail_compilation/%.d.out: fail_compilation/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/combinations $(DMD) 61 $(QUIET) ./do_test.sh $(<D) $* 64 $(QUIET) ./do_test.sh $(<D) $* d 62 65 63 66 all: run_tests 64 67 65 68 quick: 66 69 $(MAKE) ARGS="" run_tests 67 70 68 71 clean: 69 72 @echo "Removing output directory: $(RESULTS_DIR)" 70 73 $(QUIET)if [ -e $(RESULTS_DIR) ]; then rm -rf $(RESULTS_DIR); fi 71 74 72 75 $(RESULTS_DIR)/.created: 73 76 @echo Creating output directory: $(RESULTS_DIR) 74 77 $(QUIET)if [ ! -d $(RESULTS_DIR) ]; then mkdir $(RESULTS_DIR); fi 75 78 $(QUIET)if [ ! -d $(RESULTS_DIR)/runnable ]; then mkdir $(RESULTS_DIR)/runnable; fi 76 79 $(QUIET)if [ ! -d $(RESULTS_DIR)/compilable ]; then mkdir $(RESULTS_DIR)/compilable; fi 77 80 $(QUIET)if [ ! -d $(RESULTS_DIR)/fail_compilation ]; then mkdir $(RESULTS_DIR)/fail_compilation; fi 78 81 $(QUIET)touch $(RESULTS_DIR)/.created 79 82 80 83 run_tests: start_runnable_tests start_compilable_tests start_fail_compilation_tests 81 84
