test harness skeleton

This commit is contained in:
Tom Sydney Kerckhove 2023-01-14 20:43:45 +01:00
parent f8d05f0653
commit 8c72dda2ed
8 changed files with 120 additions and 1 deletions

2
feedback-test-harness/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.stack-work/
*~

View File

@ -0,0 +1,15 @@
{ mkDerivation, base, feedback, lib, path, path-io, sydtest
, sydtest-discover, typed-process
}:
mkDerivation {
pname = "feedback-test-harness";
version = "0.0.0.0";
src = ./.;
libraryHaskellDepends = [ base feedback path path-io ];
testHaskellDepends = [ base feedback sydtest typed-process ];
testToolDepends = [ sydtest-discover ];
doHaddock = false;
homepage = "https://github.com/NorfairKing/feedback#readme";
description = "Tests for 'feedback'";
license = lib.licenses.gpl3Only;
}

View File

@ -0,0 +1,55 @@
cabal-version: 2.2
-- This file has been generated from package.yaml by hpack version 0.34.7.
--
-- see: https://github.com/sol/hpack
name: feedback-test-harness
version: 0.0.0.0
synopsis: Tests for 'feedback'
homepage: https://github.com/NorfairKing/feedback#readme
bug-reports: https://github.com/NorfairKing/feedback/issues
author: Tom Sydney Kerckhove
maintainer: syd@cs-syd.eu
copyright: Copyright (c) 2022-2023 Tom Sydney Kerckhove
license: GPL-3.0-only
build-type: Simple
source-repository head
type: git
location: https://github.com/NorfairKing/feedback
library
other-modules:
Paths_feedback_test_harness
autogen-modules:
Paths_feedback_test_harness
hs-source-dirs:
src
build-depends:
base >=4.7 && <5
, feedback
, path
, path-io
default-language: Haskell2010
test-suite feedback-test
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
FeedbackSpec
Paths_feedback_test_harness
autogen-modules:
Paths_feedback_test_harness
hs-source-dirs:
test/
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
build-tool-depends:
sydtest-discover:sydtest-discover
build-depends:
base >=4.7 && <5
, feedback
, feedback-test-harness
, sydtest
, typed-process
default-language: Haskell2010

View File

@ -0,0 +1,34 @@
name: feedback-test-harness
version: 0.0.0.0
github: "NorfairKing/feedback"
license: GPL-3.0-only
author: "Tom Sydney Kerckhove"
maintainer: "syd@cs-syd.eu"
copyright: "Copyright (c) 2022-2023 Tom Sydney Kerckhove"
synopsis: Tests for 'feedback'
dependencies:
- base >= 4.7 && < 5
library:
source-dirs: src
dependencies:
- feedback
- path
- path-io
tests:
feedback-test:
main: Spec.hs
source-dirs: test/
build-tools: sydtest-discover
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -Wall
dependencies:
- feedback
- feedback-test-harness
- sydtest
- typed-process

View File

@ -0,0 +1,11 @@
module FeedbackSpec (spec) where
import System.Process.Typed
import Test.Syd
spec :: Spec
spec = sequential $ do
it "can show help text" $ do
let cp = setStdout nullStream $ proc "feedback" ["--help"]
runProcess_ cp :: IO ()
pure ()

View File

@ -0,0 +1 @@
{-# OPTIONS_GHC -F -pgmF sydtest-discover #-}

View File

@ -63,7 +63,7 @@
};
devShells.${system}.default = pkgs.haskellPackages.shellFor {
name = "feedback-shell";
packages = p: [ p.feedback ];
packages = p: [ p.feedback p.feedback-test-harness ];
withHoogle = true;
doBenchmark = true;
buildInputs = (with pkgs; [

View File

@ -15,6 +15,7 @@ with final.haskell.lib;
overrides = composeExtensions (old.overrides or (_: _: { })) (
self: super:
{
feedback-test-harness = addBuildDepend (self.callPackage ../feedback-test-harness { }) final.feedback;
feedback = generateOptparseApplicativeCompletion "feedback" (
buildFromSdist (overrideCabal
(