-
Notifications
You must be signed in to change notification settings - Fork 2
/
Justfile
49 lines (37 loc) · 1.11 KB
/
Justfile
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
set dotenv-load
alias i := init_build
alias b := build
alias p := package
alias e := exe
alias t := test
alias c := clean
cxx_compiler := "${CXX}"
c_compiler := "${CC}"
build_dir := "build-" + cxx_compiler
ncores := `nproc`
# cd {{build_dir}} && CC={{c_compiler}} CXX={{cxx_compiler}} cmake -DWITH_TESTS=off ..
default:
@just --list
init_build: clean
mkdir -p {{build_dir}}
cd {{build_dir}} && CC={{c_compiler}} CXX={{cxx_compiler}} cmake -DWITH_TESTS=off -DWITH_EXAMPLES=on ..
ln -fs {{build_dir}}/compile_commands.json compile_commands.json
build:
cd {{build_dir}} && make -j {{ncores}}
exe:
./{{build_dir}}/example/main
fuzz_duration := "30s"
test:
#!/usr/bin/env bash
set -euxo pipefail
dimensions=(10 30 50 100)
for dim in ${dimensions[@]}; do
./{{build_dir}}/test/cecxx-fuzz --fuzz="Cec2017ConformanceTest.Cec2017D${dim}ImplsAreEquiv" --fuzz_for={{fuzz_duration}} || true
done
package:
cd {{build_dir}} && cpack
clean:
rm -rf {{build_dir}}
fmt:
find src -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format -i
find include -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format -i