This repository was archived by the owner on Oct 28, 2023. It is now read-only.
generated from EmbarkStudios/opensource-template
-
Notifications
You must be signed in to change notification settings - Fork 84
Add tests and benchmarks #18
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
31f4d0c
Minor cleanup
Jake-Shadle 7fc251c
Add initial integration tests with img_hash
Jake-Shadle b47d1d8
Add initial benchmarks with criterion
Jake-Shadle cee22bd
Add support for specifying thread count
Jake-Shadle be2d7f5
Minor API cleanup
Jake-Shadle 8781952
Move function parameters to GeneratorParams
Jake-Shadle 0e1eedb
Rustfmt
Jake-Shadle 10e3c04
Add max_threads cli argument
Jake-Shadle c5db8ca
Update CHANGELOG
Jake-Shadle bf669cd
Add trailing newline
Jake-Shadle 3422dd1
Update to indicatif 0.12 for leaner deps
Jake-Shadle f65b5ac
Use usize for max_thread_count
Jake-Shadle 290c0b6
Add note about img_hash patch
Jake-Shadle ff19007
Add note about tests and updating them
Jake-Shadle cdb8ead
Implement HashImage in test file
Jake-Shadle 1f321a0
Update deny.toml
Jake-Shadle d64dc41
Add .githooks
Jake-Shadle 82c722e
Rustfmt
Jake-Shadle ff1f801
Add notes in .githooks scripts
Jake-Shadle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
name=$(basename "$0") | ||
root=$(realpath "$(dirname "$(dirname "$0")")") | ||
target_dir="$root/lib/target" | ||
|
||
if ! [ -x "$(command -v critcmp)" ]; then | ||
echo "Installing critcmp..." | ||
cargo install critcmp | ||
fi | ||
|
||
function sub_help() { | ||
printf "Usage: %s <subcommand> [options]\n" "$name" | ||
echo "Subcommands:" | ||
echo " export Exports the specified baselines to json in the benches dir" | ||
echo " cmp Compare two benchmarks by name" | ||
echo "" | ||
echo "For help with each subcommand run:" | ||
echo "$name <subcommand> -h | --help" | ||
echo "" | ||
} | ||
|
||
function sub_cmp() { | ||
critcmp --target-dir "$target_dir" "$@" | ||
} | ||
|
||
function sub_export() { | ||
critcmp --target-dir "$target_dir" --export "$1" > "$root/lib/benches/${2:-$1}.json" | ||
} | ||
|
||
subcommand=$1 | ||
case $subcommand in | ||
"" | "-h" | "--help") | ||
sub_help | ||
;; | ||
*) | ||
shift | ||
"sub_${subcommand}" "$@" | ||
if [ $? = 127 ]; then | ||
echo "Error: '$subcommand' is not a known subcommand." >&2 | ||
echo " Run '$name --help' for a list of known subcommands." >&2 | ||
exit 1 | ||
fi | ||
;; | ||
esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Run rustfmt and fail if there is a diff | ||
cargo fmt -- --check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Run this script from your shell (git bash if you're on windows!) | ||
# * pre-push - Fails to push if you haven't run `cargo fmt` | ||
|
||
git config core.hooksPath .githooks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/target | ||
cli/target | ||
lib/target | ||
**/*.rs.bk | ||
Cargo.lock | ||
/out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.