aboutsummaryrefslogtreecommitdiff
path: root/src/Justfile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Justfile')
-rw-r--r--src/Justfile38
1 files changed, 30 insertions, 8 deletions
diff --git a/src/Justfile b/src/Justfile
index 1a503ff..7c31771 100644
--- a/src/Justfile
+++ b/src/Justfile
@@ -1,11 +1,33 @@
-select PROJ:
- cargo run -- --manifest-path tests/Cargo.toml -p {{PROJ}} select
+candelabra := `which candelabra 2>/dev/null || echo ./target/debug/candelabra`
+target_dir := justfile_directory() / "target"
+tests_dir := justfile_directory() / "tests"
+tests_manifest := tests_dir / "Cargo.toml"
-compare PROJ:
- cargo run -- --manifest-path tests/Cargo.toml -p {{PROJ}} select --compare
+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"
-candidates PROJ:
- cargo run -- --manifest-path tests/Cargo.toml -p {{PROJ}} candidates
+run-all-tests:
+ which candelabra 2>/dev/null || cargo build
+ rm -fr {{target_dir / "candelabra"}}
+ echo "Candelabra Path: {{candelabra}}"
-cost-model IMPL:
- cargo run -- cost-model {{IMPL}}
+ @just section-start cost-models
+ @IMPLS=`cargo run -- list-library 2>&1 | cut -d ']' -f 2 | grep ::`; for impl in $IMPLS; do just cost-model $impl; done
+ @just section-end cost-models
+
+ @just section-start comparisons
+ cd tests/ && for i in $(ls -d */); do [ "${i%%/}" == "target" ] || just compare ${i%%/}; done
+ @just section-end comparisons
+
+cost-model impl: (section-start ("cost-model-" + impl)) && (section-end ("cost-model-" + impl))
+ {{candelabra}} cost-model {{impl}}
+
+compare proj: (section-start ("compare-" + proj)) && (section-end ("compare-" + proj))
+ {{candelabra}} --manifest-path {{tests_manifest}} -p {{proj}} select --compare
+
+@section-start NAME:
+ echo -e "\e[0Ksection_start:`date +%s`:{{NAME}}\r\e[0K{{NAME}}"
+
+@section-end NAME:
+ echo -e "\e[0Ksection_end:`date +%s`:{{NAME}}\r\e[0K"