[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openldap-devel
Subject:    Re: "widely supported scripting language" for make test (was ITS#5809)
From:       Michael_Ströder <michael () stroeder ! com>
Date:       2008-11-16 13:49:10
Message-ID: 492024D6.1040406 () stroeder ! com
[Download RAW message or body]

Hallvard B Furuseth wrote:
> 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

Well, implementing fall-backs would undermine the idea to simplify the
implementation of test scripts.

Disclaimer:
Mainly used to Python myself I'm biased off course.

> 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.

Even the main test scripts wouldn't be shell scripts anymore. One would
use an unit testing framework for that scripting language and implement
test classes for the specific tests. Invoking shell commands can be
easily implemented by Python module subprocess (see
http://docs.python.org/library/subprocess.html#module-subprocess).

Simple example in the code of the MoinMoin project:
http://hg.moinmo.in/moin/1.8/file/f414aece63e0/MoinMoin/_tests/ldap_testbase.py

Ciao, Michael.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic