Changeset 623

Show
Ignore:
Timestamp:
08/22/10 04:27:19 (1 year ago)
Author:
braddr
Message:

Add support for custom post-test scripts.
Add a test that uses -profile and validate that it emits the correct .def file and at least something in the .log file

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/Makefile

    r574 r623  
    3030#   PERMUTE_ARGS:        the set of arguments to permute in multiple $(DMD) invocations 
    3131#                        default: the make variable ARGS (see below) 
     32# 
     33#   POST_SCRIPT:         name of script to execute after test run 
     34#                        default: (none) 
    3235# 
    3336#   REQUIRED_ARGS:       arguments to add to the $(DMD) command line 
  • trunk/test/do_test.sh

    r576 r623  
    5353grep -q COMPILE_SEPARATELY ${input_file} 
    5454separate=$? 
     55 
     56post_script=`grep POST_SCRIPT ${input_file} | tr -d \\\\r\\\\n` 
     57if [ ! -z "${post_script}" ]; then 
     58    post_script="${post_script/*POST_SCRIPT:*( )/}" 
     59fi 
    5560 
    5661if [ "${input_dir}" != "runnable" ]; then 
     
    113118    fi 
    114119 
     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 
    115130    rm -f ${test_app} ${test_app}.o ${ofiles[*]} 
    116131