ebarnard / rust-plist

A rusty plist parser.
MIT License
71 stars 42 forks source link

`cargo test` fails to compile? #100

Closed cmyr closed 1 year ago

cmyr commented 1 year ago

I spent ten minutes trying to figure out what's going on with this, and I'm really not sure? I get a bunch of errors in the serde_tests file. At first I assumed this was due to some old build artefacts or something on my side, but I cleaned thoroughly and I still see it. Does cargo test work for you?

(I also notice that in the github actions cargo test is always called with various arguments that are slightly confusing to me (why are we specifying an explicit target?) and so maybe you don't use cargo test on its own? But I would still like to understand why it's broken...)

I'm on macOS 12.6.3, aarch64.

ebarnard commented 1 year ago

I'm also on macOS 12.6.3 aarch64. A plan cargo test works for me.

The explicit target is just because I copied the CI yaml from another project that had to test on i686 as well as x86_64.

⋊> ~/D/P/rust-plist on master ⨯ cargo -V
cargo 1.67.1 (8ecd4f20a 2023-01-10)
⋊> ~/D/P/rust-plist on master ⨯ rustc -V
rustc 1.67.1 (d5a82bbd2 2023-02-07)
⋊> ~/D/P/rust-plist on master ⨯ cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.03s
     Running unittests src/lib.rs (target/debug/deps/plist-ca6f475e1635e90f)

running 41 tests
test date::testing::far_past_date ... ok
test date::testing::date_roundtrip ... ok
test integer::tests::from_str_limits ... ok
test serde_tests::cow ... ok
test dictionary::tests::from_hash_map_to_dict ... ok
test serde_tests::deserialise_old_enum_unit_variant_encoding ... ok
test serde_tests::cat_without_firmware ... ok
test serde_tests::cat_with_firmware ... ok
test serde_tests::dictionary_deserialize_dictionary_in_struct ... ok
test serde_tests::enum_variant_types ... ok
test serde_tests::empty_array_and_dictionary_serialize_to_xml ... ok
test serde_tests::dictionary_serialize_xml ... ok
test serde_tests::frog ... ok
test serde_tests::newtype_struct ... ok
test serde_tests::deserialize_dictionary_xml ... ok
test serde_tests::deserialize_dictionary_binary ... ok
test serde_tests::dog ... ok
test serde_tests::option_array ... ok
test serde_tests::option_dictionary_keys ... ok
test serde_tests::option_none ... ok
test serde_tests::deserialize_dictionary_binary_nskeyedarchiver ... ok
test serde_tests::option_some ... ok
test serde_tests::option_dictionary_values ... ok
test serde_tests::option_some_none ... ok
test serde_tests::option_some_some ... ok
test serde_tests::serde_yaml_to_value ... ok
test serde_tests::type_with_options ... ok
test serde_tests::type_with_date ... ok
test stream::xml_writer::tests::custom_indent_string ... ok
test stream::xml_writer::tests::no_root ... ok
test stream::binary_reader::tests::streaming_parser ... ok
test stream::xml_reader::tests::streaming_parser ... ok
test stream::xml_reader::tests::bad_data ... ok
test stream::binary_reader::tests::nskeyedarchiver_plist ... ok
test value::tests::builder ... ok
test stream::xml_writer::tests::streaming_parser ... ok
test value::tests::value_accessors ... ok
test stream::binary_writer::tests::bplist_roundtrip ... ok
test stream::binary_writer::tests::nskeyedarchiver_roundtrip ... ok
test stream::binary_reader::tests::utf16_plist ... ok
test stream::binary_writer::tests::utf16_roundtrip ... ok

test result: ok. 41 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/fuzzer.rs (target/debug/deps/fuzzer-68212f29b834414f)

running 11 tests
test binary_circular_array ... ok
test empty_offset_table ... ok
test binary_circular_reference ... ok
test binary_zero_offset_size ... ok
test binary_nan_date ... ok
test issue_22_binary_with_byte_ref_size ... ok
test overflow_instant_add ... ok
test issue_20_binary_with_data_in_trailer ... ok
test too_large_allocation ... ok
test overflow_instant_sub ... ok
test too_large_allocation_2 ... ok

test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests plist

running 8 tests
test src/stream/mod.rs - stream::Event (line 33) ... ignored
test src/value.rs - value::Value::to_writer_xml_with_options (line 84) - compile ... ok
test src/lib.rs - (line 16) ... ok
test src/dictionary.rs - dictionary::Dictionary (line 166) ... ok
test src/dictionary.rs - dictionary::Dictionary (line 190) ... ok
test src/data.rs - data::Data (line 9) ... ok
test src/lib.rs - (line 53) ... ok
test src/lib.rs - (line 24) ... ok

test result: ok. 7 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.40s
cmyr commented 1 year ago

Okay this is working for me now, after nuking target directory. Sorry for the noise...