toolsetup:testframework
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| toolsetup:testframework [2021/03/23 16:06] – [Test framework setup] f2b216 | toolsetup:testframework [2025/10/08 00:48] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Test framework setup ====== | ====== Test framework setup ====== | ||
| - | ~~DISCUSSION~~ | ||
| - | |||
| ===== Preconditions / configuration ===== | ===== Preconditions / configuration ===== | ||
| Line 13: | Line 11: | ||
| ===== Steps ===== | ===== Steps ===== | ||
| - | | + | <WRAP center round important 60%> |
| + | All to to be reworked for [[https:// | ||
| + | </ | ||
| + | |||
| + | | ||
| * code below '' | * code below '' | ||
| * < | * < | ||
| dependencies: | dependencies: | ||
| - < | - < | ||
| - | - test-framework | + | - < |
| - | - test-framework-hunit | + | |
| - | - test-framework-quickcheck2 | + | |
| - | - HUnit | + | |
| - | - QuickCheck | + | |
| </ | </ | ||
| * complete file of package.yaml | * complete file of package.yaml | ||
| Line 60: | Line 58: | ||
| dependencies: | dependencies: | ||
| - < | - < | ||
| - | - test-framework | + | - < |
| - | - test-framework-hunit | + | |
| - | - test-framework-quickcheck2 | + | |
| - | - HUnit | + | |
| - | - QuickCheck | + | |
| </ | </ | ||
| - On windows setups, in order to avoid problems with regex (see https:// | - On windows setups, in order to avoid problems with regex (see https:// | ||
| Line 101: | Line 95: | ||
| - Implement the test in file " | - Implement the test in file " | ||
| * < | * < | ||
| - | import Test.Framework | + | -- to be adapted for using tasty |
| - | import | + | import ... |
| - | import Test.Framework.Providers.QuickCheck2 | + | |
| - | import Test.HUnit | + | |
| - | import Test.QuickCheck | + | |
| import qualified Lib as Lib | import qualified Lib as Lib | ||
| main :: IO () | main :: IO () | ||
| - | main = defaultMainWithOpts | + | main = ... |
| - | [ testCase " | + | |
| - | , testProperty " | + | |
| - | ] mempty | + | |
| - | testRev :: Assertion | + | ... |
| - | testRev = Lib.reverse2 [1, 2, 3] @?= [3, 2, 1] | + | |
| - | propListRevRevId :: [Int] -> Property | ||
| - | propListRevRevId xs = not (null xs) ==> Lib.reverse2 (Lib.reverse2 xs) == xs | ||
| </ | </ | ||
| - Run '' | - Run '' | ||
| * < | * < | ||
| - | Test1-0.1.0.0: unregistering (dependencies changed) | + | ... |
| - | Test1> configure (lib + exe + test) | + | </code> |
| - | Configuring Test1-0.1.0.0... | + | |
| - | Test1> build (lib + exe + test) | + | |
| - | Preprocessing library for Test1-0.1.0.0.. | + | |
| - | Building library for Test1-0.1.0.0.. | + | |
| - | [1 of 2] Compiling Lib | + | |
| - | [2 of 2] Compiling Paths_Test1 | + | |
| - | Preprocessing executable ' | + | |
| - | Building executable ' | + | |
| - | [1 of 2] Compiling Main [Lib changed] | + | |
| - | [2 of 2] Compiling Paths_Test1 | + | |
| - | Linking .stack-work\dist\274b403a\build\Test1-exe\Test1-exe.exe ... | + | |
| - | Preprocessing test suite ' | + | |
| - | Building test suite ' | + | |
| - | [2 of 2] Compiling Main | + | |
| - | Linking .stack-work\dist\274b403a\build\Test1-test\Test1-test.exe ... | + | |
| - | Test1> copy/register | + | |
| - | Installing library in ...\Test1\.stack-work\install\261a8b8d\lib\x86_64-windows-ghc-8.10.4\Test1-0.1.0.0-584XNC80AeFHEA877FoaQr | + | |
| - | Installing executable Test1-exe in ...\Test1\.stack-work\install\261a8b8d\bin | + | |
| - | Registering library for Test1-0.1.0.0.. | + | |
| - | Test1> test (suite: Test1-test) | + | |
| - | rev: [OK] | ||
| - | listRevRevId: | ||
| - | | + | ===== ✎ ===== |
| - | Passed | + | ~~DISCUSSION~~ |
| - | | + | |
| - | | + | |
| - | + | ||
| - | Test1> Test suite Test1-test passed | + | |
| - | Completed 2 action(s).</ | + | |
toolsetup/testframework.1616511991.txt.gz · Last modified: (external edit)
