From 4cb286cffdc326b93256b0b6ad5ea37a411b90df Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 24 May 2024 16:02:50 -0300 Subject: [PATCH] Changes for shuttle test --- Cargo.lock | 192 ++++++++++++++++++----------------------------- Cargo.toml | 3 +- src/assembler.rs | 2 +- src/elf.rs | 2 +- src/vm.rs | 2 +- 5 files changed, 80 insertions(+), 121 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1c5880274..c4c248a3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,12 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" +[[package]] +name = "assoc" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdc70193dadb9d7287fa4b633f15f90c876915b31f6af17da307fc59c9859a8" + [[package]] name = "autocfg" version = "1.1.0" @@ -29,6 +35,18 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "byteorder" version = "0.5.3" @@ -92,6 +110,12 @@ dependencies = [ "byteorder 0.5.3", ] +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "gdbstub" version = "0.6.3" @@ -152,16 +176,16 @@ dependencies = [ ] [[package]] -name = "json" -version = "0.12.4" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "lazy_static" -version = "1.4.0" +name = "json" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" [[package]] name = "libc" @@ -175,48 +199,18 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" -[[package]] -name = "loom" -version = "0.7.2" -dependencies = [ - "cfg-if", - "generator", - "scoped-tls", - "tracing", - "tracing-subscriber", -] - [[package]] name = "managed" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d" -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata", -] - [[package]] name = "memchr" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - [[package]] name = "num-traits" version = "0.2.15" @@ -233,10 +227,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "overload" -version = "0.1.1" +name = "owo-colors" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "paste" @@ -280,6 +274,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "rand" version = "0.8.5" @@ -303,43 +303,22 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] [[package]] -name = "regex" -version = "1.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" -dependencies = [ - "regex-syntax 0.7.5", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" +name = "rand_pcg" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" dependencies = [ - "regex-syntax 0.6.29", + "rand_core", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - [[package]] name = "rustc-demangle" version = "0.1.21" @@ -379,12 +358,22 @@ dependencies = [ ] [[package]] -name = "sharded-slab" -version = "0.1.7" +name = "shuttle" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +checksum = "fa904d5f504c34f1aa43218ee180173970a360124f44bdbaeda4e3d8d53e24c3" dependencies = [ - "lazy_static", + "assoc", + "bitvec", + "generator", + "hex", + "owo-colors", + "rand", + "rand_core", + "rand_pcg", + "scoped-tls", + "smallvec", + "tracing", ] [[package]] @@ -407,10 +396,10 @@ dependencies = [ "json", "libc", "log", - "loom", "rand", "rustc-demangle", "scroll", + "shuttle", "test_utils", "thiserror", "winapi", @@ -427,6 +416,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "test_utils" version = "0.8.1" @@ -455,16 +450,6 @@ dependencies = [ "syn", ] -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - [[package]] name = "tracing" version = "0.1.40" @@ -482,36 +467,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", ] [[package]] @@ -529,12 +484,6 @@ dependencies = [ "void", ] -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - [[package]] name = "void" version = "1.0.2" @@ -661,3 +610,12 @@ name = "windows_x86_64_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] diff --git a/Cargo.toml b/Cargo.toml index 14e355053..25a15cf0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,8 @@ gdbstub = { version = "0.6.2", optional = true } goblin = "0.5.1" hash32 = "0.2.0" log = "0.4.2" -loom = {path = "/Users/lucasste/Documents/loom"} +# loom = {path = "/Users/lucasste/Documents/loom"} +shuttle = "0.7.0" rand = { version = "0.8.5", features = ["small_rng"]} rustc-demangle = "0.1" scroll = "0.11" diff --git a/src/assembler.rs b/src/assembler.rs index d2e310d83..d8f0bb064 100644 --- a/src/assembler.rs +++ b/src/assembler.rs @@ -28,7 +28,7 @@ use std::{collections::HashMap}; use std::sync::Arc; #[cfg(feature = "loom-test")] -use loom::sync::Arc; +use shuttle::sync::Arc; #[derive(Clone, Copy, Debug, PartialEq)] diff --git a/src/elf.rs b/src/elf.rs index 1849b5388..132db8126 100644 --- a/src/elf.rs +++ b/src/elf.rs @@ -36,7 +36,7 @@ use std::{collections::BTreeMap, fmt::Debug, mem, ops::Range, str}; use std::sync::Arc; #[cfg(feature = "loom-test")] -use loom::sync::Arc; +use shuttle::sync::Arc; /// Error definitions #[derive(Debug, thiserror::Error, PartialEq, Eq)] diff --git a/src/vm.rs b/src/vm.rs index 3ae02fbd1..a333912b1 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -28,7 +28,7 @@ use std::{collections::BTreeMap, fmt::Debug}; use std::sync::Arc; #[cfg(feature = "loom-test")] -use loom::sync::Arc; +use shuttle::sync::Arc; /// Shift the RUNTIME_ENVIRONMENT_KEY by this many bits to the LSB ///