From 10e2fe35b57148693a62deaf414bacc35ee99ae4 Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Wed, 15 Nov 2023 12:02:09 -0500 Subject: [PATCH] benches: Move assets outside of benches Also specify the paths of the benchmarks, since publishing breaks when it cannot find them. --- Cargo.toml | 4 +- benches/create_tag.rs | 8 ++-- benches/read_file.rs | 42 +++++++++++++----- .../01 TempleOS Hymn Risen (Remix).aac | Bin .../01 TempleOS Hymn Risen (Remix).aiff | Bin .../01 TempleOS Hymn Risen (Remix).ape | Bin .../01 TempleOS Hymn Risen (Remix).flac | Bin .../01 TempleOS Hymn Risen (Remix).m4a | Bin .../01 TempleOS Hymn Risen (Remix).mp3 | Bin .../01 TempleOS Hymn Risen (Remix).mpc | Bin .../01 TempleOS Hymn Risen (Remix).ogg | Bin .../01 TempleOS Hymn Risen (Remix).opus | Bin .../01 TempleOS Hymn Risen (Remix).spx | Bin .../01 TempleOS Hymn Risen (Remix).wav | Bin .../01 TempleOS Hymn Risen (Remix).wv | Bin {benches/assets => benches_assets}/cover.jpg | Bin 16 files changed, 37 insertions(+), 17 deletions(-) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).aac (100%) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).aiff (100%) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).ape (100%) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).flac (100%) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).m4a (100%) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).mp3 (100%) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).mpc (100%) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).ogg (100%) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).opus (100%) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).spx (100%) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).wav (100%) rename {benches/assets => benches_assets}/01 TempleOS Hymn Risen (Remix).wv (100%) rename {benches/assets => benches_assets}/cover.jpg (100%) diff --git a/Cargo.toml b/Cargo.toml index 0fdb91a6..2b7585b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/Serial-ATA/lofty-rs" keywords = ["tags", "audio", "metadata", "id3", "vorbis"] categories = ["multimedia", "multimedia::audio", "parser-implementations"] readme = "README.md" -include = ["src", "Cargo.toml", "LICENSE-APACHE", "LICENSE-MIT", "benches", "SUPPORTED_FORMATS.md"] +include = ["src", "Cargo.toml", "LICENSE-APACHE", "LICENSE-MIT", "SUPPORTED_FORMATS.md"] [dependencies] # Vorbis comments pictures @@ -47,10 +47,12 @@ bench = false [[bench]] name = "read_file" +path = "benches/read_file.rs" harness = false [[bench]] name = "create_tag" +path = "benches/create_tag.rs" harness = false [[example]] diff --git a/benches/create_tag.rs b/benches/create_tag.rs index 454cc8b8..5a827b61 100644 --- a/benches/create_tag.rs +++ b/benches/create_tag.rs @@ -49,7 +49,7 @@ fn bench_write(c: &mut Criterion) { PictureType::CoverFront, MimeType::Jpeg, None, - include_bytes!("assets/cover.jpg").to_vec(), + include_bytes!("../benches_assets/cover.jpg").to_vec(), ); tag.insert( @@ -75,7 +75,7 @@ fn bench_write(c: &mut Criterion) { PictureType::CoverFront, MimeType::Jpeg, None, - include_bytes!("assets/cover.jpg").to_vec(), + include_bytes!("../benches_assets/cover.jpg").to_vec(), ); tag.insert_picture(picture); @@ -99,7 +99,7 @@ fn bench_write(c: &mut Criterion) { PictureType::CoverFront, MimeType::Jpeg, None, - include_bytes!("assets/cover.jpg").to_vec(), + include_bytes!("../benches_assets/cover.jpg").to_vec(), ); tag.insert_picture(picture); @@ -118,7 +118,7 @@ fn bench_write(c: &mut Criterion) { PictureType::CoverFront, MimeType::Jpeg, None, - include_bytes!("assets/cover.jpg").to_vec(), + include_bytes!("../benches_assets/cover.jpg").to_vec(), ); let _ = tag.insert_picture(picture, None).unwrap(); diff --git a/benches/read_file.rs b/benches/read_file.rs index 3b4f9166..bc32651b 100644 --- a/benches/read_file.rs +++ b/benches/read_file.rs @@ -30,18 +30,36 @@ fn content_infer_read(c: &mut Criterion) { test_read_file!( c, [ - (AAC, "assets/01 TempleOS Hymn Risen (Remix).aac"), - (AIFF, "assets/01 TempleOS Hymn Risen (Remix).aiff"), - (APE, "assets/01 TempleOS Hymn Risen (Remix).ape"), - (FLAC, "assets/01 TempleOS Hymn Risen (Remix).flac"), - (MP4, "assets/01 TempleOS Hymn Risen (Remix).m4a"), - (MP3, "assets/01 TempleOS Hymn Risen (Remix).mp3"), - (MPC, "assets/01 TempleOS Hymn Risen (Remix).mpc"), - (OPUS, "assets/01 TempleOS Hymn Risen (Remix).opus"), - (RIFF, "assets/01 TempleOS Hymn Risen (Remix).wav"), - (SPEEX, "assets/01 TempleOS Hymn Risen (Remix).spx"), - (VORBIS, "assets/01 TempleOS Hymn Risen (Remix).ogg"), - (WAVPACK, "assets/01 TempleOS Hymn Risen (Remix).wv"), + (AAC, "../benches_assets/01 TempleOS Hymn Risen (Remix).aac"), + ( + AIFF, + "../benches_assets/01 TempleOS Hymn Risen (Remix).aiff" + ), + (APE, "../benches_assets/01 TempleOS Hymn Risen (Remix).ape"), + ( + FLAC, + "../benches_assets/01 TempleOS Hymn Risen (Remix).flac" + ), + (MP4, "../benches_assets/01 TempleOS Hymn Risen (Remix).m4a"), + (MP3, "../benches_assets/01 TempleOS Hymn Risen (Remix).mp3"), + (MPC, "../benches_assets/01 TempleOS Hymn Risen (Remix).mpc"), + ( + OPUS, + "../benches_assets/01 TempleOS Hymn Risen (Remix).opus" + ), + (RIFF, "../benches_assets/01 TempleOS Hymn Risen (Remix).wav"), + ( + SPEEX, + "../benches_assets/01 TempleOS Hymn Risen (Remix).spx" + ), + ( + VORBIS, + "../benches_assets/01 TempleOS Hymn Risen (Remix).ogg" + ), + ( + WAVPACK, + "../benches_assets/01 TempleOS Hymn Risen (Remix).wv" + ), ] ); } diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).aac b/benches_assets/01 TempleOS Hymn Risen (Remix).aac similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).aac rename to benches_assets/01 TempleOS Hymn Risen (Remix).aac diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).aiff b/benches_assets/01 TempleOS Hymn Risen (Remix).aiff similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).aiff rename to benches_assets/01 TempleOS Hymn Risen (Remix).aiff diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).ape b/benches_assets/01 TempleOS Hymn Risen (Remix).ape similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).ape rename to benches_assets/01 TempleOS Hymn Risen (Remix).ape diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).flac b/benches_assets/01 TempleOS Hymn Risen (Remix).flac similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).flac rename to benches_assets/01 TempleOS Hymn Risen (Remix).flac diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).m4a b/benches_assets/01 TempleOS Hymn Risen (Remix).m4a similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).m4a rename to benches_assets/01 TempleOS Hymn Risen (Remix).m4a diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).mp3 b/benches_assets/01 TempleOS Hymn Risen (Remix).mp3 similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).mp3 rename to benches_assets/01 TempleOS Hymn Risen (Remix).mp3 diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).mpc b/benches_assets/01 TempleOS Hymn Risen (Remix).mpc similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).mpc rename to benches_assets/01 TempleOS Hymn Risen (Remix).mpc diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).ogg b/benches_assets/01 TempleOS Hymn Risen (Remix).ogg similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).ogg rename to benches_assets/01 TempleOS Hymn Risen (Remix).ogg diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).opus b/benches_assets/01 TempleOS Hymn Risen (Remix).opus similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).opus rename to benches_assets/01 TempleOS Hymn Risen (Remix).opus diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).spx b/benches_assets/01 TempleOS Hymn Risen (Remix).spx similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).spx rename to benches_assets/01 TempleOS Hymn Risen (Remix).spx diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).wav b/benches_assets/01 TempleOS Hymn Risen (Remix).wav similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).wav rename to benches_assets/01 TempleOS Hymn Risen (Remix).wav diff --git a/benches/assets/01 TempleOS Hymn Risen (Remix).wv b/benches_assets/01 TempleOS Hymn Risen (Remix).wv similarity index 100% rename from benches/assets/01 TempleOS Hymn Risen (Remix).wv rename to benches_assets/01 TempleOS Hymn Risen (Remix).wv diff --git a/benches/assets/cover.jpg b/benches_assets/cover.jpg similarity index 100% rename from benches/assets/cover.jpg rename to benches_assets/cover.jpg