Parch

Testing applications

Unit and integration tests

Use the language's standard framework and wire it into makepkg check() so packaging runs it:

StackFrameworkRuns in PKGBUILD via
Pythonpytestcheckdepends=('python-pytest'), check() runs pytest
Rustbuilt-in testscargo test --frozen in check()
C++/QtCTestcmake --build build && ctest --test-dir build
Shellbatscheckdepends=('bats')
check() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    pytest -q
}

Integration tests exercise real interactions: a package-manager frontend (pastor-style) should have a test that reads a fixture sync database; a settings service should test its config round-trip.

GUI testing

GUI test frameworks exist, but the pragmatic Parch baseline is:

  • A scripted smoke test: launch the app under Xvfb/Wayland headless, assert the process stays alive and exposes its main window, quit.
  • Manual pass over the primary flow on every release.
  • Screenshots in the PR for UI changes (both themes).
  • For toolkit automation when needed: GTK apps can drive tests through AT-SPI (dogtail/pyatspi); Qt apps through Qt Test.

Accessibility testing

  • Keyboard-only pass: every flow operable without a pointer.
  • Screen reader pass with Orca over the primary flow: names and roles sensible, no "unlabeled button".
  • Contrast check on real content in both themes.
  • 200% scaling without clipped controls. The rules these enforce live in the accessibility HIG.

Localization testing

  1. Run with LANG=fa_IR.UTF-8 and walk the app: reflow, truncation, directionality.
  2. Inject mixed-direction strings (package names inside Persian sentences).
  3. Check plural forms: Persian plurals differ from English; use gettext plural rules, never if (n == 1).
  4. Confirm untranslatable content (commands, package names) stays LTR and intact. Details: testing translated apps.

Regression discipline

When a bug is reported:

  1. Write the failing test first (unit where possible, scripted smoke at worst).
  2. Fix until green.
  3. Keep the test forever.

Bugs that escape to users get a test in the same PR as the fix; that is the policy, not a suggestion.