From 62138aaa5a7f931fa2ddb4815f755413111cceb0 Mon Sep 17 00:00:00 2001 From: Arystanbek Dyussenov Date: Sun, 6 Sep 2009 15:13:57 +0000 Subject: Python part of multidim. array support for RNA complete. Multidim. arrays can now be modified at any level, for example: struc.arrayprop = x struc.arrayprop[i] = x struc.arrayprop[i][j] = x struc.arrayprop[i][j][k] = x etc... Approriate rvalue type/length checking is done. To ensure all works correctly, I wrote automated tests in release/test/rna_array.py. These tests cover: array/item access, assignment on different levels, tests that proper exceptions are thrown on invalid item access/assignment. The tests use properties of the RNA Test struct defined in rna_test.c. This struct is only compiled when building with BF_UNIT_TEST=1 scons arg. Currently unit tests are run manually by loading the script in the Text Editor. Here's the output I have: http://www.pasteall.org/7644 Things to improve here: - better exception messages when multidim. array assignment fails. Those we have currently are not very useful for multidim. - add tests for slice assignment --- tools/btools.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tools/btools.py') diff --git a/tools/btools.py b/tools/btools.py index 580a457e3a0..7cadab992b8 100755 --- a/tools/btools.py +++ b/tools/btools.py @@ -91,7 +91,7 @@ def validate_arguments(args, bc): 'BF_BSC', 'BF_CONFIG', 'BF_PRIORITYLIST', 'BF_BUILDINFO','CC', 'CXX', 'BF_QUICKDEBUG', 'BF_LISTDEBUG', 'LCGDIR', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG', - 'BF_DOCDIR'] + 'BF_DOCDIR', 'BF_UNIT_TEST'] okdict = {} @@ -386,7 +386,9 @@ def read_opts(cfg, args): ('BF_CONFIG', 'SCons python config file used to set default options', 'user_config.py'), ('BF_NUMJOBS', 'Number of build processes to spawn', '1'), - ('BF_MSVS', 'Generate MSVS project files and solution', False) + ('BF_MSVS', 'Generate MSVS project files and solution', False), + + (BoolVariable('BF_UNIT_TEST', 'Build with unit test support.', False)) ) # end of opts.AddOptions() -- cgit v1.2.3