[squeak-dev] 12 red tests to go...

Bert Freudenberg bert at freudenbergs.de
Tue Aug 14 12:27:40 UTC 2012


On 13.08.2012, at 16:17, Frank Shearar <frank.shearar at gmail.com> wrote:

> On 13 August 2012 14:53, Levente Uzonyi <leves at elte.hu> wrote:
>> On Mon, 6 Aug 2012, Frank Shearar wrote:
>> 
>>> After a crash course in how PackageInfo actually works, we're down to
>>> 12 failing tests:
>>> http://www.squeakci.org/job/SqueakTrunk/26/testReport/?
>>> 
>>> (For the curious: while your browser shows 'Compression-Streams' and
>>> 'Compression-Archives', these are not packages (i.e., instances of
>>> PackageInfo) but just strings. The PackageInfo you seek is PackageInfo
>>> named: 'Compression', the base token of any category.
>> 
>> 
>> That's not entirely true. Some packages have dash in their names, like
>> HelpSystem-Tests or XML-Parser
> 
> So the apparent convention isn't very conventional :/.
> 
> OK. Still, simply evaluating PackageInfo named: 'Compression-Streams'
> does create a new PackageInfo, and one that looks like it ought to be
> related to the PackageInfo named: 'Compression', only it isn't. That's
> what got me into trouble in the first place. Your point is that
> PackageInfo names can happily contain $- characters.

I guess what you really care about would be the packages under source code management. As you noticed, PackageInfo instances are created on the fly so that does not mean it's an actual versioned package. For that you would have to iterate over MCWorkingCopy allManagers (or similar, away from my computer right now). Then ask the working copy for its package info and check classes as before.

- Bert -

>>> Or, if you prefer, if you want to find all packages that contain tests
>>> (in alphabetical order), run:
>>> 
>>> ((((TestCase allSubclasses collect: #category) "Find all
>>> test-containing categories"
>>>   collect: [:cat | (cat splitBy: '-') first]) asSet) "Convert
>>> categories to package names, and remove duplicates"
>>>       intersection: (PackageInfo allPackages collect: #name))
>>> asSortedCollection "Limit to actually occuring PackageInfo instances"
>>> 
>>> The above's not 100% accurate, because it will include abstract TestCases.
>> 
>> 
>> This expression gives you exactly what you need:
>> 
>> (PackageInfo allPackages
>>        select: [ :each | each classes anySatisfy: [ :ea | ea inheritsFrom:
>> TestCase ] ]
>>        thenCollect: #name) sort.
>> 
>> It returns 25 packages in my image, while your expression only gives 17.
> 
> Thanks!
> 
> frank
> 
>> Levente
>> 
>> 
>>> 
>>> I deliberately flattened the above and stored explicit package names
>>> in the test setup under version control; this lets us easily bisect
>>> the list of packages when hunting down why, say, a Compiler test
>>> crashes the image (because of a missing sound library).
>>> 
>>> frank
>>> 
>>> 
>> 
> 


More information about the Squeak-dev mailing list