Changeset 623
- Timestamp:
- 08/22/10 08:27:19 (14 years ago)
- Files:
-
- trunk/test/do_test.sh (modified) (2 diffs)
- trunk/test/Makefile (modified) (1 diff)
- trunk/test/runnable/extra-files/hello-profile.d.trace.def (added)
- trunk/test/runnable/extra-files/hello-profile-postscript.sh (added)
- trunk/test/runnable/hello-profile.d (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/test/do_test.sh
r576 r623 35 35 if [ "${input_dir}" != "fail_compilation" ]; then 36 36 p_args="${ARGS}" 37 37 fi 38 38 else 39 39 p_args="${p_args/*PERMUTE_ARGS:*( )/}" 40 40 fi 41 41 42 42 e_args=`grep EXECUTE_ARGS ${input_file} | tr -d \\\\r\\\\n` 43 43 if [ ! -z "$e_args" ]; then 44 44 e_args="${e_args/*EXECUTE_ARGS:*( )/}" 45 45 fi 46 46 47 47 extra_sources=`grep EXTRA_SOURCES ${input_file} | tr -d \\\\r\\\\n` 48 48 if [ ! -z "${extra_sources}" ]; then 49 49 extra_sources=(${extra_sources/*EXTRA_SOURCES:*( )/}) 50 50 extra_files="${extra_sources[*]/imports/${input_dir}/imports}" 51 51 fi 52 52 53 53 grep -q COMPILE_SEPARATELY ${input_file} 54 54 separate=$? 55 56 post_script=`grep POST_SCRIPT ${input_file} | tr -d \\\\r\\\\n` 57 if [ ! -z "${post_script}" ]; then 58 post_script="${post_script/*POST_SCRIPT:*( )/}" 59 fi 55 60 56 61 if [ "${input_dir}" != "runnable" ]; then 57 62 extra_compile_args="-c" 58 63 fi 59 64 60 65 if [ "${input_dir}" != "fail_compilation" ]; then 61 66 expect_compile_rc=1 62 67 else 63 68 expect_compile_rc=0 64 69 fi 65 70 66 71 67 72 printf " ... %-25s %s%s(%s)\n" "${input_file}" "${r_args}" "${extra_space}" "${p_args}" 68 73 69 74 ${RESULTS_DIR}/combinations ${p_args} | while read x; do 70 75 71 76 if [ ${separate} -ne 0 ]; then 72 77 echo ${DMD} -I${input_dir} ${r_args} $x -od${output_dir} -of${test_app} ${extra_compile_args} ${input_file} ${extra_files} >> ${output_file} 73 78 ${DMD} -I${input_dir} ${r_args} $x -od${output_dir} -of${test_app} ${extra_compile_args} ${input_file} ${extra_files} >> ${output_file} 2>&1 74 79 if [ $? -eq ${expect_compile_rc} ]; then … … 95 100 echo ${DMD} -od${output_dir} -of${test_app} ${test_app}.o ${ofiles[*]} >> ${output_file} 96 101 ${DMD} -od${output_dir} -of${test_app} ${test_app}.o ${ofiles[*]} >> ${output_file} 2>&1 97 102 if [ $? -eq ${expect_compile_rc} ]; then 98 103 cat ${output_file} 99 104 rm -f ${output_file} 100 105 exit 1 101 106 fi 102 107 fi 103 108 fi 104 109 105 110 if [ "${input_dir}" = "runnable" ]; then 106 111 echo ${test_app} ${e_args} >> ${output_file} 107 112 ${test_app} ${e_args} >> ${output_file} 2>&1 108 113 if [ $? -ne 0 ]; then 109 114 cat ${output_file} 110 115 rm -f ${output_file} 111 116 exit 1 112 117 fi 113 118 fi 114 119 120 if [ ! -z ${post_script} ]; then 121 echo "Executing post-test script: ${post_script}" >> ${output_file} 122 ${post_script} >> ${output_file} 2>&1 123 if [ $? -ne 0 ]; then 124 cat ${output_file} 125 rm -f ${output_file} 126 exit 1 127 fi 128 fi 129 115 130 rm -f ${test_app} ${test_app}.o ${ofiles[*]} 116 131 117 132 echo >> ${output_file} 118 133 done trunk/test/Makefile
r574 r623 12 12 # quick: run all tests with no default permuted args 13 13 # (individual test specified options still honored) 14 14 # 15 15 # clean: remove all temporary or result files from prevous runs 16 16 # 17 17 # 18 18 # In-test variables: 19 19 # 20 20 # COMPILE_SEPARATELY: if present, forces each .d file to compile separately and linked 21 21 # together in an extra setp. 22 22 # default: (none, aka compile/link all in one step) 23 23 # 24 24 # EXECUTE_ARGS: parameters to add to the execution of the test 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 # 33 # POST_SCRIPT: name of script to execute after test run 34 # default: (none) 32 35 # 33 36 # REQUIRED_ARGS: arguments to add to the $(DMD) command line 34 37 # default: (none) 35 38 36 39 SHELL=/bin/bash 37 40 QUIET=@ 38 41 export DMD=../src/dmd 39 42 export RESULTS_DIR=test_results 40 43 export ARGS=-inline -release -gc -O -unittest -fPIC 41 44 42 45 runnable_tests=$(wildcard runnable/*.d) 43 46 runnable_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(runnable_tests))) 44 47 45 48 compilable_tests=$(wildcard compilable/*.d) 46 49 compilable_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(compilable_tests))) 47 50 48 51 fail_compilation_tests=$(wildcard fail_compilation/*.d) 49 52 fail_compilation_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(fail_compilation_tests))) 50 53 51 54 $(RESULTS_DIR)/runnable/%.d.out: runnable/%.d $(RESULTS_DIR)/.created $(RESULTS_DIR)/combinations $(DMD)
