systemd / zram-generator

Systemd unit generator for zram devices
MIT License
575 stars 48 forks source link

Only print diff(1) output if not empty #120

Closed nabijaczleweli closed 2 years ago

nabijaczleweli commented 2 years ago

(and spell &devices[0] &devices[0])

The test output with a removed 07a directory is such now, which is a far cry from actually saying test test_07a_mount_point_excl ... skipped, but is actually noted at least:

nabijaczleweli@tarta:~/code/systemd-zram-generator$ SYSTEMD_UTIL_DIR=$(pkg-config --variable=systemdutildir systemd) cargo test --release
   Compiling zram-generator v1.0.1 (/home/nabijaczleweli/code/systemd-zram-generator)
    Finished release [optimized] target(s) in 1.75s
     Running unittests (target/release/deps/zram_generator-d1b62b1787f2545a)

running 7 tests
test config::tests::test_get_total_memory_kb ... ok
test generator::tests::test_mount_unit_name ... ok
test config::tests::test_kernel_has_no_option ... ok
test config::tests::test_verify_mount_point ... ok
test config::tests::test_get_total_memory_not_found - should panic ... ok
test config::tests::test_kernel_has_option ... ok
test generator::tests::test_parse_known_compressors ... ok

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

     Running unittests (target/release/deps/zram_generator-09da8f38cdd949bc)

running 7 tests
test config::tests::test_get_total_memory_kb ... ok
test config::tests::test_kernel_has_no_option ... ok
test config::tests::test_kernel_has_option ... ok
test config::tests::test_verify_mount_point ... ok
test config::tests::test_get_total_memory_not_found - should panic ... ok
test generator::tests::test_mount_unit_name ... ok
test generator::tests::test_parse_known_compressors ... ok

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

     Running tests/test_cases.rs (target/release/deps/test_cases-3a9c1650f8088c2c)

running 9 tests
07a-mount-point-excl doesn't exist: assuming package, skipping
test test_07a_mount_point_excl ... ok
test test_05_kernel_disabled ... ok
test test_03_too_much_memory ... ok
test test_08_plain_device ... ok
test test_01_basic ... ok
test test_06_kernel_enabled ... ok
test test_07_mount_point ... ok
test test_02_zstd ... ok
test test_04_dropins ... ok

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

   Doc-tests zram-generator

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
keszybz commented 2 years ago

rustfmt complains again? Should we drop that from CI?

nabijaczleweli commented 2 years ago

Fixed. And, uh, probably not at this point. I just don't have this version of rustfmt installed (can't because I use a different specific one for my other repos) so I use CI to get the diffs (which are, admittedly, insane by default, but then it's too late to change them, so).