From d9cf8b9252c274c88c42ea63c822c1a70da79177 Mon Sep 17 00:00:00 2001 From: Corey O'Connor Date: Tue, 12 Nov 2013 22:22:05 -0800 Subject: [PATCH] separate examples to separate package. add build_examples script for quick testing --- CHANGELOG | 14 ++-- build_examples | 3 + test/vty-examples.cabal | 108 ++++++++++++++++++++++++++++++ vty.cabal | 142 +++++----------------------------------- 4 files changed, 135 insertions(+), 132 deletions(-) create mode 100755 build_examples create mode 100644 test/vty-examples.cabal diff --git a/CHANGELOG b/CHANGELOG index 6214085..7865b61 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -26,22 +26,22 @@ * the default amount of time between ESC and a subsequent character that causes VTY to interpret the input as "ESC" then the character, versus some special key, has been increased to 4000 microseconds; 4 milliseconds. - * examples optionally installed, using the --with-examples, with library: + * examples moved to vty-examples package. See test directory for cabal file. * vty-interactive-terminal-test * interactive test. Useful for building a bug report for vty's author. - * tests/interactive_terminal_test.hs + * test/interactive_terminal_test.hs * vty-event-echo - * view a input event log for vty. Small example of interacting with user. - * tests/EventEcho.hs + * view a input event log for vty. Example of interacting with user. + * test/EventEcho.hs * vty-rouge - * A bad rouge-like game. Go from the entrance to exit. Ooooh. Small example of layers + * A bad rouge-like game. Go from the entrance to exit. Example of layers and image build operations. - * tests/Rouge.hs + * test/Rouge.hs * vty-benchmark * benchmarks vty. A series of tests that push random pictures to the terminal. The random pictures are generated using QuickCheck. The same generators used in the automated tests. - * tests/benchmark.hs + * test/benchmark.hs 4.7.0.0 * API changes: diff --git a/build_examples b/build_examples new file mode 100755 index 0000000..3bc895b --- /dev/null +++ b/build_examples @@ -0,0 +1,3 @@ +#!/bin/bash +cabal install +(cd test && cabal install) diff --git a/test/vty-examples.cabal b/test/vty-examples.cabal new file mode 100644 index 0000000..089a176 --- /dev/null +++ b/test/vty-examples.cabal @@ -0,0 +1,108 @@ +name: vty-examples +version: 5.0.0 +license: BSD3 +license-file: ../LICENSE +author: AUTHORS +maintainer: Corey O'Connor (coreyoconnor@gmail.com) +homepage: https://github.com/coreyoconnor/vty +category: User Interfaces +synopsis: Examples programs using the vty library. +description: + vty is terminal GUI library in the niche of ncurses. It is intended to be easy to use, have no + confusing corner cases, and good support for common terminal types. + . + vty-interactive-terminal-test - interactive test. Useful for building a bug report for vtys author. + vty-event-echo - view a input event log for vty. Example of interacting with user. + vty-rouge - A bad rouge-like game. Go from the entrance to exit. Example of layers + vty-benchmark - benchmarks vty. A series of tests that push random pictures to the terminal. + . + © Corey O'Connor; BSD3 license. +cabal-version: >= 1.18.0 +build-type: Simple + +executable vty-interactive-terminal-test + main-is: interactive_terminal_test.hs + + default-language: Haskell2010 + default-extensions: ScopedTypeVariables + + build-depends: vty, + base >= 4 && < 5, + bytestring, + containers, + deepseq >= 1.1 && < 1.4, + ghc-prim, + lens, + mtl >= 1.1.1.0 && < 2.2, + parallel >= 2.2 && < 3.3, + parsec >= 2 && < 4, + string-qq, + terminfo >= 0.3 && < 0.4, + text >= 0.11.3, + unix, + utf8-string >= 0.3 && < 0.4, + vector >= 0.7 + +executable vty-event-echo + main-is: EventEcho.hs + + default-language: Haskell2010 + default-extensions: ScopedTypeVariables + + build-depends: vty, + base >= 4 && < 5, + array >= 0.4 && < 2.0, + bytestring, + containers, + lens, + mtl >= 1.1.1.0 && < 2.2, + parallel >= 2.2 && < 3.3, + text >= 0.11.3, + utf8-string >= 0.3 && < 0.4, + vector >= 0.7 + +executable vty-rouge + main-is: Rouge.hs + + default-language: Haskell2010 + default-extensions: ScopedTypeVariables + + build-depends: vty, + base >= 4 && < 5, + array >= 0.4 && < 2.0, + bytestring, + containers, + lens, + mtl >= 1.1.1.0 && < 2.2, + parallel >= 2.2 && < 3.3, + random >= 1.0 && < 2.0, + text >= 0.11.3, + utf8-string >= 0.3 && < 0.4, + vector >= 0.7 + +executable vty-benchmark + main-is: benchmark.hs + + default-language: Haskell2010 + default-extensions: ScopedTypeVariables + + build-depends: vty, + base >= 4 && < 5, + bytestring, + Cabal == 1.18.*, + containers, + deepseq >= 1.1 && < 1.4, + ghc-prim, + lens, + mtl >= 1.1.1.0 && < 2.2, + parallel >= 2.2 && < 3.3, + parsec >= 2 && < 4, + QuickCheck >= 2.4, + random == 1.0.*, + string-qq, + terminfo >= 0.3 && < 0.4, + text >= 0.11.3, + unix, + utf8-string >= 0.3 && < 0.4, + vector >= 0.7 + diff --git a/vty.cabal b/vty.cabal index adc14cb..8429984 100644 --- a/vty.cabal +++ b/vty.cabal @@ -27,8 +27,8 @@ description: © 2006-2007 Stefan O'Rear; BSD3 license. . © Corey O'Connor; BSD3 license. -cabal-version: >= 1.18.0 -build-type: Simple +cabal-version: >= 1.18.0 +build-type: Simple data-files: README.md, TODO, AUTHORS, @@ -37,7 +37,6 @@ data-files: README.md, library default-language: Haskell2010 - default-extensions: ScopedTypeVariables build-depends: base >= 4 && < 5, bytestring, containers, @@ -96,7 +95,7 @@ library hs-source-dirs: src - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables ForeignFunctionInterface ghc-options: -O2 -funbox-strict-fields -threaded -Wall -fspec-constr -fspec-constr-count=10 @@ -107,7 +106,7 @@ library test-suite verify-attribute-ops default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 hs-source-dirs: test test-module: VerifyAttributeOps @@ -127,7 +126,7 @@ test-suite verify-attribute-ops test-suite verify-using-mock-terminal default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -160,7 +159,7 @@ test-suite verify-using-mock-terminal test-suite verify-terminal default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -193,7 +192,7 @@ test-suite verify-terminal test-suite verify-display-attributes default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -224,7 +223,7 @@ test-suite verify-display-attributes test-suite verify-empty-image-props default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -250,7 +249,7 @@ test-suite verify-empty-image-props test-suite verify-eval-terminfo-caps default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -278,7 +277,7 @@ test-suite verify-eval-terminfo-caps test-suite verify-image-ops default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -306,7 +305,7 @@ test-suite verify-image-ops test-suite verify-image-trans default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -334,7 +333,7 @@ test-suite verify-image-trans test-suite verify-inline default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -361,7 +360,7 @@ test-suite verify-inline test-suite verify-parse-terminfo-caps default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -390,7 +389,7 @@ test-suite verify-parse-terminfo-caps test-suite verify-simple-span-generation default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -422,7 +421,7 @@ test-suite verify-simple-span-generation test-suite verify-crop-span-generation default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -454,7 +453,7 @@ test-suite verify-crop-span-generation test-suite verify-layers-span-generation default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -485,7 +484,7 @@ test-suite verify-layers-span-generation test-suite verify-utf8-width default-language: Haskell2010 - default-extensions: ScopedTypeVariables + default-extensions: ScopedTypeVariables type: detailed-0.9 @@ -540,110 +539,3 @@ test-suite verify-using-mock-input ghc-options: -threaded -Wall -executable vty-interactive-terminal-test - main-is: interactive_terminal_test.hs - - default-language: Haskell2010 - default-extensions: ScopedTypeVariables - - hs-source-dirs: test - - build-depends: vty, - base >= 4 && < 5, - bytestring, - containers, - deepseq >= 1.1 && < 1.4, - ghc-prim, - lens, - mtl >= 1.1.1.0 && < 2.2, - parallel >= 2.2 && < 3.3, - parsec >= 2 && < 4, - string-qq, - terminfo >= 0.3 && < 0.4, - text >= 0.11.3, - unix, - utf8-string >= 0.3 && < 0.4, - vector >= 0.7 - -executable vty-event-echo - main-is: EventEcho.hs - hs-source-dirs: test - - default-language: Haskell2010 - default-extensions: ScopedTypeVariables - - build-depends: vty, - base >= 4 && < 5, - array >= 0.4 && < 2.0, - bytestring, - containers, - lens, - mtl >= 1.1.1.0 && < 2.2, - parallel >= 2.2 && < 3.3, - text >= 0.11.3, - utf8-string >= 0.3 && < 0.4, - vector >= 0.7 - -executable vty-rouge - main-is: Rouge.hs - hs-source-dirs: test - - default-language: Haskell2010 - default-extensions: ScopedTypeVariables - - build-depends: vty, - base >= 4 && < 5, - array >= 0.4 && < 2.0, - bytestring, - containers, - lens, - mtl >= 1.1.1.0 && < 2.2, - parallel >= 2.2 && < 3.3, - random >= 1.0 && < 2.0, - text >= 0.11.3, - utf8-string >= 0.3 && < 0.4, - vector >= 0.7 - -executable vty-benchmark - main-is: benchmark.hs - - default-language: Haskell2010 - default-extensions: ScopedTypeVariables - - hs-source-dirs: test - - build-depends: vty, - base >= 4 && < 5, - bytestring, - Cabal == 1.18.*, - containers, - deepseq >= 1.1 && < 1.4, - ghc-prim, - lens, - mtl >= 1.1.1.0 && < 2.2, - parallel >= 2.2 && < 3.3, - parsec >= 2 && < 4, - QuickCheck >= 2.4, - random == 1.0.*, - string-qq, - terminfo >= 0.3 && < 0.4, - text >= 0.11.3, - unix, - utf8-string >= 0.3 && < 0.4, - vector >= 0.7 - --- ControlTable.hs --- HereDoc.hs --- Test.hs --- Test2.hs --- Verify.hs --- Verify/Data/Terminfo/Parse.hs --- Verify/Graphics/Vty/Attributes.hs --- Verify/Graphics/Vty/DisplayRegion.hs --- Verify/Graphics/Vty/Image.hs --- Verify/Graphics/Vty/Picture.hs --- Verify/Graphics/Vty/Span.hs --- vty_inline_example.hs --- vty_issue_18.hs --- yi_issue_264.hs -