Re: SNMP tests

From: Date: Tue, 20 Oct 2009 22:18:18 +0000
Subject: Re: SNMP tests
References: 1  Groups: php.qa 
Request: Send a blank email to php-qa+get-65409@lists.php.net to get a copy of this message
That's why I would like to know if there are special guidelines, when writing tests for an extension from scratch. Tell me if the following is the right thing to do ;) - Create folder ext/snmp/tests - Do a "extension_loaded('snmp') or die()" on all SKIPIF section (or should I handle this in a skipif.inc ?)
create only skipif.inc if you need to handle complex skip condition, such as test if the server is up, the credentials are good, etc.. If so, put that test there, otherwise just inline the test in every file.
- Keep specific instructions (hostname/community) on a snmp_include.inc
Please load the values from enviroment vars instead. It's more build bots friendly. See for example, the PDO, mysql, oci8 tests.
- Default values will be localhost and community=public
any sensible defaults will do it.
- Write a README file on how to set up an snmp server on localhost (?)
yes, yes! For example, I need to know what and how to install the tools for each extenions in the gcov.php.net server. So a readme file is highly helpful.
- I will maybe add an MIB file to the test. What are the restrictions ? (size, etc.)
Keep them as small as possible, and as big as necessary. That said, huge files (MBs) should be avoided..
I will commit all my IMAP tests (PHP5.3 / PHP6) as soon as I have an svn account /or someone will commit it for me ;)
Sure. Accounts may take a few days to be approved, so please be patient :) Nuno

« previous php.qa (#65409) next »