Pierangelo Masarati writes:
Michael Ströder wrote:
What do you consider a "widely supported scripting language"?
During some discussions about the test suite I felt that having a more powerful scripting language would help dealing with some of the problems in a more elegant way.
I know this is going to raise a can of worms. Since we're aiming at all Un*x platforms without very special development tools, I believe plain sh and awk (no gawk or so) is sort of mandatory.
And sed. All of which are already used in the test scripts.
For stuff these can't handle I doubt Perl has any contenders yet when it comes to what is most widely installed. Well, except Windows scripting languages, whatever they are.
If we want to avoid Perl, we could write some small filters in C. Like this one:
tests/scripts/acfilter.sh requires awk in $PATH to be GNU awk for the ndb tests. On a non-GNU OS it is likely not, even if gawk is installed somewhere. Perl seems better if standard awk is insufficient. With a script which old Perl versions can handle.
Though it's possible to use fall-back solutions on hosts where the preferred scripting language is not available. if <perl is in path>; then <perl script>; elif ...; fi
For scripts that run a lot of programs, redirect the output, the Bourne Shell we already use really is quite powerful. Port a test to Python to see. Likely redirection, error handling and parameter manipulation will grow quite verbose compared to in shell.
I concur we could make use of much better languages (I'd vote python over perl, but that's personal taste), but I think we cannot have stock tests requiring python right now.
For more specialized things, like developers-only tests python would probably be fine.
Yes. Or some shell with more functions to manipulate data than Bourne Shell has.