Jan Venekamp ae61e1cad4 uci: optimize update section in uci_set 2 yıl önce
..
config 0ca93fec70 test: move shunit2 tests under standalone subdirectory 5 yıl önce
references 0ca93fec70 test: move shunit2 tests under standalone subdirectory 5 yıl önce
shunit2 0ca93fec70 test: move shunit2 tests under standalone subdirectory 5 yıl önce
tests.d ae61e1cad4 uci: optimize update section in uci_set 1 yıl önce
CMakeLists.txt a6e8bbefd8 cmake: add unit testing option and shunit2 tests 5 yıl önce
Makefile 0ca93fec70 test: move shunit2 tests under standalone subdirectory 5 yıl önce
README 0ca93fec70 test: move shunit2 tests under standalone subdirectory 5 yıl önce
tests.sh 1637d29186 tests: shunit2: run all tests under Valgrind by default 5 yıl önce

README

This test script uses shunit2 :
http://code.google.com/p/shunit2/

uci-static binary is used during tests.


How to add a test
=================

* Test files are located in './test/tests.d'

* These files contain shell functions beginning with 'test' :
"
test_get_option ()
{
...
}
...
"

* shunit2 functions can be used in these functions :
http://shunit2.googlecode.com/svn/trunk/source/2.1/doc/shunit2.html

* Additional environment variables are available :
- ${CONFIG_DIR} : uci search path for config files. This directory is
reset after each test.
- ${CHANGES_DIR} : uci search path for config change files. This directory is
reset after each test.
- ${TMP_DIR} : path to a directory where can be stored temporary files
during tests. This directory is reset after each test.
- ${UCI} : uci static binary called with above config and changes
directories as parameters.
- ${REF_DIR} : path to a directory where can be stored reference files
or data.