[coyotos-dev] [PATCH included] Test infrastructure for bignum
Thomas Stratmann
thomas.stratmann at rub.de
Tue May 13 17:05:16 CDT 2008
Hello,
there was a bug in the ctor from string that led any leading '-' to be
effectively ignored. A patch is attached, I hope it survives the transfer.
I now have a working relatively generic test infrastructure built around
the testit.sh script. Currently tests for the "from string constructor"
with base (8, 10, 16) given are implemented and work well (once the
patch is applied).
I also have a mechanism for collecting all test fixture data within a
single file (per test input and expected output files are generated from
this file by the Makefile using egrep and cut, to prepare for the
testit.sh invocation), allowing each single fixture line to have a
comment (so that things like adding "regression test against bug #2342"
next to the fixture data are possible).
This approach is quick and easy to understand by humans (it is straight
forward adding new fixtures). I believe it is flexible enough, the only
thing that cannot be done this way is testing the istream interface and
checking for weird corner cases of the string ctor like passing an empty
string. Separate test programs are needed here.
I would like to clarify something to prevent misunderstandings: Yes, I'm
currently doing weird dirty stuff like calling configure from a
subdirectory. No, I don't think it can stay this way. It only serves as
a scaffold to help me do the real testing. I will need your assistance
to properly integrate it into the build system. As you (shap) noted,
there is the problem that we need to skip the tests on cross builds. I
have no idea how to do that and I understand too little of your
Makefiles to attach my stuff to yours (currently).
Adding tests for all the other stuff that BigNum does would now be
really easy, and could be done within weeks, depending on how many other
bugs show up.
Shall I continue this work? It would obsolete the calculator stuff, of
course. Pros and Cons should be obvious now, I believe.
Thomas
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ctor.hgpatch
Url: http://www.coyotos.org/pipermail/coyotos-dev/attachments/20080514/f92a4aff/attachment.asc
More information about the coyotos-dev
mailing list