[bindings] add test code for a range of swig versions