List Archive

Thread

Thread Index

Message

From: Thomas Klausner <tk%giga.or.at@localhost>
To: Sebastian Schmitt <Sebastian.Schmitt%auvesy.de@localhost>
Subject: Re: How to write tests?
Date: Fri, 20 Dec 2019 22:44:56 +0100

Hi Sebastian!

On Thu, Dec 19, 2019 at 09:31:13AM +0000, Sebastian Schmitt wrote:
> I would like to write tests for my changes.
> At the moment I am testing by writing small sample programs.
> Can you briefly describe how I can add new test cases to the existing ones?

We use a test running script (runtest) that uses input files
(regress/*.test). The runtest script supports a couple commands, but
since noone except us two has written tests so far, they are not
documented :)

The basic usage to run a test is:

    cd build/regress
    ./runtest foo

for running the test described in ../../regress/foo.test

Most of the tests provide base zip archives, use ziptool (the regress
version with added commands) to modify them, and compare the output
against known-good zip archives.

I recommend looking at a test that does something similar to what you
want to do and copy & modify it. When it's done, add it to the test
list in the cmake file.

Cheers,
 Thomas

Made by MHonArc.