-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJustfile
More file actions
125 lines (92 loc) · 2.56 KB
/
Justfile
File metadata and controls
125 lines (92 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Just a task runner
# <https://github.com/casey/just>
# shows this help message
help:
@just -l
# runs the benchmark
bench:
cabal bench --enable-tests --benchmark-options='--output a.html'
[private]
alias be := bench
# builds the library
build *args:
cabal build {{args}}
[private]
alias b := build
# shows all warnings and errors
check:
cabal build --ghc-options="-fforce-recomp -fno-code"
[private]
alias c := check
# builds the library with Core output
core *args:
cabal build --ghc-options='-ddump-to-file -ddump-prep' {{args}}
# generates Haddock document
doc *args:
cabal haddock {{args}}
[private]
alias d := doc
# runs doctest
doctest:
cabal repl --with-ghc=doctest --repl-options='-w -Wdefault'
[private]
alias dt := doctest
# runs the lazysegtree example
eg:
cabal run example-lazy-segtree
# runs treefmt
format:
nix fmt .
# treefmt .
[private]
alias fmt := format
# rebuilds the project and measures the compile time (nix flakes required)
measure:
cabal clean && cabal build ac-library-hs --ghc-options "-ddump-to-file -ddump-timings" && nix run nixpkgs#time-ghc-modules
[private]
alias m := measure
# runs local test (parameter example: '-p /SegTree/')
test opts='':
cabal test --enable-tests --test-options '{{opts}}'
[private]
alias t := test
# runs local test a large number of QuickCheck tests
many-test opts='':
cabal test --enable-tests --test-options '--quickcheck-tests 1000 {{opts}}'
[private]
alias mt := many-test
# runs local test a large number of QuickCheck tests
many-many-test opts='':
cabal test --enable-tests --test-options '--quickcheck-tests 10000 {{opts}}'
[private]
alias mmt := many-many-test
# runs local test a large number of QuickCheck tests
mmmt opts='':
cabal test --enable-tests --test-options '--quickcheck-tests 100000 {{opts}}'
# touches all the verification source files
touch:
touch verify/app/*
[private]
alias to := touch
# runs local test for a online judge problem
verify:
#!/usr/bin/env bash
cd verify
file="$(basename "$(ls app/*.hs | fzf --history .fzf-history)")"
touch "app/$file"
oj-verify run "app/$file" -j $(nproc)
[private]
alias v := verify
# runs local test for all of the online judge problems
verify-all:
cd verify && touch app/* && oj-verify run app/*.hs -j $(nproc)
[private]
alias va := verify-all
# runs all of the local tests
test-all:
cabal build && just test && just doctest && just verify-all
[private]
alias ta := test-all
# runs tests and outputs hpc test coverage
coverage *args:
cabal test ---enable-coverage {{args}}