SeiictyUsui / pydicom

Automatically exported from code.google.com/p/pydicom
0 stars 0 forks source link

Automate testing (including example programs) for package releases #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
To simplify package release, need automated tests (ideally unit tests, but 
possibly scripts) to run the example programs (in examples directory) and:
* at least ensure they do not throw errors
* ideally, verify that they give the expected results

As unit tests, 
* create test_examples.py file in "test" directory from copy of an existing 
testset
* use execfile to run programs?
* capture stderr and ensure no errors thrown?
* capture stdout and sample for some expected printed values?

Have to consider how to run GUI examples -- i.e. dicomtree.py. May not be 
able to automate checking, in which case it should not go in unittests.

Original issue reported on code.google.com by darcymason@gmail.com on 20 May 2009 at 1:38

GoogleCodeExporter commented 9 years ago
An interesting way to do all testing more comprehensively would be to use 
virtualenv.

e.g. If put the tar/gzip source file in home directory, then under linux could 
do the
following (need an equivalent for other platforms as well, of course):

virtualenv pyd --no-site-packages
sudo pyd/bin/easy_install . pydicom
sudo pyd/bin/python
pyd/lib/python2.5/site-packages/pydicom-0.9.3-py2.5.egg/dicom/test/run_tests.py 

The no-site packages created a completely clean environment. Might also want to 
add
Numpy to test parts dependent on that (pixel_array for now). If could script 
this and
extend to all the other python versions then could have a clean comprehensive 
test suite.

Original comment by darcymason@gmail.com on 23 May 2009 at 3:51