Thread overview
How do you run dmd-testsuite?
May 30, 2016
Johan Engelen
May 31, 2016
Joakim
May 31, 2016
Johan Engelen
May 31, 2016
Dan Olson
May 31, 2016
kink
May 30, 2016
Hi all,
 As you know, I dislike the dmd-testsuite: I cannot run a single test easily, I cannot even run it on Windows, it is inflexible, and it is out-of-tree so not tied with fixes/features we make.
Still, it is what we have so I have to live with it.

How do you guys run just a single test of the testsuite?

-Johan

May 31, 2016
On Monday, 30 May 2016 at 18:09:41 UTC, Johan Engelen wrote:
> Hi all,
>  As you know, I dislike the dmd-testsuite: I cannot run a single test easily, I cannot even run it on Windows, it is inflexible, and it is out-of-tree so not tied with fixes/features we make.
> Still, it is what we have so I have to live with it.

I didn't try to run it for a long time, because I wasn't sure how to cross-compile it for Android and wasn't looking forward to digging into that.  Once I discovered the Termux app for Android late last year, which comes with CMake and several other common developer tools, I finally built and ran it natively on Android earlier this year, with "ctest -R dmd-testsuite$" for the non-debug version.

> 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.
May 31, 2016
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.)

May 31, 2016
On Monday, 30 May 2016 at 18:09:41 UTC, Johan Engelen wrote:
> Hi all,
>  As you know, I dislike the dmd-testsuite: I cannot run a single test easily, I cannot even run it on Windows, it is inflexible, and it is out-of-tree so not tied with fixes/features we make.
> Still, it is what we have so I have to live with it.
>
> How do you guys run just a single test of the testsuite?

For Windows, you need a minimal GNU environment, see the AppVeyor script and/or the Wiki page.

When interested in a single test, I usually just compile & run that file, hoping that it doesn't require any additional files and cmdline flags, otherwise I look up the command line in the log. It's not ideal but there are worse things. ;)
May 31, 2016
Johan Engelen <j@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