Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id q7DDnNLf001782 for ; Mon, 13 Aug 2012 15:49:25 +0200 Received: (qmail 18473 invoked by alias); 13 Aug 2012 13:49:18 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 13 Aug 2012 13:49:18 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx075) with SMTP; 13 Aug 2012 15:49:18 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id q7DDkpik032261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Aug 2012 15:46:51 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.1) with ESMTP id q7D6VdxB008220; Mon, 13 Aug 2012 15:46:51 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 2706319 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 13 Aug 2012 15:46:51 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.8/8.13.1) with ESMTP id q7DDkpiQ020044 for ; Mon, 13 Aug 2012 15:46:51 +0200 Received: from mail-gg0-f177.google.com (mail-gg0-f177.google.com [209.85.161.177]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id q7DDkkC0011254 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Mon, 13 Aug 2012 15:46:49 +0200 Received: by ggnm2 with SMTP id m2so3939892ggn.22 for ; Mon, 13 Aug 2012 06:46:45 -0700 (PDT) Received: by 10.100.244.33 with SMTP id r33mr3437993anh.18.1344865605618; Mon, 13 Aug 2012 06:46:45 -0700 (PDT) Received: from [192.168.0.144] ([187.10.16.62]) by mx.google.com with ESMTPS id t39sm6078273anh.3.2012.08.13.06.46.42 (version=SSLv3 cipher=OTHER); Mon, 13 Aug 2012 06:46:44 -0700 (PDT) User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 References: <502502DA.7050009@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Whitelist: Message-ID: <5029052A.2090507@gmail.com> Date: Mon, 13 Aug 2012 10:46:18 -0300 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Paulo Roberto Massa Cereda Subject: Re: Examples of l3doc & unit testing? To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p6sJLDpZh614Kjz2nt6F3tHkNlV6Q8nJpp1rdC7WMtSZd8OMXE6gjC0aPONo rmakaUTZQiO99beUhXJnMPa9bRgPD4rE/kvLGCgd0TQO+ggGc+WtiZqfm7xGXZ/FS91k9ZunRNlP QrDFIIdMCXRZHz99PBnlFtYLmEa2MSptTPWkKE5OnaMXUbcF9DRq+e0+W0=V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 7120 Hi friends! :) Sorry for the delay. The Mac setup was driving me crazy. :P > => more people run the testsuite => it is easier for people outside > the kernel team to add tests. In particular, many of the l3packages > are drastically lacking tests. Indeed. More tests, more stability IMHO. > My priority is to go for thorough tests which test all corner cases, > rather than fast ones. I may be wrong doing that, though, since the > tests are starting to take a rather long time to build. Ah I see. :) It's a good approach I think. And running test suites are usually slow, but it's a good excuse for us to go for a cup of coffee while the tests are running. :) >> One possibility is to have a test spec, so we can have a "generic" >> test infrastructure which reads this spec and "knows" how to perform >> a certain analysis. > > Can you elaborate? Currently we simply run some functions, and check > the output. I was just thinking out loud. :) I was thinking of a input format, say written in XML (/me looks at David) or another markup language, with a list of assertions, e.g, (sorry I don't know the innards of the tests neither L3 sutff) or something similar. To test a certain code snippet, a single test spec would suffice. > Paulo, how hard would it be to ship the LuaFileSystem library with > a hypothetical Lua-based test file? Bruno, I have very good news! texlua is shipped with lfs out of the box! IIRC we only need to install it for a "normal" Lua interpreter. We already have the OS commands ready for us to use via lfs. Yay! :) Best wishes, Paulo Em 10/08/2012 15:29, Bruno Le Floch escreveu: > Hi all, > >>> The important non-functional requirement is that it works >>> >>> - automatically >>> - and reasonably fast >>> >>> Obviously you have to run TeX on the test files, but doing the >>> comparison using TeX is not very time efficient. >>> >>> Now is it important that it is OS independent? Only if your goal is to >>> have *many* people use the mechanism and so far that wasn't really part >>> of the spec. > > I would add to your list > > - easy to install / understand > > => more people run the testsuite => it is easier for people outside > the kernel team to add tests. In particular, many of the l3packages > are drastically lacking tests. > >>> Perl is easily available both for unix and windows so effectively for >>> developers the current system is not to difficult to install or use. >>> The idea of using Lua is interesting, but as Joseph said, it is not that >>> this would then work out of the box for most people either (not now >>> anyway). >>> >>> Midterm, or if we think that this should be a package outside expl3 or >>> 2e core development, it would perhaps be a good option though, but for >>> now my feeling is it would mean putting resources onto something that >>> doesn't actually bring any new value. > > Agreed. > >> > I think the big question is what is your goal here. My main goal >> > initially (for 2e and later for l3 code) was to have a robust test >> > suite that would enable us to identity issues upfront when making >> > changes or additions. And that on the whole has been very successful >> > in the past (provided as Joseph said, people wrote test files :-) >> >> I can relate to that. :) Writing tests is one of the major concerns of >> the software industry. There's a lot of levels on how to test code, from >> unit to integration, and approaches, from the bowels to the interface - >> the Software Engineering wolves love these concepts. :P Of course, each >> project has its own needs and requiments. For LaTeX3, IMHO, it's >> critical to have every bit of code - from a lovely high level interface >> to an obscure undocumented feature - exhaustively tested. > > We're working on it, and I think most of l3kernel is tested. > Obviously not enough, as I keep finding obscure bugs. Latest one: the > msg system sometimes x-expands several times in a row the same > arguments. It'll get fixed soon. > > One thing that we don't have is detailed information about which > functions are tested. I've added recently a "tested = " key > to the macro environment in l3doc, but I've only used it in a couple > of modules, and the key is entirely ignored. It may be good to extend > this to other modules. > >> > The important non-functional requirement is that it works >> > >> > - automatically >> > - and reasonably fast >> >> Agreed. Though a bunch of tests might require a reasonable amount of >> time, each test should be as simple as possible, thus making its >> checking relatively fast. > > My priority is to go for thorough tests which test all corner cases, > rather than fast ones. I may be wrong doing that, though, since the > tests are starting to take a rather long time to build. > >> > Now is it important that it is OS independent? Only if your goal is to >> > have *many* people use the mechanism and so far that wasn't really >> > part of the spec. >> >> I believe that OS independent test suites might help us catch things >> that are OS-specific, or even detect possible issues with a certain >> vendor implementation. Again, I speak as an outsider; I have no idea how >> the code actually works. > > One of my main concerns, after looking at the plethora of Makefiles > and make.bat is that there is a lot of redundancy there, which means > that (1) changes don't propagate well (2) we occasionally forget to > add a module to the Makefile of the parent directory, and it never > gets tested, installed, unless someone is working on that module. > > So I guess that in the LaTeX3 case the discussion should be extended > to the build system as a whole: the test system works well, as Frank > says. It would be nice if we could get rid of Makefiles and make.bat, > and replace them by light-weight configuration files. After all, the > Makefiles are all very similar, so a top-level Lua script (or other) > should be able to do most of the work. > >> > Perl is easily available both for unix and windows so effectively for >> > developers the current system is not to difficult to install or use. >> > The idea of using Lua is interesting, but as Joseph said, it is not >> > that this would then work out of the box for most people either (not >> > now anyway). >> >> I share the same opinion. :) One idea I see is to pack the test system >> as a batteries-included file (.sh for Unix, .exe for Windows) packing >> the interpreter together. I've seen this before with some languages - >> Ruby, Python, Perl, Java - and it's doable. Of course, there's a >> drawback of having the payload of the virtual machine / interpreter >> bundled with the script, but at least it would be very easy to deploy. >> Or we can write the system with another language - say C - and generate >> a binary file. > > There is also the question of licenses if you bundle an external > dependency with the code repo. I really don't know the details, > perhaps Frank has some ideas? > >> I like the idea of using Lua. Enrico and I wrote a Lua script and the >> deployment in TeX Live was very, very easy. It runs under texlua, which >> is already available in the modern TeX distros. If the guy doesn't have >> a TeX distro, why in the Earth he wants to run a LaTeX3 test suite? :P > > The guy might have an old TeX distro :). Probably you're right that > all potential LaTeX3 testers probably have a reasonably up-to-date > distro. However, how "up-to-date" does it have to be? Anyone knows > when texlua was introduced? > >> > not sure they are alternatives, but there could be approaches that are >> > worth incorporating into the current setup. >> >> One possibility is to have a test spec, so we can have a "generic" test >> infrastructure which reads this spec and "knows" how to perform a >> certain analysis. > > Can you elaborate? Currently we simply run some functions, and check > the output. > >> I volunteer myself to help. :) You guys know that TeX is still a monster >> to me, but at least I think I can help in other battle fronts. :) > > Yeay! > > One problem with building a build system in Lua is that Lua does not > provide any function to list files in a directory. The only way in > pure Lua is to do the equivalent of \immediate\write18{os-specific > command}. There are external libraries which do that in an > os-dependent way. Paulo, how hard would it be to ship the > LuaFileSystem library with a hypothetical Lua-based test file? > > Regards, > Bruno >