Hi Ingo (and other interested test authors):
The basic idea of a test suite consists of a few steps:
(1) generate some value from an operation
(2) generate the expected result value
(3) compare the $got with $expected
so to convert your example into a test script subtest
you use Test::More to do the testing and one example
would look like this:
cat eg-test.t
> use Test::More tests => 1; # the preferred PDL test suite module
>
> use PDL; # module needed for your test
> use PDL::NiceSlice; # module needed for your test
>
> $PDL::BIGPDL = 1; # global initialization
>
> # Ingo example test
> my $x = 40 * ones(byte, 1024*1024*1024*4+10); # use lexical variables
> my $got = $x(2**32+2:2**32+7); # the test operation
> my $expected = pdl(byte, [40,40,40,40,40,40]); # better to have uniq values
>
> ok(all($got == $expected), 'example Ingo test')
> or diag("$got != $expected"); # helps understand failure
Here you can see the basic structure of a test suite.
To add additional tests, just add them on, a few lines
at a time, and update the number of tests specified
in the 'use Test::More tests=>1;' line.
I hope this clarifies what is needed here. Not a whole lot of
work and grind, just take a bit of time to convert things that
should work into an ok() check for same.
In fact, submissions of candidate tests in the above
example format so that they could be consolidated
into the final test suite will go a long way towards getting
64bit support off of the ground.
--Chris
On Mon, May 21, 2012 at 3:30 AM, Ingo Schmid <[email protected]> wrote:
>
> I used this little script to test indexing.
>
>
> use PDL;
> use PDL::NiceSlice;
>
> $PDL::BIGPDL = 1;
> $x=ones(byte, 1024*1024*1024*4+10)*40;
>
> print $x(2**32+2:2**32+7);
>
> Sorry, I don't have the time to dive into writing test suite, atm. This at
> least requires both indexes to be 64ibt.
>
> Hope this helps
>
> Ingo
>
>
>
> On 05/19/2012 03:54 PM, chm wrote:
>>
>> [Bump]
>>
>> > Also, I'm still looking for volunteer(s) to help to write a
>> > t/64bit-index-support.t test suite. The tests need to be
>> > specific to large index support so they should use piddles
>> > bigger than 4GB.
>>
>> Volunteer(s)?
>>
>>
>> On 5/8/2012 10:00 AM, Chris Marshall wrote:
>>>
>>> All-
>>>
>>> I've just pushed another fix to the 64bit-index-support branch.
>>> The problem was strtol() being used in slices.pd to convert
>>> the input strings into index values. Those calls have now been
>>> upgraded to use strtoll() instead so I'm hoping things will work
>>> better for large index slicing operations. Please check.
>>>
>>> Also, I'm still looking for a volunteer to help to write the first
>>> t/64bit-index-support.t test suite. The tests need to be
>>> specific to large index support so they should use piddles
>>> bigger than 4GB.
>>>
>>> Additionally, if you have a 64bit platform, more than 4GB of
>>> RAM and the ability to debug PDL+XS/PP code, I would
>>> really appreciate if you could make some time to help
>>> track down bugs and test failures with the new code. Already
>>> reported is some issue related to "double frees" and a number
>>> of tests fail.
>>>
>>> Thanks for any support you can lend!
>>> Chris
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl