For one cabal'ised library: running specific benchmarks & tests, and obtaining multiple Travis reports
Hi, Three questions: 1) running specific criterion benchmark groups, 2) running specific test-framework test groups, and 3) getting multiple Travis CI reports for one cabal'ised library. 1. Running specific criterion benchmark groups Given this benchmark harness: main = defaultMain [ bgroup "fib" [ bench "1" $ whnf fib 1 , bench "5" $ whnf fib 5 , bench "9" $ whnf fib 9 , bench "11" $ whnf fib 11 ] ] How do I run one specific group benchmar, or a specific benchmark in a specific group? Can I run: $ cabal bench "fib" or $ cabal bench "fib/1" 2. Running specific test-framework test groups Given this test harness with test-framework: main = defaultMain tests tests = [ testGroup "Sorting-Group-1" [ testProperty "sort1" prop_sort1, testProperty "sort2" prop_sort2, testProperty "sort3" prop_sort3 ], testGroup "Sorting-Group-2" [ testProperty "sort4" prop_sort4, testProperty "sort5" prop_sort5, testProperty "sort6" prop_sort6, testCase "sort7" test_sort7, testCase "sort8" test_sort8 ] ] Can I run: $ cabal test "Sorting-Group-1" or $ cabal test "Sorting-Group-1/sort3" 3. Separating cabal'ised project to separate Travis CI badges For my current project, I get one Travis CI report for all of HUnit and QuikCheck tests I write for a cabal'ised library expressed with test-framework. For example, if 108 tests fail I get one Travis CI report saying #108 failing tests, and I get one Travis CI badge of the form: https://travis-ci.org/<my_username>/<library_name>.png?branch=master What I'd really like is to retrieve multiple Travis CI reports and multiple Travis CI badges for one Haskell libray. E.g. API tests: passing (with a URL for a green badge). Parser tests: #108 failing (with a URL for a red badge). Messaging tests: #16 failing (with a URL for a red badge). How could I refactor my test groups so that Travis CI will provide me multiple reports for one cabal'ised project? Thanks! -- Rob Stewart
$ cabal bench "fib"
Cabal adds a layer of indirection to the workflow. In order to pass arguments to your benchmark program, you must prefix each argument with '--benchmark-option=', leading to this: $ cabal bench --bench-mark-option="fib" The quotes are optional in this case. For more information, run 'cabal bench --help'.
$ cabal test "Sorting-Group-1"
Same here. To pass the argument "Sorting-Group-1" to your test program, you must prefix each argument with '--test-option=', leading to this: $ cabal test --test-option="Sorting-Group-1" For more information, run 'cabal test --help'.
participants (2)
-
Phil Ruffwind -
Rob Stewart