Skip to content

Commit

Permalink
tests/datatests: better workaround for $path::run_test rustc limitation
Browse files Browse the repository at this point in the history
For some reason $path::whatever is not a valid `path` according to rustc.

See:
- nextest-rs/datatest-stable#4
- rust-lang/rust#48067
  • Loading branch information
badicsalex committed Jul 12, 2022
1 parent d7d7e35 commit 2a88667
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion tests/datatests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// along with Hun-law. If not, see <http://www.gnu.org/licenses/>.

pub mod grammar;
pub use grammar::*;

pub mod test_pdf_parser;
pub mod test_structure_parser;
12 changes: 5 additions & 7 deletions tests/run_datatests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
mod datatests;
pub mod test_utils;

use datatests::*;

#[allow(unused_macros)]
macro_rules! declare_test {
(dir = $dir:expr, pattern = $pattern:expr) => {
Expand All @@ -37,12 +35,12 @@ macro_rules! declare_test {
pub(crate) use declare_test;

macro_rules! generate_harness{
($($test:ident),*) => {
($($id_first:ident$(::$id_rest:ident)*),*) => {
datatest_stable::harness!(
$(
$test::run_test,
$test::test_dir(),
$test::FILE_PATTERN,
datatests::$id_first$(::$id_rest)*::run_test,
datatests::$id_first$(::$id_rest)*::test_dir(),
datatests::$id_first$(::$id_rest)*::FILE_PATTERN,
)*
);
}
Expand All @@ -51,5 +49,5 @@ macro_rules! generate_harness{
generate_harness!(
test_pdf_parser,
test_structure_parser,
test_reference_parsing
grammar::test_reference_parsing
);

0 comments on commit 2a88667

Please sign in to comment.