Tue Jun 7 22:32:00 GMT 2011
On Jun 7, 2011, at 2:07 PM, Joel Sherrill wrote:
> I recall in the past people mentioning using glibc's
> test suite to test newlib. Are there any instructions
> out there for doing this?
I found best way to use glibc tests is to try to rework them.
A lot of times, you will probably find you will abandon them,
but keep the concept. Sometimes tracking down all the needed pieces just to run
the test, not even dealing with the function you want to test, can be daunting!
They are riddled wit a lot of non-unix spec(POSIX) code, "features" and interpretations
that are not part of any library. Best bet f you want to use glibc tests with no out of package
work is to use glibc.
Features that newlib provides or wishes to use would be considered bugs,
which sometimes I prefer newlib's interpretation and its concept of design over glibc!
An example of one test: strptime, they had I failed a test because they decided that they
would limit a range UTC to [-12,12]. I choose a different limit [-16,16] as it is a real world limitation
rather than what they want. Justification for real world is Alaska at one time had over +15, and
+14 is in use currently. Technically we are both correct in that there is no standard, however mine
handles current and past usage of time.
Hope it helps, but it is a hugh task porting their tests, in my experience.
BUT they can find bugs if you port them, or at least cause one to think of theory and reason behind the code.
Other tests are almost non existent and f you search for bugs, security issues, other's current implementations
of the functions for a one to one output compare, they can be great tests.
More information about the Newlib