tasty-program

Use tasty framework to test whether a program executes correctly

https://github.com/jstolarek/tasty-program

Version on this page:1.0.5
LTS Haskell 22.36:1.1.0
Stackage Nightly 2024-10-04:1.1.0
Latest on Hackage:1.1.0

See all snapshots tasty-program appears in

BSD-3-Clause licensed by Jan Stolarek
Maintained by [email protected]
This version can be pinned in stack with:tasty-program-1.0.5@sha256:dd4e30e0095045146945200f48aa46ba3423040fbd1d914be343bfa724407ff4,1894

Module documentation for 1.0.5

tasty-program

This package provides a function that extends tasty testing framework with capability to test whether an external program runs successfully. This package is inspired by test-framework-program package by Adam Wick.

tasty-program provides basic functionality of running a program with specified set of command line parameters, and optionally a working directory, and checking the exit code. Program’s output and error streams are ignored.

You can download latest stable release from Hackage

Example

Given foo.hs source file:

module Foo where

foo :: Int
foo = 5

you can test whether GHC can compile it:

module Main (
  main
 ) where

import Test.Tasty
import Test.Tasty.Program

main :: IO ()
main = defaultMain $ testGroup "Compilation with GHC" $ [
    testProgram "Foo" "ghc" ["-fforce-recomp", "foo.hs"] Nothing
  ]