From 301512eaa7315edb32920b37b20ae162d13486bf Mon Sep 17 00:00:00 2001 From: T6 Date: Tue, 28 May 2024 15:27:48 -0400 Subject: [PATCH] use `dyntest` for `tests/tests.rs` (#136) --- Cargo.lock | 212 +----------------- Cargo.toml | 6 +- cspell.json | 1 + ... pre_reduce_run@examples::arithmetic.snap} | 0 ...un@examples::church_encoding::church.snap} | 0 ..._run@examples::lambda_calculus::hoas.snap} | 0 ...e_run@examples::machine_u32::num_add.snap} | 0 ...run@examples::machine_u32::num_match.snap} | 0 ...les::sort::bitonic::bitonic_sort_lam.snap} | 0 ...un@examples::sort::merge::merge_sort.snap} | 0 ...xamples::sort::radix::radix_sort_ctr.snap} | 0 ...xamples::sort::radix::radix_sort_lam.snap} | 0 ..._run@tests::programs::alloc_big_tree.snap} | 0 ...un@tests::programs::alloc_small_tree.snap} | 0 ...reduce_run@tests::programs::bool_and.snap} | 0 ...uce_run@tests::programs::chained_ops.snap} | 0 ...duce_run@tests::programs::church_exp.snap} | 0 ...duce_run@tests::programs::church_mul.snap} | 0 ...uce_run@tests::programs::commutation.snap} | 0 ...reduce_run@tests::programs::dec_bits.snap} | 0 ...e_run@tests::programs::dec_bits_tree.snap} | 0 ..._reduce_run@tests::programs::era_era.snap} | 0 ... pre_reduce_run@tests::programs::f32.snap} | 0 ...tests::programs::heavy_pre_reduction.snap} | 0 ...ce_run@tests::programs::list_put_got.snap} | 0 ...duce_run@tests::programs::neg_fusion.snap} | 0 ...pre_reduce_run@tests::programs::nums.snap} | 0 ... pre_reduce_run@tests::programs::ops.snap} | 0 ...re_reduce_run@tests::programs::queue.snap} | 0 ...ts::programs::stress_tests::all_tree.snap} | 0 ...s::programs::stress_tests::apelacion.snap} | 0 ...@tests::programs::stress_tests::boom.snap} | 0 ...@tests::programs::stress_tests::burn.snap} | 0 ...sts::programs::stress_tests::fib_rec.snap} | 0 ...sts::programs::stress_tests::sum_rec.snap} | 0 ...ts::programs::stress_tests::sum_tail.snap} | 0 ...ts::programs::stress_tests::sum_tree.snap} | 0 ...::programs::stress_tests::tuple_rots.snap} | 0 ...duce_run@tests::programs::very_large.snap} | 0 ...hvm.snap => run@examples::arithmetic.snap} | 0 ...un@examples::church_encoding::church.snap} | 0 ... run@examples::lambda_calculus::hoas.snap} | 0 ...> run@examples::machine_u32::num_add.snap} | 0 ...run@examples::machine_u32::num_match.snap} | 0 ...les::sort::bitonic::bitonic_sort_lam.snap} | 0 ...un@examples::sort::merge::merge_sort.snap} | 0 ...xamples::sort::radix::radix_sort_ctr.snap} | 0 ...xamples::sort::radix::radix_sort_lam.snap} | 0 ... run@tests::programs::alloc_big_tree.snap} | 0 ...un@tests::programs::alloc_small_tree.snap} | 0 ...nap => run@tests::programs::bool_and.snap} | 0 ... => run@tests::programs::chained_ops.snap} | 0 ...p => run@tests::programs::church_exp.snap} | 0 ...p => run@tests::programs::church_mul.snap} | 0 ... => run@tests::programs::commutation.snap} | 0 ...nap => run@tests::programs::dec_bits.snap} | 0 ...> run@tests::programs::dec_bits_tree.snap} | 0 ...snap => run@tests::programs::era_era.snap} | 0 ...hvm.snap => run@tests::programs::f32.snap} | 0 ...tests::programs::heavy_pre_reduction.snap} | 0 ...=> run@tests::programs::list_put_got.snap} | 0 ...p => run@tests::programs::neg_fusion.snap} | 0 ...vm.snap => run@tests::programs::nums.snap} | 0 ...hvm.snap => run@tests::programs::ops.snap} | 0 ...m.snap => run@tests::programs::queue.snap} | 0 ...ts::programs::stress_tests::all_tree.snap} | 0 ...s::programs::stress_tests::apelacion.snap} | 0 ...@tests::programs::stress_tests::boom.snap} | 0 ...@tests::programs::stress_tests::burn.snap} | 0 ...sts::programs::stress_tests::fib_rec.snap} | 0 ...sts::programs::stress_tests::sum_rec.snap} | 0 ...ts::programs::stress_tests::sum_tail.snap} | 0 ...ts::programs::stress_tests::sum_tree.snap} | 0 ...::programs::stress_tests::tuple_rots.snap} | 0 ...p => run@tests::programs::very_large.snap} | 0 tests/tests.rs | 79 ++----- 76 files changed, 37 insertions(+), 261 deletions(-) rename tests/snapshots/{tests__pre_reduce_run@arithmetic.hvm.snap => pre_reduce_run@examples::arithmetic.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@church_encoding__church.hvm.snap => pre_reduce_run@examples::church_encoding::church.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@lambda_calculus__hoas.hvm.snap => pre_reduce_run@examples::lambda_calculus::hoas.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@machine_u32__num_add.hvm.snap => pre_reduce_run@examples::machine_u32::num_add.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@machine_u32__num_match.hvm.snap => pre_reduce_run@examples::machine_u32::num_match.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@sort__bitonic__bitonic_sort_lam.hvm.snap => pre_reduce_run@examples::sort::bitonic::bitonic_sort_lam.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@sort__merge__merge_sort.hvm.snap => pre_reduce_run@examples::sort::merge::merge_sort.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@sort__radix__radix_sort_ctr.hvm.snap => pre_reduce_run@examples::sort::radix::radix_sort_ctr.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@sort__radix__radix_sort_lam.hvm.snap => pre_reduce_run@examples::sort::radix::radix_sort_lam.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@alloc_big_tree.hvm.snap => pre_reduce_run@tests::programs::alloc_big_tree.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@alloc_small_tree.hvm.snap => pre_reduce_run@tests::programs::alloc_small_tree.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@bool_and.hvm.snap => pre_reduce_run@tests::programs::bool_and.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@chained_ops.hvm.snap => pre_reduce_run@tests::programs::chained_ops.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@church_exp.hvm.snap => pre_reduce_run@tests::programs::church_exp.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@church_mul.hvm.snap => pre_reduce_run@tests::programs::church_mul.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@commutation.hvm.snap => pre_reduce_run@tests::programs::commutation.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@dec_bits.hvm.snap => pre_reduce_run@tests::programs::dec_bits.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@dec_bits_tree.hvm.snap => pre_reduce_run@tests::programs::dec_bits_tree.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@era_era.hvm.snap => pre_reduce_run@tests::programs::era_era.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@f32.hvm.snap => pre_reduce_run@tests::programs::f32.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@heavy_pre_reduction.hvm.snap => pre_reduce_run@tests::programs::heavy_pre_reduction.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@list_put_got.hvm.snap => pre_reduce_run@tests::programs::list_put_got.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@neg_fusion.hvm.snap => pre_reduce_run@tests::programs::neg_fusion.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@nums.hvm.snap => pre_reduce_run@tests::programs::nums.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@ops.hvm.snap => pre_reduce_run@tests::programs::ops.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@queue.hvm.snap => pre_reduce_run@tests::programs::queue.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@stress_tests__all_tree.hvm.snap => pre_reduce_run@tests::programs::stress_tests::all_tree.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@stress_tests__apelacion.hvm.snap => pre_reduce_run@tests::programs::stress_tests::apelacion.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@stress_tests__boom.hvm.snap => pre_reduce_run@tests::programs::stress_tests::boom.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@stress_tests__burn.hvm.snap => pre_reduce_run@tests::programs::stress_tests::burn.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@stress_tests__fib_rec.hvm.snap => pre_reduce_run@tests::programs::stress_tests::fib_rec.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@stress_tests__sum_rec.hvm.snap => pre_reduce_run@tests::programs::stress_tests::sum_rec.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@stress_tests__sum_tail.hvm.snap => pre_reduce_run@tests::programs::stress_tests::sum_tail.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@stress_tests__sum_tree.hvm.snap => pre_reduce_run@tests::programs::stress_tests::sum_tree.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@stress_tests__tuple_rots.hvm.snap => pre_reduce_run@tests::programs::stress_tests::tuple_rots.snap} (100%) rename tests/snapshots/{tests__pre_reduce_run@very_large.hvm.snap => pre_reduce_run@tests::programs::very_large.snap} (100%) rename tests/snapshots/{tests__run@arithmetic.hvm.snap => run@examples::arithmetic.snap} (100%) rename tests/snapshots/{tests__run@church_encoding__church.hvm.snap => run@examples::church_encoding::church.snap} (100%) rename tests/snapshots/{tests__run@lambda_calculus__hoas.hvm.snap => run@examples::lambda_calculus::hoas.snap} (100%) rename tests/snapshots/{tests__run@machine_u32__num_add.hvm.snap => run@examples::machine_u32::num_add.snap} (100%) rename tests/snapshots/{tests__run@machine_u32__num_match.hvm.snap => run@examples::machine_u32::num_match.snap} (100%) rename tests/snapshots/{tests__run@sort__bitonic__bitonic_sort_lam.hvm.snap => run@examples::sort::bitonic::bitonic_sort_lam.snap} (100%) rename tests/snapshots/{tests__run@sort__merge__merge_sort.hvm.snap => run@examples::sort::merge::merge_sort.snap} (100%) rename tests/snapshots/{tests__run@sort__radix__radix_sort_ctr.hvm.snap => run@examples::sort::radix::radix_sort_ctr.snap} (100%) rename tests/snapshots/{tests__run@sort__radix__radix_sort_lam.hvm.snap => run@examples::sort::radix::radix_sort_lam.snap} (100%) rename tests/snapshots/{tests__run@alloc_big_tree.hvm.snap => run@tests::programs::alloc_big_tree.snap} (100%) rename tests/snapshots/{tests__run@alloc_small_tree.hvm.snap => run@tests::programs::alloc_small_tree.snap} (100%) rename tests/snapshots/{tests__run@bool_and.hvm.snap => run@tests::programs::bool_and.snap} (100%) rename tests/snapshots/{tests__run@chained_ops.hvm.snap => run@tests::programs::chained_ops.snap} (100%) rename tests/snapshots/{tests__run@church_exp.hvm.snap => run@tests::programs::church_exp.snap} (100%) rename tests/snapshots/{tests__run@church_mul.hvm.snap => run@tests::programs::church_mul.snap} (100%) rename tests/snapshots/{tests__run@commutation.hvm.snap => run@tests::programs::commutation.snap} (100%) rename tests/snapshots/{tests__run@dec_bits.hvm.snap => run@tests::programs::dec_bits.snap} (100%) rename tests/snapshots/{tests__run@dec_bits_tree.hvm.snap => run@tests::programs::dec_bits_tree.snap} (100%) rename tests/snapshots/{tests__run@era_era.hvm.snap => run@tests::programs::era_era.snap} (100%) rename tests/snapshots/{tests__run@f32.hvm.snap => run@tests::programs::f32.snap} (100%) rename tests/snapshots/{tests__run@heavy_pre_reduction.hvm.snap => run@tests::programs::heavy_pre_reduction.snap} (100%) rename tests/snapshots/{tests__run@list_put_got.hvm.snap => run@tests::programs::list_put_got.snap} (100%) rename tests/snapshots/{tests__run@neg_fusion.hvm.snap => run@tests::programs::neg_fusion.snap} (100%) rename tests/snapshots/{tests__run@nums.hvm.snap => run@tests::programs::nums.snap} (100%) rename tests/snapshots/{tests__run@ops.hvm.snap => run@tests::programs::ops.snap} (100%) rename tests/snapshots/{tests__run@queue.hvm.snap => run@tests::programs::queue.snap} (100%) rename tests/snapshots/{tests__run@stress_tests__all_tree.hvm.snap => run@tests::programs::stress_tests::all_tree.snap} (100%) rename tests/snapshots/{tests__run@stress_tests__apelacion.hvm.snap => run@tests::programs::stress_tests::apelacion.snap} (100%) rename tests/snapshots/{tests__run@stress_tests__boom.hvm.snap => run@tests::programs::stress_tests::boom.snap} (100%) rename tests/snapshots/{tests__run@stress_tests__burn.hvm.snap => run@tests::programs::stress_tests::burn.snap} (100%) rename tests/snapshots/{tests__run@stress_tests__fib_rec.hvm.snap => run@tests::programs::stress_tests::fib_rec.snap} (100%) rename tests/snapshots/{tests__run@stress_tests__sum_rec.hvm.snap => run@tests::programs::stress_tests::sum_rec.snap} (100%) rename tests/snapshots/{tests__run@stress_tests__sum_tail.hvm.snap => run@tests::programs::stress_tests::sum_tail.snap} (100%) rename tests/snapshots/{tests__run@stress_tests__sum_tree.hvm.snap => run@tests::programs::stress_tests::sum_tree.snap} (100%) rename tests/snapshots/{tests__run@stress_tests__tuple_rots.hvm.snap => run@tests::programs::stress_tests::tuple_rots.snap} (100%) rename tests/snapshots/{tests__run@very_large.hvm.snap => run@tests::programs::very_large.snap} (100%) diff --git a/Cargo.lock b/Cargo.lock index 0832122f..89865ccf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,12 +74,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - [[package]] name = "bstr" version = "1.9.1" @@ -161,87 +155,20 @@ dependencies = [ ] [[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "futures" -version = "0.3.30" +name = "dyntest" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "829631f0607b7cf07af83ed53c58c8d1e0682663c6c92f737d9cc22d056736df" dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", + "globset", + "walkdir", ] [[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" +name = "encode_unicode" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "globset" @@ -272,6 +199,7 @@ name = "hvm64" version = "0.3.0" dependencies = [ "clap", + "dyntest", "hvm64-ast", "hvm64-host", "hvm64-runtime", @@ -279,7 +207,6 @@ dependencies = [ "hvm64-util", "insta", "libloading", - "serial_test", ] [[package]] @@ -373,16 +300,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.21" @@ -404,12 +321,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "ordered-float" version = "4.2.0" @@ -419,41 +330,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "parking_lot" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "proc-macro2" version = "1.0.81" @@ -481,15 +357,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags", -] - [[package]] name = "regex-automata" version = "0.4.6" @@ -516,27 +383,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scc" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ad2bbb0ae5100a07b7a6f2ed7ab5fd0045551a4c507989b7a620046ea3efdc" -dependencies = [ - "sdd", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sdd" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84345e4c9bd703274a082fb80caaa99b7612be48dfaa1dd9266577ec412309d" - [[package]] name = "serde" version = "1.0.200" @@ -557,52 +403,12 @@ dependencies = [ "syn", ] -[[package]] -name = "serial_test" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b4b487fe2acf240a021cf57c6b2b4903b1e78ca0ecd862a71b71d2a51fed77d" -dependencies = [ - "futures", - "log", - "once_cell", - "parking_lot", - "scc", - "serial_test_derive", -] - -[[package]] -name = "serial_test_derive" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "similar" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - [[package]] name = "stacker" version = "0.1.15" diff --git a/Cargo.toml b/Cargo.toml index b787d5fb..d219ac41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ hvm64-host = { path = "./host" } [dev-dependencies] insta = { version = "1.34.0", features = ["glob"] } -serial_test = "3.0.0" +dyntest = "0.1.2" [features] default = ["std"] @@ -53,3 +53,7 @@ trace = ["hvm64-runtime/trace"] [patch.crates-io] highlight_error = { git = "https://github.com/tjjfvi/rust_highlight_error/", branch = "no_std" } + +[[test]] +name = "tests" +harness = false diff --git a/cspell.json b/cspell.json index cf312877..66d1030c 100644 --- a/cspell.json +++ b/cspell.json @@ -16,6 +16,7 @@ "dups", "dylib", "dylibs", + "dyntest", "effectful", "fmts", "fuzzer", diff --git a/tests/snapshots/tests__pre_reduce_run@arithmetic.hvm.snap b/tests/snapshots/pre_reduce_run@examples::arithmetic.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@arithmetic.hvm.snap rename to tests/snapshots/pre_reduce_run@examples::arithmetic.snap diff --git a/tests/snapshots/tests__pre_reduce_run@church_encoding__church.hvm.snap b/tests/snapshots/pre_reduce_run@examples::church_encoding::church.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@church_encoding__church.hvm.snap rename to tests/snapshots/pre_reduce_run@examples::church_encoding::church.snap diff --git a/tests/snapshots/tests__pre_reduce_run@lambda_calculus__hoas.hvm.snap b/tests/snapshots/pre_reduce_run@examples::lambda_calculus::hoas.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@lambda_calculus__hoas.hvm.snap rename to tests/snapshots/pre_reduce_run@examples::lambda_calculus::hoas.snap diff --git a/tests/snapshots/tests__pre_reduce_run@machine_u32__num_add.hvm.snap b/tests/snapshots/pre_reduce_run@examples::machine_u32::num_add.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@machine_u32__num_add.hvm.snap rename to tests/snapshots/pre_reduce_run@examples::machine_u32::num_add.snap diff --git a/tests/snapshots/tests__pre_reduce_run@machine_u32__num_match.hvm.snap b/tests/snapshots/pre_reduce_run@examples::machine_u32::num_match.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@machine_u32__num_match.hvm.snap rename to tests/snapshots/pre_reduce_run@examples::machine_u32::num_match.snap diff --git a/tests/snapshots/tests__pre_reduce_run@sort__bitonic__bitonic_sort_lam.hvm.snap b/tests/snapshots/pre_reduce_run@examples::sort::bitonic::bitonic_sort_lam.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@sort__bitonic__bitonic_sort_lam.hvm.snap rename to tests/snapshots/pre_reduce_run@examples::sort::bitonic::bitonic_sort_lam.snap diff --git a/tests/snapshots/tests__pre_reduce_run@sort__merge__merge_sort.hvm.snap b/tests/snapshots/pre_reduce_run@examples::sort::merge::merge_sort.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@sort__merge__merge_sort.hvm.snap rename to tests/snapshots/pre_reduce_run@examples::sort::merge::merge_sort.snap diff --git a/tests/snapshots/tests__pre_reduce_run@sort__radix__radix_sort_ctr.hvm.snap b/tests/snapshots/pre_reduce_run@examples::sort::radix::radix_sort_ctr.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@sort__radix__radix_sort_ctr.hvm.snap rename to tests/snapshots/pre_reduce_run@examples::sort::radix::radix_sort_ctr.snap diff --git a/tests/snapshots/tests__pre_reduce_run@sort__radix__radix_sort_lam.hvm.snap b/tests/snapshots/pre_reduce_run@examples::sort::radix::radix_sort_lam.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@sort__radix__radix_sort_lam.hvm.snap rename to tests/snapshots/pre_reduce_run@examples::sort::radix::radix_sort_lam.snap diff --git a/tests/snapshots/tests__pre_reduce_run@alloc_big_tree.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::alloc_big_tree.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@alloc_big_tree.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::alloc_big_tree.snap diff --git a/tests/snapshots/tests__pre_reduce_run@alloc_small_tree.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::alloc_small_tree.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@alloc_small_tree.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::alloc_small_tree.snap diff --git a/tests/snapshots/tests__pre_reduce_run@bool_and.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::bool_and.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@bool_and.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::bool_and.snap diff --git a/tests/snapshots/tests__pre_reduce_run@chained_ops.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::chained_ops.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@chained_ops.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::chained_ops.snap diff --git a/tests/snapshots/tests__pre_reduce_run@church_exp.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::church_exp.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@church_exp.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::church_exp.snap diff --git a/tests/snapshots/tests__pre_reduce_run@church_mul.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::church_mul.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@church_mul.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::church_mul.snap diff --git a/tests/snapshots/tests__pre_reduce_run@commutation.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::commutation.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@commutation.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::commutation.snap diff --git a/tests/snapshots/tests__pre_reduce_run@dec_bits.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::dec_bits.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@dec_bits.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::dec_bits.snap diff --git a/tests/snapshots/tests__pre_reduce_run@dec_bits_tree.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::dec_bits_tree.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@dec_bits_tree.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::dec_bits_tree.snap diff --git a/tests/snapshots/tests__pre_reduce_run@era_era.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::era_era.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@era_era.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::era_era.snap diff --git a/tests/snapshots/tests__pre_reduce_run@f32.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::f32.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@f32.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::f32.snap diff --git a/tests/snapshots/tests__pre_reduce_run@heavy_pre_reduction.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::heavy_pre_reduction.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@heavy_pre_reduction.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::heavy_pre_reduction.snap diff --git a/tests/snapshots/tests__pre_reduce_run@list_put_got.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::list_put_got.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@list_put_got.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::list_put_got.snap diff --git a/tests/snapshots/tests__pre_reduce_run@neg_fusion.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::neg_fusion.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@neg_fusion.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::neg_fusion.snap diff --git a/tests/snapshots/tests__pre_reduce_run@nums.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::nums.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@nums.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::nums.snap diff --git a/tests/snapshots/tests__pre_reduce_run@ops.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::ops.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@ops.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::ops.snap diff --git a/tests/snapshots/tests__pre_reduce_run@queue.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::queue.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@queue.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::queue.snap diff --git a/tests/snapshots/tests__pre_reduce_run@stress_tests__all_tree.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::stress_tests::all_tree.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@stress_tests__all_tree.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::stress_tests::all_tree.snap diff --git a/tests/snapshots/tests__pre_reduce_run@stress_tests__apelacion.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::stress_tests::apelacion.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@stress_tests__apelacion.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::stress_tests::apelacion.snap diff --git a/tests/snapshots/tests__pre_reduce_run@stress_tests__boom.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::stress_tests::boom.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@stress_tests__boom.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::stress_tests::boom.snap diff --git a/tests/snapshots/tests__pre_reduce_run@stress_tests__burn.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::stress_tests::burn.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@stress_tests__burn.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::stress_tests::burn.snap diff --git a/tests/snapshots/tests__pre_reduce_run@stress_tests__fib_rec.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::stress_tests::fib_rec.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@stress_tests__fib_rec.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::stress_tests::fib_rec.snap diff --git a/tests/snapshots/tests__pre_reduce_run@stress_tests__sum_rec.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::stress_tests::sum_rec.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@stress_tests__sum_rec.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::stress_tests::sum_rec.snap diff --git a/tests/snapshots/tests__pre_reduce_run@stress_tests__sum_tail.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::stress_tests::sum_tail.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@stress_tests__sum_tail.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::stress_tests::sum_tail.snap diff --git a/tests/snapshots/tests__pre_reduce_run@stress_tests__sum_tree.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::stress_tests::sum_tree.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@stress_tests__sum_tree.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::stress_tests::sum_tree.snap diff --git a/tests/snapshots/tests__pre_reduce_run@stress_tests__tuple_rots.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::stress_tests::tuple_rots.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@stress_tests__tuple_rots.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::stress_tests::tuple_rots.snap diff --git a/tests/snapshots/tests__pre_reduce_run@very_large.hvm.snap b/tests/snapshots/pre_reduce_run@tests::programs::very_large.snap similarity index 100% rename from tests/snapshots/tests__pre_reduce_run@very_large.hvm.snap rename to tests/snapshots/pre_reduce_run@tests::programs::very_large.snap diff --git a/tests/snapshots/tests__run@arithmetic.hvm.snap b/tests/snapshots/run@examples::arithmetic.snap similarity index 100% rename from tests/snapshots/tests__run@arithmetic.hvm.snap rename to tests/snapshots/run@examples::arithmetic.snap diff --git a/tests/snapshots/tests__run@church_encoding__church.hvm.snap b/tests/snapshots/run@examples::church_encoding::church.snap similarity index 100% rename from tests/snapshots/tests__run@church_encoding__church.hvm.snap rename to tests/snapshots/run@examples::church_encoding::church.snap diff --git a/tests/snapshots/tests__run@lambda_calculus__hoas.hvm.snap b/tests/snapshots/run@examples::lambda_calculus::hoas.snap similarity index 100% rename from tests/snapshots/tests__run@lambda_calculus__hoas.hvm.snap rename to tests/snapshots/run@examples::lambda_calculus::hoas.snap diff --git a/tests/snapshots/tests__run@machine_u32__num_add.hvm.snap b/tests/snapshots/run@examples::machine_u32::num_add.snap similarity index 100% rename from tests/snapshots/tests__run@machine_u32__num_add.hvm.snap rename to tests/snapshots/run@examples::machine_u32::num_add.snap diff --git a/tests/snapshots/tests__run@machine_u32__num_match.hvm.snap b/tests/snapshots/run@examples::machine_u32::num_match.snap similarity index 100% rename from tests/snapshots/tests__run@machine_u32__num_match.hvm.snap rename to tests/snapshots/run@examples::machine_u32::num_match.snap diff --git a/tests/snapshots/tests__run@sort__bitonic__bitonic_sort_lam.hvm.snap b/tests/snapshots/run@examples::sort::bitonic::bitonic_sort_lam.snap similarity index 100% rename from tests/snapshots/tests__run@sort__bitonic__bitonic_sort_lam.hvm.snap rename to tests/snapshots/run@examples::sort::bitonic::bitonic_sort_lam.snap diff --git a/tests/snapshots/tests__run@sort__merge__merge_sort.hvm.snap b/tests/snapshots/run@examples::sort::merge::merge_sort.snap similarity index 100% rename from tests/snapshots/tests__run@sort__merge__merge_sort.hvm.snap rename to tests/snapshots/run@examples::sort::merge::merge_sort.snap diff --git a/tests/snapshots/tests__run@sort__radix__radix_sort_ctr.hvm.snap b/tests/snapshots/run@examples::sort::radix::radix_sort_ctr.snap similarity index 100% rename from tests/snapshots/tests__run@sort__radix__radix_sort_ctr.hvm.snap rename to tests/snapshots/run@examples::sort::radix::radix_sort_ctr.snap diff --git a/tests/snapshots/tests__run@sort__radix__radix_sort_lam.hvm.snap b/tests/snapshots/run@examples::sort::radix::radix_sort_lam.snap similarity index 100% rename from tests/snapshots/tests__run@sort__radix__radix_sort_lam.hvm.snap rename to tests/snapshots/run@examples::sort::radix::radix_sort_lam.snap diff --git a/tests/snapshots/tests__run@alloc_big_tree.hvm.snap b/tests/snapshots/run@tests::programs::alloc_big_tree.snap similarity index 100% rename from tests/snapshots/tests__run@alloc_big_tree.hvm.snap rename to tests/snapshots/run@tests::programs::alloc_big_tree.snap diff --git a/tests/snapshots/tests__run@alloc_small_tree.hvm.snap b/tests/snapshots/run@tests::programs::alloc_small_tree.snap similarity index 100% rename from tests/snapshots/tests__run@alloc_small_tree.hvm.snap rename to tests/snapshots/run@tests::programs::alloc_small_tree.snap diff --git a/tests/snapshots/tests__run@bool_and.hvm.snap b/tests/snapshots/run@tests::programs::bool_and.snap similarity index 100% rename from tests/snapshots/tests__run@bool_and.hvm.snap rename to tests/snapshots/run@tests::programs::bool_and.snap diff --git a/tests/snapshots/tests__run@chained_ops.hvm.snap b/tests/snapshots/run@tests::programs::chained_ops.snap similarity index 100% rename from tests/snapshots/tests__run@chained_ops.hvm.snap rename to tests/snapshots/run@tests::programs::chained_ops.snap diff --git a/tests/snapshots/tests__run@church_exp.hvm.snap b/tests/snapshots/run@tests::programs::church_exp.snap similarity index 100% rename from tests/snapshots/tests__run@church_exp.hvm.snap rename to tests/snapshots/run@tests::programs::church_exp.snap diff --git a/tests/snapshots/tests__run@church_mul.hvm.snap b/tests/snapshots/run@tests::programs::church_mul.snap similarity index 100% rename from tests/snapshots/tests__run@church_mul.hvm.snap rename to tests/snapshots/run@tests::programs::church_mul.snap diff --git a/tests/snapshots/tests__run@commutation.hvm.snap b/tests/snapshots/run@tests::programs::commutation.snap similarity index 100% rename from tests/snapshots/tests__run@commutation.hvm.snap rename to tests/snapshots/run@tests::programs::commutation.snap diff --git a/tests/snapshots/tests__run@dec_bits.hvm.snap b/tests/snapshots/run@tests::programs::dec_bits.snap similarity index 100% rename from tests/snapshots/tests__run@dec_bits.hvm.snap rename to tests/snapshots/run@tests::programs::dec_bits.snap diff --git a/tests/snapshots/tests__run@dec_bits_tree.hvm.snap b/tests/snapshots/run@tests::programs::dec_bits_tree.snap similarity index 100% rename from tests/snapshots/tests__run@dec_bits_tree.hvm.snap rename to tests/snapshots/run@tests::programs::dec_bits_tree.snap diff --git a/tests/snapshots/tests__run@era_era.hvm.snap b/tests/snapshots/run@tests::programs::era_era.snap similarity index 100% rename from tests/snapshots/tests__run@era_era.hvm.snap rename to tests/snapshots/run@tests::programs::era_era.snap diff --git a/tests/snapshots/tests__run@f32.hvm.snap b/tests/snapshots/run@tests::programs::f32.snap similarity index 100% rename from tests/snapshots/tests__run@f32.hvm.snap rename to tests/snapshots/run@tests::programs::f32.snap diff --git a/tests/snapshots/tests__run@heavy_pre_reduction.hvm.snap b/tests/snapshots/run@tests::programs::heavy_pre_reduction.snap similarity index 100% rename from tests/snapshots/tests__run@heavy_pre_reduction.hvm.snap rename to tests/snapshots/run@tests::programs::heavy_pre_reduction.snap diff --git a/tests/snapshots/tests__run@list_put_got.hvm.snap b/tests/snapshots/run@tests::programs::list_put_got.snap similarity index 100% rename from tests/snapshots/tests__run@list_put_got.hvm.snap rename to tests/snapshots/run@tests::programs::list_put_got.snap diff --git a/tests/snapshots/tests__run@neg_fusion.hvm.snap b/tests/snapshots/run@tests::programs::neg_fusion.snap similarity index 100% rename from tests/snapshots/tests__run@neg_fusion.hvm.snap rename to tests/snapshots/run@tests::programs::neg_fusion.snap diff --git a/tests/snapshots/tests__run@nums.hvm.snap b/tests/snapshots/run@tests::programs::nums.snap similarity index 100% rename from tests/snapshots/tests__run@nums.hvm.snap rename to tests/snapshots/run@tests::programs::nums.snap diff --git a/tests/snapshots/tests__run@ops.hvm.snap b/tests/snapshots/run@tests::programs::ops.snap similarity index 100% rename from tests/snapshots/tests__run@ops.hvm.snap rename to tests/snapshots/run@tests::programs::ops.snap diff --git a/tests/snapshots/tests__run@queue.hvm.snap b/tests/snapshots/run@tests::programs::queue.snap similarity index 100% rename from tests/snapshots/tests__run@queue.hvm.snap rename to tests/snapshots/run@tests::programs::queue.snap diff --git a/tests/snapshots/tests__run@stress_tests__all_tree.hvm.snap b/tests/snapshots/run@tests::programs::stress_tests::all_tree.snap similarity index 100% rename from tests/snapshots/tests__run@stress_tests__all_tree.hvm.snap rename to tests/snapshots/run@tests::programs::stress_tests::all_tree.snap diff --git a/tests/snapshots/tests__run@stress_tests__apelacion.hvm.snap b/tests/snapshots/run@tests::programs::stress_tests::apelacion.snap similarity index 100% rename from tests/snapshots/tests__run@stress_tests__apelacion.hvm.snap rename to tests/snapshots/run@tests::programs::stress_tests::apelacion.snap diff --git a/tests/snapshots/tests__run@stress_tests__boom.hvm.snap b/tests/snapshots/run@tests::programs::stress_tests::boom.snap similarity index 100% rename from tests/snapshots/tests__run@stress_tests__boom.hvm.snap rename to tests/snapshots/run@tests::programs::stress_tests::boom.snap diff --git a/tests/snapshots/tests__run@stress_tests__burn.hvm.snap b/tests/snapshots/run@tests::programs::stress_tests::burn.snap similarity index 100% rename from tests/snapshots/tests__run@stress_tests__burn.hvm.snap rename to tests/snapshots/run@tests::programs::stress_tests::burn.snap diff --git a/tests/snapshots/tests__run@stress_tests__fib_rec.hvm.snap b/tests/snapshots/run@tests::programs::stress_tests::fib_rec.snap similarity index 100% rename from tests/snapshots/tests__run@stress_tests__fib_rec.hvm.snap rename to tests/snapshots/run@tests::programs::stress_tests::fib_rec.snap diff --git a/tests/snapshots/tests__run@stress_tests__sum_rec.hvm.snap b/tests/snapshots/run@tests::programs::stress_tests::sum_rec.snap similarity index 100% rename from tests/snapshots/tests__run@stress_tests__sum_rec.hvm.snap rename to tests/snapshots/run@tests::programs::stress_tests::sum_rec.snap diff --git a/tests/snapshots/tests__run@stress_tests__sum_tail.hvm.snap b/tests/snapshots/run@tests::programs::stress_tests::sum_tail.snap similarity index 100% rename from tests/snapshots/tests__run@stress_tests__sum_tail.hvm.snap rename to tests/snapshots/run@tests::programs::stress_tests::sum_tail.snap diff --git a/tests/snapshots/tests__run@stress_tests__sum_tree.hvm.snap b/tests/snapshots/run@tests::programs::stress_tests::sum_tree.snap similarity index 100% rename from tests/snapshots/tests__run@stress_tests__sum_tree.hvm.snap rename to tests/snapshots/run@tests::programs::stress_tests::sum_tree.snap diff --git a/tests/snapshots/tests__run@stress_tests__tuple_rots.hvm.snap b/tests/snapshots/run@tests::programs::stress_tests::tuple_rots.snap similarity index 100% rename from tests/snapshots/tests__run@stress_tests__tuple_rots.hvm.snap rename to tests/snapshots/run@tests::programs::stress_tests::tuple_rots.snap diff --git a/tests/snapshots/tests__run@very_large.hvm.snap b/tests/snapshots/run@tests::programs::very_large.snap similarity index 100% rename from tests/snapshots/tests__run@very_large.hvm.snap rename to tests/snapshots/run@tests::programs::very_large.snap diff --git a/tests/tests.rs b/tests/tests.rs index 3312f9e4..5f024f3f 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1,13 +1,6 @@ -#![cfg(feature = "std")] - +use dyntest::{dyntest, DynTester}; use hvm64_transform::pre_reduce::PreReduce; -use std::{ - fs, - io::{self, Write}, - path::{Path, PathBuf}, - str::FromStr, - time::Instant, -}; +use std::{fs, path::Path, str::FromStr}; use hvm64_ast::{self as ast, Book, Net}; use hvm64_host::Host; @@ -15,41 +8,40 @@ use hvm64_runtime as run; use insta::assert_snapshot; -use serial_test::serial; +dyntest!(test); + +fn test(t: &mut DynTester) { + for (name, path) in t.glob("{examples,tests/programs}/**/*.hvm") { + t.test(name.clone(), move || { + let mut settings = insta::Settings::new(); + settings.set_prepend_module_to_snapshot(false); + settings.set_input_file(&path); + settings.set_snapshot_suffix(name); + settings.bind(|| { + test_path(&path); + }) + }); + } +} fn execute_host(host: &Host) -> Option<(run::Rewrites, Net)> { let heap = run::Heap::new(None).unwrap(); let mut net = run::Net::new(&heap); - let Some(entrypoint) = host.defs.get("main") else { - println!(" skipping"); - return None; - }; + let entrypoint = host.defs.get("main").unwrap(); net.boot(entrypoint); - let start = Instant::now(); net.parallel_normal(); - println!(" {:.3?}", start.elapsed()); Some((net.rwts, host.readback(&net))) } -fn test_run(name: &str, host: &Host) { - print!("{name}..."); - io::stdout().flush().unwrap(); - +fn test_run(host: &Host) { let Some((rwts, net)) = execute_host(host) else { return }; let output = format!("{}\n{}", net, &rwts); assert_snapshot!(output); } -fn test_pre_reduce_run(path: &str, mut book: Book) { - print!("{path}..."); - print!(" pre-reduce"); - io::stdout().flush().unwrap(); - - let start = Instant::now(); +fn test_pre_reduce_run(mut book: Book) { let pre_stats = book.pre_reduce(&|x| x == "main", None, u64::MAX); - print!(" {:.3?}...", start.elapsed()); - io::stdout().flush().unwrap(); let host = Host::new(&book); let Some((rwts, net)) = execute_host(&host) else { @@ -66,33 +58,6 @@ fn test_path(path: &Path) { let book = ast::Book::from_str(&code).unwrap(); let host = Host::new(&book); - let path = path.strip_prefix(env!("CARGO_MANIFEST_DIR")).unwrap(); - let path = path.to_str().unwrap(); - - test_pre_reduce_run(path, book.clone()); - test_run(path, &host); -} - -fn test_dir(dir: &Path, filter: impl Fn(&Path) -> bool) { - insta::glob!(dir, "**/*.hvm", |p| { - if filter(p) { - test_path(p); - } - }) -} - -fn manifest_relative(sub: &str) -> PathBuf { - format!("{}/{}", env!("CARGO_MANIFEST_DIR"), sub).into() -} - -#[test] -#[serial] -fn test_programs() { - test_dir(&manifest_relative("tests/programs/"), |_| true) -} - -#[test] -#[serial] -fn test_examples() { - test_dir(&manifest_relative("examples/"), |_| true); + test_pre_reduce_run(book.clone()); + test_run(&host); }