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

Changeset 641

Show
Ignore:
Timestamp:
08/28/10 19:54:24 (14 years ago)
Author:
braddr
Message:

Add more tests. Add support for .html tests, even though deprecated.

Files:

Legend:

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

    r623 r641  
    11#!/bin/bash 
    22 
    33# enable debugging 
    44# set -x 
    55 
    66# cmd line args 
    77input_dir=$1    # ex: runnable 
    88test_name=$2    # ex: pi 
     9test_extension=$3 # ex: d html or sh 
    910 
    1011# env vars 
    1112# ARGS        == default set of dmd command line args to test combinatorially 
    1213# DMD         == compiler path and filename 
    1314# RESULTS_DIR == directory for temporary files and output 
    1415 
    1516# enable support for expressions like *( ) in substitutions 
    1617shopt -s extglob 
    1718 
    18 input_file=${input_dir}/${test_name}.d 
     19input_file=${input_dir}/${test_name}.${test_extension} 
    1920output_dir=${RESULTS_DIR}/${input_dir} 
    20 output_file=${output_dir}/${test_name}.d.out 
     21output_file=${output_dir}/${test_name}.${test_extension}.out 
    2122test_app=${output_dir}/${test_name} 
    2223 
    2324rm -f ${output_file} 
    2425 
    2526r_args=`grep REQUIRED_ARGS ${input_file} | tr -d \\\\r\\\\n` 
    2627if [ ! -z "${r_args}" ]; then 
    2728    r_args="${r_args/*REQUIRED_ARGS:*( )/}" 
    2829    if [ ! -z "${r_args}" ]; then 
    2930        extra_space=" " 
    3031    fi 
    3132fi 
    3233 
    3334p_args=`grep PERMUTE_ARGS ${input_file} | tr -d \\\\r\\\\n` 
    3435if [ -z "${p_args}" ]; then 
    3536    if [ "${input_dir}" != "fail_compilation" ]; then 
    3637        p_args="${ARGS}" 
    3738    fi 
    3839else 
    3940    p_args="${p_args/*PERMUTE_ARGS:*( )/}" 
    4041fi 
  • trunk/test/Makefile

    r623 r641  
    2525#                        default: (none) 
    2626# 
    2727#   EXTRA_SOURCES:       list of extra files to build and link along with the test 
    2828#                        default: (none) 
    2929# 
    3030#   PERMUTE_ARGS:        the set of arguments to permute in multiple $(DMD) invocations 
    3131#                        default: the make variable ARGS (see below) 
    3232# 
    3333#   POST_SCRIPT:         name of script to execute after test run 
    3434#                        default: (none) 
    3535# 
    3636#   REQUIRED_ARGS:       arguments to add to the $(DMD) command line 
    3737#                        default: (none) 
    3838 
    3939SHELL=/bin/bash 
    4040QUIET=@ 
    4141export DMD=../src/dmd 
    4242export RESULTS_DIR=test_results 
    4343export ARGS=-inline -release -gc -O -unittest -fPIC 
    4444 
    45 runnable_tests=$(wildcard runnable/*.d) 
     45runnable_tests=$(wildcard runnable/*.d) $(wildcard runnable/*.html) 
    4646runnable_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(runnable_tests))) 
    4747 
    4848compilable_tests=$(wildcard compilable/*.d) 
    4949compilable_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(compilable_tests))) 
    5050 
    5151fail_compilation_tests=$(wildcard fail_compilation/*.d) 
    5252fail_compilation_test_results=$(addsuffix .out,$(addprefix $(RESULTS_DIR)/,$(fail_compilation_tests))) 
    5353 
    5454$(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 
    5659 
    5760$(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 
    5962 
    6063$(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 
    6265 
    6366all: run_tests 
    6467 
    6568quick: 
    6669    $(MAKE) ARGS="" run_tests 
    6770 
    6871clean: 
    6972    @echo "Removing output directory: $(RESULTS_DIR)" 
    7073    $(QUIET)if [ -e $(RESULTS_DIR) ]; then rm -rf $(RESULTS_DIR); fi 
    7174 
    7275$(RESULTS_DIR)/.created: 
    7376    @echo Creating output directory: $(RESULTS_DIR)  
    7477    $(QUIET)if [ ! -d $(RESULTS_DIR) ]; then mkdir $(RESULTS_DIR); fi 
    7578    $(QUIET)if [ ! -d $(RESULTS_DIR)/runnable ]; then mkdir $(RESULTS_DIR)/runnable; fi 
    7679    $(QUIET)if [ ! -d $(RESULTS_DIR)/compilable ]; then mkdir $(RESULTS_DIR)/compilable; fi 
    7780    $(QUIET)if [ ! -d $(RESULTS_DIR)/fail_compilation ]; then mkdir $(RESULTS_DIR)/fail_compilation; fi 
    7881    $(QUIET)touch $(RESULTS_DIR)/.created 
    7982 
    8083run_tests: start_runnable_tests start_compilable_tests start_fail_compilation_tests 
    8184