aboutsummaryrefslogtreecommitdiff
path: root/src/Justfile
blob: a96a7797b86ad096f9eef82a92ee50aa4d86c032 (plain)
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
candelabra := `which candelabra-cli 2>/dev/null || echo ./target/debug/candelabra-cli`
target_dir := justfile_directory() / "target"
tests_dir := justfile_directory() / "tests"
tests_manifest := tests_dir / "Cargo.toml"

impls := "std::collections::BTreeSet primrose_library::LazySortedVec std::collections::LinkedList primrose_library::EagerUniqueVec std::collections::HashSet std::collections::BTreeMap std::collections::HashMap primrose_library::LazyUniqueVec primrose_library::EagerSortedVec std::vec::Vec"
proj := "std::vec::Vec std::collections::LinkedList"
export RUST_LOG := "debug"

run-all-tests:
  which candelabra-cli 2>/dev/null || cargo build
  rm -fr {{target_dir}}/candelabra
  rm -fr {{tests_dir}}/target/criterion
  echo "Candelabra Path: {{candelabra}}"

  @IMPLS=`{{candelabra}} list-library 2>&1 | cut -d ']' -f 2 | grep ::`; for impl in $IMPLS; do just cost-model $impl; done
  @cd tests/ && for i in $(ls -d */); do [ "${i%%/}" == "target" ] || just select ${i%%/}; done

cost-model impl: (section-start ("cost-model-" + impl)) && (section-end ("cost-model-" + impl))
  {{candelabra}} -l cost-model {{impl}}

select proj: (section-start ("compare-" + proj)) && (section-end ("compare-" + proj))
  {{candelabra}} -l --manifest-path {{tests_manifest}} -p {{proj}} select

compare proj: (section-start ("compare-" + proj)) && (section-end ("compare-" + proj))
  {{candelabra}} -l --manifest-path {{tests_manifest}} -p {{proj}} select --compare

@section-start NAME:
  echo -e "\e[0Ksection_start:`date +%s`:{{replace(NAME, ":", "-")}}\r\e[0K{{replace(NAME, ":", "-")}}"

@section-end NAME:
  echo -e "\e[0Ksection_end:`date +%s`:{{replace(NAME, ":", "-")}}\r\e[0K"