Hi Olivier,
I'm back on this topic... I've made some tests, in order to have an idea
about what can be done. Here are some remarks I have, may you could enlight
me :)
I tried to perform tests on pins, and validate pins can be passed as
parameters:
---
test_bit(bit in t) is
end test_bit
procedure test_pin_high(volatile bit out pin) is
pin = high
end procedure
test_pin_high(pin_a5)
test_bit(pin_a5) ;@assertEquals 1 test_pin_is_high
---
but it just doesn't work. I think this is because pin_a5 is a
pseudo-variable, and PICShell doesn't "resolve" pseudo-variables when
"joining" asm and jal code (no "pin_a5" in varAdrMapping python dict)
I also tried to define an alias with "var bit level is pin_a5", but no trace
of a "level" variable in asm due to compiler optimization.
So I tried this:
PORTA = low
test_pin_high(pin_a5)
test(PORTA) ;@assertEquals 32 test_only_a5_is_high
And... it won't work, but using lowercased "porta" will work (asm contains
lowecases). Since jalv2 is case insensitive, maybe PICShell should be the
same. I think this can be done in picshell.util.AssertUtil.parse() function.
var = firstPart.split(")")[0].lower()
Do you see any other options to test pin's values ?
Talking about this assert util function, I also think it could be valuable
to be able to check compiler's internal when unit testing. That is, being
able to test values from variables not declared in code, any variables found
in asm. Something like:
test(whatever) ;@assertEquals varToTest valueToTest comment
Depending on the number of elements you have, you can decide either to get
var between parenthesis, or from comment. Something like:
@staticmethod
def parse(lineCode):
label=""
var =""
ref = ""
parts = lineCode.strip().split("@assertEquals")
assertParts = parts[1].split(" ")
if len(assertParts) == 4:
var = assertParts[1]
ref = Format.toNumber(assertParts[2])
label = assertParts[3]
else:
ref = Format.toNumber(assertParts[1])
label = assertParts[2]
firstPart = parts[0].split("(")[1]
var = firstPart.split(")")[0]
return {"label":label,"var":var,"ref":ref}
Unfortunatly, Picshell cannot be used by command line, I will try to change
> that (but I really have few free time for now...)
I've seen there's a dev doc, showing what should be imported in python code.
I think I'll give a try a maybe find a way to bypass the GUI. I let you
know.
Olivier (by the way I'm french speacking, are you ?)
Exact ! Mais tu sais, les hollandais ne comprennent pas vraiment le
français, même si on les voit souvent sur nos belles plages :)
Cheers,
Seb
Hi Sébastien
>
> Unfortunatly, Picshell cannot be used by command line, I will try to change
> that (but I really have few free time for now...)
> The homepage for the projet is now http://picshell.ovh.org/ps/ (I just
> updated my google page)
>
> Picshell can freely be distribued, you can even make money with it, I
> really don't care as far as I cannot be taken responsible for bug, damage on
> your system, blablabla .... ;)
>
> I suppose the best way to distibute Picshell is to include both windows
> executable and source code for linux people.
> Picshell is still under developpement, but again I really have few spare
> time for now.
>
> Cheers
>
> Olivier (by the way I'm french speacking, are you ?)
>
>
>
>
>
> 2009/3/30 Sebastien Lelong <[email protected]>
>
> Hi Olivier,
>>
>> It's been a while I wanted to ask you a couple of questions about
>> PICShell. At jallib (this email being CC), we're trying to build centralized
>> and reliable set of jalv2 libraries(http://jallib.googlecode.com). I know
>> PICShell is able to perform unit testing on Jal code. This feature really
>> could help us. So here my questions:
>>
>> - is it possible to run tests directly from command line, and avoid GUI
>> ? (so tests can be setup in a batch/script ?)
>> - could you give your opinion about designing tests with PICShell ? Like
>> regression tests, which could also be used for jalv2 compiler ? How far can
>> we test and how confident can we be about them ? What would be your general
>> advice/felling about this ?
>> - I can't find PICShell's website (memebot.com or the like seems down).
>> There's Google Code, but I can remember having seen a video about PICShell I
>> can't find anymore... And, is PICShell still under developement ?
>>
>> We also plan to integrate PICShell in a "JalPack", which contains last
>> compiler, jallib libraries & samples, JalEdit. Would you agree on this ?
>> What would be the prefered way to integrate it (which package should be
>> used) ?
>>
>> Thanks for your help and advices !
>>
>> Cheers,
>> Seb
>> --
>> Sébastien Lelong
>> http://www.sirloon.net
>> http://sirbot.org
>>
>
>
--
Sébastien Lelong
http://www.sirloon.net
http://sirbot.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---