lkcl | programmerjake, star | 10:51 |
---|---|---|
lkcl | kylel: yes. very last state. because, logical-induction, think about it: | 10:52 |
lkcl | 1) the very last state is what is tested against expected state | 10:52 |
lkcl | 2) if we add an expected state, we want that test to pass | 10:52 |
lkcl | 3) therefore, printing out that very last state, is, obviously, what is needed *such that* | 10:53 |
lkcl | 4) when inserted back into the unit test, it causes the test *against* that expected state to succeed | 10:53 |
lkcl | i mean, we don't want to put in an expected state that's going to fail, do we? :) | 10:53 |
lkcl | it's backwards-logical-induction (like in Functional Programming) | 10:54 |
lkcl | you start from the results that you want to see, and work backwards through the chain to deduce the actions required for that success to occur | 10:55 |
lkcl | programmerjake, i'm going to start putting (to-be-correctly-named-at-some-point) ElwidPartType in as actually functional | 10:55 |
lkcl | and create some mini-example using SimdScope to get it operational | 10:56 |
lkcl | toshywoshy, openpowerbot needs pinging again, stalled around friday on mattermost | 13:34 |
kylel | lkcl, the expected state code creator works as expected (haha) | 13:47 |
lkcl | kylel, :) | 14:08 |
lkcl | allriiiight | 14:09 |
lkcl | kylel, does it include subtests? | 14:09 |
lkcl | also can i suggest making a subdirectory | 14:09 |
lkcl | use os.makedirs (which i think will create sub-paths and not bomb out if they don't exist) | 14:10 |
lkcl | otherwise /tmp is going to be littered with hundreds of small files | 14:10 |
lkcl | + for i in range(32): | 14:10 |
lkcl | use this: | 14:10 |
lkcl | for i, reg in enumerate(intregs) | 14:11 |
lkcl | because some of the SVP64 tests are 128 regs | 14:11 |
lkcl | also, sigh, i am not a huge fan of "format" | 14:11 |
lkcl | it's hugely verbose. | 14:11 |
lkcl | do try to use the standard c-library printf convention. %d for integer, %s for string, %x for hex | 14:12 |
lkcl | another trick: if the line has to wrap like this | 14:13 |
lkcl | + sout.write("{0}e.intregs[{1}] = 0x{2:x}\n".format( | 14:13 |
lkcl | + lindent, | 14:13 |
lkcl | + i, | 14:13 |
lkcl | + state.intregs[i])) | 14:13 |
lkcl | then you can do: | 14:13 |
lkcl | msg = "%se.intregs[%d] = 0x%x" | 14:13 |
lkcl | sout.write(msg % (lindent, i, state.intregs[i])) | 14:13 |
lkcl | which is 2 lines, not 4. | 14:13 |
lkcl | and is a hell of a lot shorter. | 14:14 |
lkcl | c's printf format was created when space mattered. d=decimal, s=string x=hexadecimal, f=float | 14:15 |
lkcl | it's pretty obvious, and the man pages have been around for 30+ years. | 14:15 |
kylel | np. any ideas on how to grab the name of what the test cases is (such as alu?) | 14:18 |
lkcl | mmm... the only way to do that would be to pass it in to the TestAPI | 14:19 |
* lkcl thinks | 14:19 | |
lkcl | use the class name? | 14:19 |
lkcl | which you can get with self.__class__.__name__ (usually) | 14:20 |
kylel | ok, will poke around on that. | 14:20 |
lkcl | should be easy to propagate / obtain in self.add_case() | 14:21 |
lkcl | ha! SimdScope works! | 14:29 |
lkcl | programmerjake: ElwidPartType works! | 14:29 |
lkcl | that's a huge relief. i'm kinda amazed that the unit test actually worked with very little adaptation | 14:45 |
lkcl | as in... hmmm... it shouldn't have worked | 14:48 |
lkcl | found out why: the same bug is in 2 places. same functions used | 16:00 |
lkcl | programmerjake, i'm just adapting PartType to a new form which returns ranges(start,end) per elwid per element-in-a-group | 17:40 |
lkcl | i'll be trying to do that by adding new functions rather than altering the old ones | 17:40 |
lkcl | which means that the existing code and unit tests keep working | 17:40 |
lkcl | and the existing code can be morphed one sub-module at a time to the new function | 17:41 |
lkcl | then ElwidPartType can be done as well | 17:41 |
lkcl | in a second phase | 17:41 |
lkcl | ha! converting PartitionedCat worked | 18:59 |
lkcl | so that's still stable, all partsig unit tests still work | 18:59 |
lkcl | the ElwidPartType mini-test however should now be thoroughly broken :) | 18:59 |
*** henriok <henriok!~henriok@81-229-9-109-no92.tbcn.telia.com> has left #libre-soc | 20:33 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!