User:Allan/Makepkg Test Suite

From ArchWiki

Outline

The test suite will be written in python. It will have the following components (naming not fixed...)

  • pbparse.py - A simple PKGBUILD parser
  • pbtest.py - A script to parse the test data
  • mptest.py - A script to run the test suite
  • test/test??? - test suite PKGBUILDs

Example Test Suite PKGBUILD

The test suite are standard PKGBUILDs with information on how they are intended to be run in the header comments.

# TEST: Minimal working PKGBUILD
# FLAGS:
# EXPECTED: pass
# SOURCE:

pkgname=NAME
pkgver=VERSION
pkgrel=1
arch=('any')

build() {
  return 0
}

The fields available at the top are:

  • TEST - a description of the test being performed
  • FLAGS - flags to be passed to makepkg
  • EXPECTED - either pass/fail for the expected result from makepkg
  • SOURCE - files needed to be copied to the test build directory

Tests will be run using the --config and -p options in temporary directories