test directory

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

test directory

Luiz Henrique de Figueiredo
We're thinking about removing the test directory from the tarball.

The programs in there do not really test anything; they are merely
examples of Lua code. Moreover, they're not really good examples of
Lua code (some of them come from old Lua versions).

Mike Pall has suggested offline that the community would be better
off with a 'known good' Lua source code repository. Initially it
could include all the examples from PIL, a few programs from the test
directory, and his benchmark tests. He thinks the Wiki is 'suboptimal'
for this. So perhaps it's better to have a luaforge project?
Any volunteers?

Anyone with strong feelings against removing the test directory?
--lhf
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Victor Boivie
Hi List, (this is my first post so I thought it would be appropriate
to say 'hi' atleast once)

Something I would like to see is an extensive set of regression test
scripts that can be used for verifying that nothing is broken after
having changed something in the lua core. Are there any already, or is
this something that would have to be written from scratch? These could
be provided in the source distribution of Lua, or in a separate QA
package perhaps.

To answer your questions: I agree what you're suggesting, but I think
it would be good if there was a package of basic scripts that
beginners can examine to get a good understanding how Lua works. If
they are presented with a huge repository with scripts ranging from
small to extremely large (well, community scripts tend to get quite
extensive), then it's a lot more difficult to find small snippets that
show much considering their size - much like the scripts do today.

br,
Victor

On 3/22/06, Luiz Henrique de Figueiredo <[hidden email]> wrote:

> We're thinking about removing the test directory from the tarball.
>
> The programs in there do not really test anything; they are merely
> examples of Lua code. Moreover, they're not really good examples of
> Lua code (some of them come from old Lua versions).
>
> Mike Pall has suggested offline that the community would be better
> off with a 'known good' Lua source code repository. Initially it
> could include all the examples from PIL, a few programs from the test
> directory, and his benchmark tests. He thinks the Wiki is 'suboptimal'
> for this. So perhaps it's better to have a luaforge project?
> Any volunteers?
>
> Anyone with strong feelings against removing the test directory?
> --lhf
>
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Mildred Ki'Lya
In reply to this post by Luiz Henrique de Figueiredo

On Wed, 22 Mar 2006 13:12:54 -0300 Luiz Henrique de Figueiredo
<[hidden email]> wrote:
> Mike Pall has suggested offline that the community would be better
> off with a 'known good' Lua source code repository. Initially it
> could include all the examples from PIL, a few programs from the test
> directory, and his benchmark tests. He thinks the Wiki is 'suboptimal'
> for this. So perhaps it's better to have a luaforge project?
> Any volunteers?

I'm thinking that it would be good if we have something like CPAN but
for lua. To have a way to install easyly modules.
Since lua itself does not provides many modules (like perl or python) I
think we need an easy way to install module from a lua repository.

And also an easy way to upload modules written by the community. For
example I wrote an xosd binding ... but i don't know how to share that
work. Maybe open a luaforge project but that sounds a little
complicated for me...

Any idea about that ?


--
Mildred       <xmpp:[hidden email]> <http://mildred632.free.fr/>
Clef GPG :    <hkp://pgp.mit.edu> ou <http://mildred632.free.fr/gpg_key>
Fingerprint : 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 [9A7D 2E2B]
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Mike Pall-3-2
In reply to this post by Luiz Henrique de Figueiredo
Hi,

Luiz Henrique de Figueiredo wrote:
> [...] He thinks the Wiki is 'suboptimal' for this. [...]

I have to clarify this: the current lua-users Wiki does not make
it easy to add inline Lua code with syntax highlighting. And it's
difficult to allow downloading of the same code snippets in pure
text form (without getting into sync problems).

I'm not aware of any generic software for nicely maintaining a
repository of source code snippets and comments. I guess a Wiki
is still the best match, but it would need some extensions for
inlining Lua code. Some of this may be available in other Wiki
software. But it may be easier to modify the current Wiki. Maybe
the examples should be in an extra Wiki tree, too.

[To keep this discussion in focus: let's solve the problem of a
repository for Lua code _snippets_ first. This is not about a
CPAN for Lua -- which has very different needs.]

Bye,
     Mike
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Roberto Ierusalimschy
In reply to this post by Victor Boivie
>
> Something I would like to see is an extensive set of regression test
> scripts that can be used for verifying that nothing is broken after
> having changed something in the lua core. Are there any already, or is
> this something that would have to be written from scratch? These could
> be provided in the source distribution of Lua, or in a separate QA
> package perhaps.
>

Lua has a large set of regression tests, which we use in its development.
However, it has some problems for general use. See

  http://lua-users.org/lists/lua-l/2005-12/msg00312.html

I can release a similar tarball for 5.1.

(I will try to improve its usability, at least with some user
instructions...)

-- Roberto
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Andre Carregal
In reply to this post by Mike Pall-3-2
> De: Mike Pall
> I'm not aware of any generic software for nicely maintaining a
> repository of source code snippets and comments. I guess a Wiki
> is still the best match, but it would need some extensions for
> inlining Lua code. Some of this may be available in other Wiki
> software. But it may be easier to modify the current Wiki. Maybe
> the examples should be in an extra Wiki tree, too.

GForge offers the snippet tab (see http://rubyforge.org/snippet/ for an example of one) but we found it too cumbersome to use and decided to cut it from LuaForge.

If that turns out to be useful, we can activate it back. Please take a look at other snippet directories before jumping to conclusions, the issue is quite subtle.

> [To keep this discussion in focus: let's solve the problem of a
> repository for Lua code _snippets_ first. This is not about a
> CPAN for Lua -- which has very different needs.]

I agree, Wiki/LuaForge or anything else can take care of snippets.

CPAN for Lua is another thing and a wild adventure per se (we have been refering to this concept internally as LuaRocks, just like RubyGems).

André


Reply | Threaded
Open this post in threaded view
|

Re: test directory

Alex Queiroz
In reply to this post by Mike Pall-3-2
Hallo,

On 3/22/06, Mike Pall <[hidden email]> wrote:
>
> I'm not aware of any generic software for nicely maintaining a
> repository of source code snippets and comments. I guess a Wiki
> is still the best match, but it would need some extensions for
> inlining Lua code. Some of this may be available in other Wiki
> software. But it may be easier to modify the current Wiki. Maybe
> the examples should be in an extra Wiki tree, too.
>

     Trac[1] has a perfect integration between a wiki and a subversion
repository (more backends are being added now). It's wiki has also the
ability to display highlighted code.

[1] - http://trac.edgewall.com/

--
-alex
http://www.ventonegro.org/
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Doug Currie
Wednesday, March 22, 2006, 1:15:32 PM, Alex Queiroz wrote:

>      Trac[1] has a perfect integration between a wiki and a subversion
> repository (more backends are being added now). It's wiki has also the
> ability to display highlighted code.

> [1] - http://trac.edgewall.com/

I like Trac, too, though it's a lot of work to maintain a Trac site.
Related to code snippets, a Trac based example is http://trac-hacks.org/

e


Reply | Threaded
Open this post in threaded view
|

Re: test directory

Kein-Hong Man
In reply to this post by Luiz Henrique de Figueiredo
Luiz Henrique de Figueiredo wrote:
> We're thinking about removing the test directory from the tarball.

The 'test' directory were quite useful as sample programs to play
with when I started using Lua. Maybe it should just be called
'samples'. It would take up space in the tarball, but it would not
at all bloat one's implementation of Lua in an application.

One nice thing about Perl is that one can really learn a lot
looking at all the Perl modules that come standard with every Perl
installation. In a small way, a 'samples' directory in the Lua
tarball can help new users. One does not have to hunt around to
find the samples, because it will be in the tarball.

> [snip]
> Mike Pall has suggested offline that the community would be better
> off with a 'known good' Lua source code repository. Initially it
> could include all the examples from PIL, a few programs from the test
> directory, and his benchmark tests. He thinks the Wiki is 'suboptimal'
> for this. So perhaps it's better to have a luaforge project?
> Any volunteers?

But what will it actually test? What kind of code coverage will it
have? Will we exercise all aspects of a typical Lua
implementation? I would rather have the existing test suite that
Roberto mentioned worked into something that is very easy for the
Lua integrator to use in order to verify that most things work.
Better still, put it into the tarball and add a 'make test'.

Right now, most of us programmers are in 'crafting' mode. It would
be great if Lua can take one step forward and help get us into
'engineering' mode. We need lots of tests and stuff we can verify.
No guessing or finger-crossing or voodoo. Small languages are
popping up like flies -- a comprehensive test suite that is easily
used by an adopter of Lua will give Lua a distinct advantage over
all those competitors, and it is good engineering.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

Reply | Threaded
Open this post in threaded view
|

RE: test directory

Vijay Aswadhati-2
In reply to this post by Luiz Henrique de Figueiredo
On Wednesday, March 22, 2006 8:13 AM, Luiz Henrique de Figueiredo
wrote:

> Anyone with strong feelings against removing the test directory?

Bordering on strong feelings! I would go with Kein-Hong's suggestion
to rename the test directory to samples directory, remove those
samples that are not applicable to Lua 5.1 and leave it at that.

I also think that test cases with a proper test harness to achieve
one button regressions test cycle would be a great addition to the
standard distribution. I remember seeing on this list someone
posting something about porting UnitTest to Lua; not sure if it
gained critical mass to be useful.

Vijay Aswadhati



Reply | Threaded
Open this post in threaded view
|

Re: test directory

Adam D. Moss
In reply to this post by Luiz Henrique de Figueiredo
Luiz Henrique de Figueiredo wrote:
> The programs in there do not really test anything; they are merely
> examples of Lua code. Moreover, they're not really good examples of
> Lua code (some of them come from old Lua versions).

As 'tests' I've found them near-useless, but as examples I
found them *PRICELESS* when trying out Lua for the first
few days.

I'd totally expect to see a good handful of small and self-
contained examples of Lua scripts in the tarball - when looking
at any language these sort of things are (to me) the first
and best (offline and instantly-hackable) reference to
the basic syntax and capabilities, before diving into the
docs to look up anything that's not already obvious from this
code-browse.

So there are two basic problems at the root:
1) they're not tests, they're more like examples
2) they're not actually very good examples

I think the real solution is to:
1) call them examples, not tests :)
2) fix or replace them to the point where you can be proud
to call them good, simple examples of Lua code.

In my opinion and experience as a newbie during the 5.0alpha
period, just removing them would be a sad option.

--adam
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Paul Chiusano-3
In reply to this post by Mike Pall-3-2
> I have to clarify this: the current lua-users Wiki does not make
> it easy to add inline Lua code with syntax highlighting. And it's
> difficult to allow downloading of the same code snippets in pure
> text form (without getting into sync problems).

There's a wiki for collaborative code sharing / editing / debugging:
http://en.literateprograms.org/LiteratePrograms:Welcome

It does syntax highlighting for code blocks and so on.

Here's an example page:
http://en.literateprograms.org/Binary_search_tree_%28C%29

I haven't played with it much, but it looks very nice. Maybe we could
swipe the wiki engine they are using?

-Paul
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Jamie Webb-3
In reply to this post by Mike Pall-3-2
On Wed, Mar 22, 2006 at 06:13:43PM +0100, Mike Pall wrote:
> I have to clarify this: the current lua-users Wiki does not make
> it easy to add inline Lua code with syntax highlighting. And it's
> difficult to allow downloading of the same code snippets in pure
> text form (without getting into sync problems).

Syntax highlighting is one thing, but if these are just snippets,
what's wrong with cut and paste?

> I'm not aware of any generic software for nicely maintaining a
> repository of source code snippets and comments. I guess a Wiki
> is still the best match, but it would need some extensions for
> inlining Lua code. Some of this may be available in other Wiki
> software. But it may be easier to modify the current Wiki. Maybe
> the examples should be in an extra Wiki tree, too.

I host the Wiki for the Scala language (scala.sygneca.com), which uses
DokuWiki. DokuWiki's syntax highlighting is provided by GeSHi, which
also supports Lua. It's fairly new, but looks like it will work okay
so far.

> [To keep this discussion in focus: let's solve the problem of a
> repository for Lua code _snippets_ first. This is not about a
> CPAN for Lua -- which has very different needs.]

I'd have thought that LuaCheia would have been the first step in that
direction, but it never gained critical mass. Maybe the time is right
this time around, and someone should try to revive it. (Not
volunteering).

-- Jamie Webb
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Andy Stark
In reply to this post by Adam D. Moss
Lua list <[hidden email]> writes:
>I think the real solution is to:
>1) call them examples, not tests :)
>2) fix or replace them to the point where you can be proud
>to call them good, simple examples of Lua code.

Don't call them tests or examples, call them "cliches" (following the
terminology used by the Lego Constructopedia...) The term "patterns" would
also be appropriate but it has already been used in OOP, of course. The
cliches would sometimes be complete programs but would often just be
isolated examples of loops, metatable changes, Lua OOP techniques, etc.

These cliches are perhaps more important for Lua's future than libraries
of routines, especially those written in C rather than Lua. There are
bound to be more people who will use Lua as a scripting language for
well-known products (Lightroom, Baldur's Gate, modo, etc) than for any
other purpose. Relatively few will embed Lua in their own apps or use it
for command line scripting. Extensions written in C can be added to your
own code, but not to modo and Baldur's Gate and most other embedded Lua
interpreters. I would think that non-programmers tinkering with scripting
in these apps/games would be more inclined to copy and paste from a web
page than download complete source files (think of the popularity of
JavaScript code snippet sites). Having a bank of cliches, snippets or
whatever you want to call them would be a huge boost to the main usage of
Lua.

A well-designed cliche bank ("Clicharium"?) would also be interesting in
its own right as it is a relatively underdeveloped approach to coding
practice. We would probably want some kind of simple peer review to ensure
that the cliches really were of good quality. The wiki model lends itself
well to this if we require that contributors *must* be provide an
explanation for all changes they make (ie, reject changes that don't
contain an explanation). However, we should also have some system to let
the user verify that the code actually works. Perhaps an interactive Lua
interpreter running on the web server which could execute code submitted
by a form on the web page? And then maybe syntax highlighting, simple
templating (ie, changing variable names in the sample code to your own
names, etc)...

I imagine at least some of this could not be done with existing wiki
software and would require extra development work. Maybe a direction for
the future, though.

&.


#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared
by NetIQ MailMarshal.
The Blackpool Sixth Form College.
#####################################################################################
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Adam D. Moss
Andy Stark wrote:
> Don't call them tests or examples, call them "cliches"

Oh yeah, great, that's so much clearer!  </sarcasm>  :)

--adam
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Andy Stark
Lua list <[hidden email]> writes:
>> Don't call them tests or examples, call them "cliches"
>
>Oh yeah, great, that's so much clearer!  </sarcasm>  :)

I know, it's a silly word really. I just thought it might be amusing to
adopt something from the Lego community!

The trouble with the existing words is that I think they would be a bit
misleading. If I see the word "test" then I take it to mean verifying that
the interpreter works or testing the codebase. If I see "examples", I
think Hello World, Fibonacci, 99 bottles of beer and the other usual
stuff. These things demonstrate the language but aren't really of any
great use in day-to-day programming. If I saw the word "cliche" or better
still "clicharium" on a website then I'd think "WHAT???" and be inclined
to find out what on earth it was.

The SQLite bug tracker has a link that says "Honeypot". It's actually just
a link to trap unwanted web spiders but I had to click the first time I
saw it. The name was too intriguing to ignore! If you don't like
Clicharium then how about Snippetry? Clippodrome? Excerpt-o-rama? (Sorry,
I'll shut up now... ;)

&.


#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared
by NetIQ MailMarshal.
The Blackpool Sixth Form College.
#####################################################################################
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Gavin Wraith
In message
<[hidden email]>
you wrote:

> Lua list <[hidden email]> writes:
> >> Don't call them tests or examples, call them "cliches"
> If you don't like
> Clicharium then how about Snippetry? Clippodrome? Excerpt-o-rama?
> (Sorry, I'll shut up now... ;)

I think I recognize another sufferer from hypertrophy of
the verbal lobe. No need for apologies as far as I am concerned.

Actually, whatever terminology you use I think you are making a
good point. Over the years one of the delights of the lua list
has been the occasional revelation (often by lhf or roberto)
of lua ways of doing things that would otherwise have not revealed
themselves to minds set in more traditional patterns. These things
will always evade categorization, but a moonshine page on the wiki
to present some of them might make good propaganda for lua.

--
Gavin Wraith ([hidden email])
Home page: http://www.wra1th.plus.com/
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Victor Boivie
In reply to this post by Roberto Ierusalimschy
I would find it very useful to have these scripts at my disposal, so
if it's not too much trouble packaging them, that'd great.

A problem might be that the comments in the code are in Portugese, but
I hope they are somewhat self-explaining. I still think it's a good
idea to make these scripts official and to include a link on the
website to them. Not only are they good for problem finding, but it
also improves Lua's credibility if there's a good suite of regression
tests available.

I'll see if I can contribute with some additional scripts as well.

br,
Victor

On 3/22/06, Roberto Ierusalimschy <[hidden email]> wrote:

> >
> > Something I would like to see is an extensive set of regression test
> > scripts that can be used for verifying that nothing is broken after
> > having changed something in the lua core. Are there any already, or is
> > this something that would have to be written from scratch? These could
> > be provided in the source distribution of Lua, or in a separate QA
> > package perhaps.
> >
>
> Lua has a large set of regression tests, which we use in its development.
> However, it has some problems for general use. See
>
>   http://lua-users.org/lists/lua-l/2005-12/msg00312.html
>
> I can release a similar tarball for 5.1.
>
> (I will try to improve its usability, at least with some user
> instructions...)
>
> -- Roberto
>
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Mike Pall-3-2
In reply to this post by Mike Pall-3-2
Hi,

I wrote:
> But it may be easier to modify the current Wiki.

Yup, it is. The Wiki engine used for lua-users.org is pretty
simple and contained in one big Perl file. Adding full support
for Lua 5.1 syntax highlighting was easy (comments, strings,
keywords, standard library functions).

The attached stand-alone lua2html.pl script may be useful for
other purposes, too. Sorry for posting Perl code here, but it was
the appropriate tool for the job. Code donated to the public
domain (without any warranties and so on).

One needs to add the StoreSpan and the StoreLuaSyntax functions
to the Wiki engine and then call them in CommonMarkup (before the
regular {{{...}}} markup). The embedded stylesheet needs to be
added to the Wiki stylesheet, too.

Then you can use:

{{{!Lua
io.write("Hello world!\n")
}}}

... and get nicely highlighted Lua code in the Wiki.

A link to download the raw text of the snippet would be a bonus.
But, as has been pointed out, cut'n'paste may be sufficient.

Provided this is added to the lua-users Wiki, I'm offering to add
all example code I have and keep an eye on the related section
(or extra tree?).

Bye,
     Mike

lua2html.pl (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: test directory

Kein-Hong Man
In reply to this post by Victor Boivie
Victor Boivie wrote:
> I would find it very useful to have these scripts at my disposal, so
> if it's not too much trouble packaging them, that'd great.
>
> A problem might be that the comments in the code are in Portugese, but
> I hope they are somewhat self-explaining. I still think it's a good
> idea to make these scripts official and to include a link on the
> website to them. Not only are they good for problem finding, but it
> also improves Lua's credibility if there's a good suite of regression
> tests available.

With some translation of the comments and an auto-testing
framework, the test suite can be opened up for volunteers so that
more manpower can be brought to bear, perhaps with CVS hosted on
LuaForge. Some of us can split the work. Ideally of course, I
would love to have a test suite in the Lua tarball, but I'm okay
with any decision.

> I'll see if I can contribute with some additional scripts as well.

I would be very interested in helping to create a serious test
suite for Lua.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

12