Re: [dylan] Reworking testworks-specs

Bruce Mitchener <[email protected]> Wed, 7 Jan 2015 22:36:06 +0700
Newsgroups gmane.comp.lang.dylan.gwydion.devel
Message-ID <CA+esKjPu7yU3u84=AEMV2-NiHQu1pQT1b-5oRrpKCU2WPf7tFw@mail.gmail.com>
--===============0540308949==
Content-Type: multipart/alternative; boundary=f46d043894e5985cc9050c11ae01

--f46d043894e5985cc9050c11ae01
Content-Type: text/plain; charset=UTF-8

I'd still love some help with that macro problem.

I've started fixing things that pop up when trying to compile the various
testworks-specs-based tests in the Open Dylan repository. I've pushed some
of the changes to master.

I've also started to document testworks-specs in the Testworks User's Guide
in the Usage section.

 - Bruce


On Mon, Jan 5, 2015 at 11:49 PM, Bruce Mitchener <[email protected]>
wrote:

> Hello all,
>
> I recently got annoyed with some stuff in testworks-specs and decided to
> try to "fix" the implementation.
>
> I have a branch here:
>
>     https://github.com/dylan-lang/testworks/tree/dev/rework-specs
>
> The first thing that it does is to switch away from building up a data
> structure and then executing tests manually via with-test-unit. It now
> generates the tests via "define test" and "define suite" definers. This
> lets it integrate a lot more smoothly with the current versions of
> testworks.
>
> One difference is that before, you could have multiple tests for, say,
> function a-b from module Y and a-b from module Z in the same test module.
> That doesn't work at the moment because I've forgotten how to concatenate
> multiple tokens (rather than just a prefix and suffix) in macros.
>
> For example, given:
>
>     define macro class-test-definer
>       { define ?protocol-name:name class-test ?class-name:name ()
>           ?body:body
>         end }
>         => { define test "test-class-" ## ?class-name
> (requires-assertions?: #f)
>                ?body
>              end }
>     end macro class-test-definer;
>
> I'd love to be able to generate a test named ""test-class-" ##
> ?protocol-name ## "-" ## ?class-name ... anyone have ideas on how I might
> do that?
>
> With these changes, there are no longer any calls with with-test-unit
> within the testworks and testworks-specs implementations.
>
> The main way that with-test-unit is used now is stuff like this:
>
>     define common-extensions function-test float-radix ()
>       with-test-unit("...")
>         ...
>       end;
>       with-test-unit("...")
>         ...
>       end;
>     end;
>
> My thought is that I can add another macro, say, function-tests or
> function-suite, that lets you define tests within it and expands to the
> correct suite + tests so that it works well with current testworks. This
> should solve a lot of our issues with testworks-specs and the use of
> with-test-unit (perhaps allowing us to remove it again).
>
> Thoughts? Comments? Help with that macro problem?
>
>  - Bruce
>
>

--f46d043894e5985cc9050c11ae01
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I&#39;d still love some help with that macro problem.<div>=
<br></div><div>I&#39;ve started fixing things that pop up when trying to co=
mpile the various testworks-specs-based tests in the Open Dylan repository.=
 I&#39;ve pushed some of the changes to master.</div><div><br></div><div>I&=
#39;ve also started to document testworks-specs in the Testworks User&#39;s=
 Guide in the Usage section.</div><div><br></div><div>=C2=A0- Bruce</div><d=
iv><br></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote=
">On Mon, Jan 5, 2015 at 11:49 PM, Bruce Mitchener <span dir=3D"ltr">&lt;<a=
 href=3D"mailto:[email protected]" target=3D"_blank">bruce.mitchene=
[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div di=
r=3D"ltr"><div>Hello all,</div><div><br></div>I recently got annoyed with s=
ome stuff in testworks-specs and decided to try to &quot;fix&quot; the impl=
ementation.<div><br></div><div>I have a branch here:</div><div><br></div><d=
iv>=C2=A0 =C2=A0 <a href=3D"https://github.com/dylan-lang/testworks/tree/de=
v/rework-specs" target=3D"_blank">https://github.com/dylan-lang/testworks/t=
ree/dev/rework-specs</a><br><div><br></div><div>The first thing that it doe=
s is to switch away from building up a data structure and then executing te=
sts manually via with-test-unit. It now generates the tests via &quot;defin=
e test&quot; and &quot;define suite&quot; definers. This lets it integrate =
a lot more smoothly with the current versions of testworks.</div><div><br><=
/div><div>One difference is that before, you could have multiple tests for,=
 say, function a-b from module Y and a-b from module Z in the same test mod=
ule. That doesn&#39;t work at the moment because I&#39;ve forgotten how to =
concatenate multiple tokens (rather than just a prefix and suffix) in macro=
s.</div><div><br></div><div>For example, given:</div><div><br></div><div><d=
iv>=C2=A0 =C2=A0 define macro class-test-definer</div><div>=C2=A0 =C2=A0=C2=
=A0=C2=A0 { define ?protocol-name:name class-test ?class-name:name ()</div>=
<div>=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ?body:body</div><div>=C2=
=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 end }</div><div>=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=
=A0=C2=A0=3D&gt; { define test &quot;test-class-&quot; ## ?class-name (requ=
ires-assertions?: #f)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=
=A0=C2=A0=C2=A0 =C2=A0?body</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=
=A0=C2=A0=C2=A0=C2=A0end }</div><div>=C2=A0 =C2=A0=C2=A0end macro class-tes=
t-definer;</div></div><div><br></div><div>I&#39;d love to be able to genera=
te a test named &quot;&quot;test-class-&quot; ## ?protocol-name ## &quot;-&=
quot; ## ?class-name ... anyone have ideas on how I might do that?</div><di=
v><br></div><div>With these changes, there are no longer any calls with wit=
h-test-unit within the testworks and testworks-specs implementations.</div>=
<div><br></div><div>The main way that with-test-unit is used now is stuff l=
ike this:</div><div><br></div><div>=C2=A0 =C2=A0 define common-extensions f=
unction-test float-radix ()<br></div><div>=C2=A0 =C2=A0 =C2=A0 with-test-un=
it(&quot;...&quot;)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ...</div><div>=C2=
=A0 =C2=A0 =C2=A0 end;</div><div>=C2=A0 =C2=A0 =C2=A0 with-test-unit(&quot;=
...&quot;)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ...</div><div>=C2=A0 =C2=
=A0 =C2=A0 end;</div><div>=C2=A0 =C2=A0 end;<br></div><div><br></div><div>M=
y thought is that I can add another macro, say, function-tests or function-=
suite, that lets you define tests within it and expands to the correct suit=
e + tests so that it works well with current testworks. This should solve a=
 lot of our issues with testworks-specs and the use of with-test-unit (perh=
aps allowing us to remove it again).</div><div><br></div><div>Thoughts? Com=
ments? Help with that macro problem?</div><span class=3D"HOEnZb"><font colo=
r=3D"#888888"><div><br></div><div>=C2=A0- Bruce</div><div><br></div></font>=
</span></div></div>
</blockquote></div><br></div>

--f46d043894e5985cc9050c11ae01--

--===============0540308949==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
hackers mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/hackers

--===============0540308949==--