Skip to content

Commit

Permalink
Adding justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
WGUNDERWOOD committed May 8, 2024
1 parent b92034b commit f71ebd5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions extra/latex.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
echo "Checking latex PDFs agree"
DIR="$(mktemp -d)"
cp ../tests/*_in.tex $DIR
cp ../tests/*_out.tex $DIR
Expand Down
1 change: 1 addition & 0 deletions extra/perf.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
echo "Getting performance metrics"
DIR="$(mktemp -d)"
cp ../tests/*_in.* $DIR
cargo build --release
Expand Down
1 change: 1 addition & 0 deletions extra/prof.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
echo "Making flamegraph profile"
DIR="$(mktemp -d)"
cp ../tests/phd_dissertation_in.tex $DIR
cargo build --release
Expand Down
26 changes: 26 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
default: test latex clippy format prof

all: default perf

alias t := test
alias l := latex
alias c := clippy
alias f := format

test:
@cargo test

latex:
@cd extra && bash latex.sh

perf:
@cd extra && bash perf.sh

prof:
@cd extra && bash prof.sh

clippy:
@cargo clippy

format:
@cargo fmt
1 change: 0 additions & 1 deletion notes.org
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#+title: tex-fmt
* Tasks
** Look for problem cases in other latex documents
** justfile
** Tidy code
* Features
** Implement new flags
Expand Down
3 changes: 0 additions & 3 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod tests {
use std::fs;

const YELLOW: &str = "\x1b[33m\x1b[1m";
const GREEN: &str = "\x1b[32m\x1b[1m";
const RED: &str = "\x1b[31m\x1b[1m";
const WHITE: &str = "\x1b[37m\x1b[1m";
const RESET: &str = "\x1b[00m\x1b[0m";
Expand Down Expand Up @@ -53,7 +52,6 @@ mod tests {
&YELLOW,
&RESET,
&out_file);
println!("{}Pass: {}{}", &GREEN, &RESET, &in_filename);
}

#[apply(test_file)]
Expand All @@ -76,6 +74,5 @@ mod tests {
&YELLOW,
&RESET,
&out_file);
println!("{}Pass: {}{}", &GREEN, &RESET, &out_filename);
}
}

0 comments on commit f71ebd5

Please sign in to comment.