I'd suggest that you not try to duplicate existing tools, since it would be a lot of work. Marsaglia's Diehard tests should work, or you can use dieharder, which is a GPL reimplementation. From the webpage:
The primary point of dieharder (like diehard before it) is to make it easy to time and test (pseudo)random number generators, both software and hardware, for a variety of purposes in research and cryptography. The tool is built entirely on top of the GSL's random number generator interface and uses a variety of other GSL tools (e.g. sort, erfc, incomplete gamma, distribution generators) in its operation.