Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 576

Show
Ignore:
Timestamp:
07/09/10 05:12:24 (14 years ago)
Author:
braddr
Message:

Add all the fail compilation tests from the other test suite.
NOTE: it's very unclear what the state of these tests are. A lot look like "currently fails, but shouldn't" rather than the intent of this directory which is "should fail"

Change fail_compilation tests to default to no permuted args. As before, each test can control the compiler flags.
Change the compilation error tests to be 0 vs !0 rather than 0 vs 1.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/do_test.sh

    r574 r576  
    1515# enable support for expressions like *( ) in substitutions 
    1616shopt -s extglob 
    1717 
    1818input_file=${input_dir}/${test_name}.d 
    1919output_dir=${RESULTS_DIR}/${input_dir} 
    2020output_file=${output_dir}/${test_name}.d.out 
    2121test_app=${output_dir}/${test_name} 
    2222 
    2323rm -f ${output_file} 
    2424 
    2525r_args=`grep REQUIRED_ARGS ${input_file} | tr -d \\\\r\\\\n` 
    2626if [ ! -z "${r_args}" ]; then 
    2727    r_args="${r_args/*REQUIRED_ARGS:*( )/}" 
    2828    if [ ! -z "${r_args}" ]; then 
    2929        extra_space=" " 
    3030    fi 
    3131fi 
    3232 
    3333p_args=`grep PERMUTE_ARGS ${input_file} | tr -d \\\\r\\\\n` 
    3434if [ -z "${p_args}" ]; then 
    35     p_args="${ARGS}" 
     35    if [ "${input_dir}" != "fail_compilation" ]; then 
     36        p_args="${ARGS}" 
     37    fi 
    3638else 
    3739    p_args="${p_args/*PERMUTE_ARGS:*( )/}" 
    3840fi 
    3941 
    4042e_args=`grep EXECUTE_ARGS  ${input_file} | tr -d \\\\r\\\\n` 
    4143if [ ! -z "$e_args" ]; then 
    4244    e_args="${e_args/*EXECUTE_ARGS:*( )/}" 
    4345fi 
    4446 
    4547extra_sources=`grep EXTRA_SOURCES ${input_file} | tr -d \\\\r\\\\n` 
    4648if [ ! -z "${extra_sources}" ]; then 
    4749    extra_sources=(${extra_sources/*EXTRA_SOURCES:*( )/}) 
    4850    extra_files="${extra_sources[*]/imports/${input_dir}/imports}" 
    4951fi 
    5052 
    5153grep -q COMPILE_SEPARATELY ${input_file} 
    5254separate=$? 
    5355 
    5456if [ "${input_dir}" != "runnable" ]; then 
    5557    extra_compile_args="-c" 
    5658fi 
    5759 
    5860if [ "${input_dir}" != "fail_compilation" ]; then 
     61    expect_compile_rc=1 
     62else 
    5963    expect_compile_rc=0 
    60 else 
    61     expect_compile_rc=1 
    6264fi 
    6365 
    6466 
    6567printf " ... %-25s %s%s(%s)\n" "${input_file}" "${r_args}" "${extra_space}" "${p_args}" 
    6668 
    6769${RESULTS_DIR}/combinations ${p_args} | while read x; do 
    6870 
    6971    if [ ${separate} -ne 0 ]; then 
    7072        echo ${DMD} -I${input_dir} ${r_args} $x -od${output_dir} -of${test_app} ${extra_compile_args} ${input_file} ${extra_files} >> ${output_file} 
    7173        ${DMD} -I${input_dir} ${r_args} $x -od${output_dir} -of${test_app} ${extra_compile_args} ${input_file} ${extra_files} >> ${output_file} 2>&1 
    72         if [ $? -ne ${expect_compile_rc} ]; then 
     74        if [ $? -eq ${expect_compile_rc} ]; then 
    7375            cat ${output_file} 
    7476            rm -f ${output_file} 
    7577            exit 1 
    7678        fi 
    7779    else 
    7880        for file in ${input_file} ${extra_files}; do 
    7981            echo ${DMD} -I${input_dir} ${r_args} $x -od${output_dir} -c $file >> ${output_file} 
    8082            ${DMD} -I${input_dir} ${r_args} $x -od${output_dir} -c $file >> ${output_file} 2>&1 
    81             if [ $? -ne ${expect_compile_rc} ]; then 
     83            if [ $? -eq ${expect_compile_rc} ]; then 
    8284                cat ${output_file} 
    8385                rm -f ${output_file} 
    8486                exit 1 
    8587            fi 
    8688        done 
    8789 
    8890        ofiles=(${extra_sources[*]/imports\//}) 
    8991        ofiles=(${ofiles[*]/%.d/.o}) 
    9092        ofiles=(${ofiles[*]/#/${output_dir}\/}) 
    9193 
    9294        if [ "${input_dir}" = "runnable" ]; then 
    9395            echo ${DMD} -od${output_dir} -of${test_app} ${test_app}.o ${ofiles[*]} >> ${output_file} 
    9496            ${DMD} -od${output_dir} -of${test_app} ${test_app}.o ${ofiles[*]} >> ${output_file} 2>&1 
    95             if [ $? -ne 0 ]; then 
     97            if [ $? -eq ${expect_compile_rc} ]; then 
    9698                cat ${output_file} 
    9799                rm -f ${output_file} 
    98100                exit 1 
    99101            fi 
    100102        fi 
    101103    fi 
    102104 
    103105    if [ "${input_dir}" = "runnable" ]; then 
    104106        echo ${test_app} ${e_args} >> ${output_file} 
    105107        ${test_app} ${e_args} >> ${output_file} 2>&1 
    106108        if [ $? -ne 0 ]; then 
    107109            cat ${output_file} 
    108110            rm -f ${output_file} 
    109111            exit 1 
    110112        fi 
    111113    fi 
    112114 
    113115    rm -f ${test_app} ${test_app}.o ${ofiles[*]} 
    114116 
    115117    echo >> ${output_file}