writing DMD tests for inline assembly bugs

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 30 00:20:08 PDT 2015


On 2015-10-29 18:58, Walter Bright wrote:

> The usual technique in the D test suite is to pipe the output to a file,
> and then diff against what it should be. Yes, you wind up with about one
> test file per error message.
>
> https://github.com/D-Programming-Language/dmd/tree/master/test/fail_compilation

An alternative would be to have multiple tests in the same file, but the 
actual source code for the tests in string literals. Then the testing 
framework can write temporary files with the content from the string 
literals and run the actual compilation on those temporary files.

I think that will work pretty good as long as the code inside the string 
literals are fairly short.

Another advantage would be that any specific compiler flags that are 
required for a given test can be passed as a separate argument instead 
of being inline in the source code as a comment.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list