Merge pull request #5825 from tertsdiepraam/codecov-uucore-features

CI: test `uucore` with `coreutils` in codecov to run it with the proper features
This commit is contained in:
Sylvestre Ledru 2024-01-17 11:51:02 +01:00 committed by GitHub
commit b7a14ac119
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 15 deletions

View file

@ -1012,16 +1012,8 @@ jobs:
UTILITY_LIST="$(./util/show-utils.sh ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }})"
CARGO_UTILITY_LIST_OPTIONS="$(for u in ${UTILITY_LIST}; do echo -n "-puu_${u} "; done;)"
outputs CARGO_UTILITY_LIST_OPTIONS
- name: Test uucore
run: cargo nextest run --profile ci --hide-progress-bar -p uucore
env:
RUSTC_WRAPPER: ""
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
RUSTDOCFLAGS: "-Cpanic=abort"
RUST_BACKTRACE: "1"
# RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }}
- name: Test
run: cargo nextest run --profile ci --hide-progress-bar ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }}
run: cargo nextest run --profile ci --hide-progress-bar ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -p uucore -p coreutils
env:
RUSTC_WRAPPER: ""
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"

View file

@ -484,22 +484,23 @@ mod tests {
fn test_crlf_across_blocks() {
use std::io::Write;
use crate::digest::Digest;
use crate::digest::DigestWriter;
use super::Digest;
use super::DigestWriter;
use super::Md5;
// Writing "\r" in one call to `write()`, and then "\n" in another.
let mut digest = Box::new(md5::Md5::new()) as Box<dyn Digest>;
let mut digest = Box::new(Md5::new()) as Box<dyn Digest>;
let mut writer_crlf = DigestWriter::new(&mut digest, false);
writer_crlf.write_all(&[b'\r']).unwrap();
writer_crlf.write_all(&[b'\n']).unwrap();
writer_crlf.hash_finalize();
writer_crlf.finalize();
let result_crlf = digest.result_str();
// We expect "\r\n" to be replaced with "\n" in text mode on Windows.
let mut digest = Box::new(md5::Md5::new()) as Box<dyn Digest>;
let mut digest = Box::new(Md5::new()) as Box<dyn Digest>;
let mut writer_lf = DigestWriter::new(&mut digest, false);
writer_lf.write_all(&[b'\n']).unwrap();
writer_lf.hash_finalize();
writer_lf.finalize();
let result_lf = digest.result_str();
assert_eq!(result_crlf, result_lf);