How do you run dmd-testsuite?

Dan Olson via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue May 31 08:19:39 PDT 2016


Johan Engelen <j at j.nl> writes:

> On Tuesday, 31 May 2016 at 05:36:30 UTC, Joakim wrote:
>> On Monday, 30 May 2016 at 18:09:41 UTC, Johan Engelen wrote:
>>
>>> How do you guys run just a single test of the testsuite?
>>
>> If there are any failed tests, the log spits out the compiler
>> command run for that tested module, which I copy and pasted into
>> some files so I can run that test alone, even later on.
>
> That's what I do too but isn't there a better way?
>
> (Also some tests require a little more: e.g. compiler diagnostic
> tests, tests with multiple commandline flags.)

I have been using a sh script to run one test.  It is simple minded and
just sets env vars expected by d_do_test and then runs its.

$ runtest runnable objc_call d

I just edit env vars in script as needed for platform I am on.

cat >runtest <<EOF
#!/bin/sh
# usage: runtest runnable objc_call d

# where to find ldc git repo
DIR=$HOME/projects/dobjc

# Env expectd by d_do_test

# REQUIRED_ARGS: arguments always passed to the compiler
export REQUIRED_ARGS=-g
export DMD=$DIR/build/bin/ldmd2
#export DFLAGS="-gc -link-debuglib"
export DFLAGS="-O3 -gc"
export D_OBJC=1
#export MODEL=32
export MODEL=${MODEL:-64}
export NO_ARCH_VARIANT=1
export CC='c++ -g'
export OS=linux
export RESULTS_DIR="$PWD"
export DSEP=/
export SEP=/
export OBJ=.o
export EXE=

#   d_do_test runnable pi d

(cd $DIR/ldc/tests/d2/dmd-testsuite
 "$RESULTS_DIR/d_do_test" "$@")
EOF


More information about the digitalmars-d-ldc mailing list