[TIP] Testing executables/programs

Chris Wesseling Chris.Wesseling at cwi.nl
Wed Feb 27 01:03:11 PST 2019


On 26 February 2019 19:23:57 CET, Zbigniew Reszela <reszelaz at gmail.com> wrote:
>Hi,
>
>I would like to write a generic test case in python (unittest, pytest,
>etc)
>for testing executables/programs (this can be python/C++/Java or
>whatever
>applications).
>
>So, I would need to pass command line arguments for the progam
>execution,
>and maybe sometimes need to terminate the applications under test
>programmatically e.g. if these are GUI apps. Ideally this generic test
>case
>should be easilly parametrizable to just pass a list of strings
>(program
>name and arguments). The asserts could be on the exit codes or the
>stderr
>stream.
I have used ScriptTest before. It provides a clean running environment to run commands in and check their (file-)output. You can combine with your favourite testrunner.

I haven't use it to kill long running or detaching processes. Just a cleanly exiting cli.
-- 
Chris Wesseling
Centrum Wiskunde & Informatica (CWI) 
https://www.cwi.nl/people/ccw



More information about the testing-in-python mailing list