From: Arlindo da S. <da...@al...> - 2009-07-13 13:25:27
|
Mike et al., I am in the processes of writing unit tests for the extensions based on PyUnit, much like pytests. Here is the idea. Under each extensions/dir there is a file called "ut.py" which implements the tests. I implemented a prototype under ams: % cd extensions/ams % (cvs upd ut.py) % ./ut.py and it will run the tests (the top driver looping over the extensions is not written yet. I have placed ut.py template under mf/ cd extensions/mf cvs upd ut.py ./ut.py It will say something like Testing MF Extensions --------------------- - Testing with GrADS binary ../../src/grads - Testing with data file ../../pytests/data/model.ctl test_esmrf (__main__.utMF) ... ok test_grhist (__main__.utMF) ... ok test_linreg (__main__.utMF) ... ok test_mfhilo (__main__.utMF) ... ok test_re2 (__main__.utMF) ... ok test_smth2d (__main__.utMF) ... ok test_tcprop (__main__.utMF) ... ok test_uv2trw (__main__.utMF) ... ok All you need to do is to write the functions test_esmrf, ..., test_uv2trw. Look at ams/ut.py and TestModelFile.py under pytests/ for examples. Also, take a look at the wiki: http://opengrads.org/wiki/index.php?title=PyTests:_GrADS_Test_Suite#Writing_your_own_tests This is really the only way to make sure our builds are working on all platform. Testing these manually is simply to time consuming. Mike: Do you think you would be able to fill in the tests for libmf? It would be good if tests could be written for model.ctl, but other *small* input files would be OK. I have v2.0.a6.oga.1 on hold since you reported it broke your wxmaps. The builds pass the regular pytests, with these new tests we will be able to say whether the extensions are broken or not. Let me know if you have questions, Cheers! Arlindo -- Arlindo da Silva da...@al... |