pub(super) fn assemble_binary_riscv(testprogram: &TestProgram) -> Result<(), BuildError> {
    let working_dir = testprogram.path.to_owned().join("riscv/");

    let assemble = Command::new("riscv-none-embed-as")
        .args(["main.S", "-o", "main.o"])
        .current_dir(working_dir.clone())
        .output()
        .expect("Failed to run the RISCV assembly process, is the riscv-none-embed-as command accessible to the application?");

    if !assemble.status.success() {
        let cause;

        if !assemble.stderr.is_empty() {
            cause = String::from_utf8(assemble.stderr)
                .expect("Failed to parse stderr from RISCV assembler to string");
        } else {
            cause = String::from_utf8(assemble.stdout)
                .expect("Failed to parse stdout from RISCV assembler to string");
        }

        return Err(BuildError::AssemblyError(cause));
    }

    Ok(())
}
/// Try to assemble the provided testprogram for RISCV cores
Try to assemble the provided testprogram for RISCV cores
Try to assemble the provided testprogram for RISCV cores
pub(super) fn assemble_binary_riscv(testprogram: &TestProgram) -> Result<(), BuildError> {
    let working_dir = testprogram.path.to_owned().join("riscv/");
    let assemble = Command::new("riscv-none-embed-as")
        .args(["main.S", "-o", "main.o"])
        .current_dir(working_dir.clone())
        .output()
        .expect("Failed to run the RISCV assembly process, is the riscv-none-embed-as command accessible to the application?");
    if !assemble.status.success() {
        let cause;
        if !assemble.stderr.is_empty() {
            cause = String::from_utf8(assemble.stderr)
                .expect("Failed to parse stderr from RISCV assembler to string");
        } else {
            cause = String::from_utf8(assemble.stdout)
                .expect("Failed to parse stdout from RISCV assembler to string");
        }
        return Err(BuildError::AssemblyError(cause));
    }
    Ok(())
}
pub ( super ) fn assemble_binary_riscv ( testprogram : & TestProgram ) -> Result < ( ) , BuildError > { let working_dir = testprogram . path . to_owned ( ) . join ( " " ) ; let assemble = Command :: new ( " " ) . args ( [ " " , " " , " " ] ) . current_dir ( working_dir . clone ( ) ) . output ( ) . expect ( " " ) ; if ! assemble . status . success ( ) { let cause ; if ! assemble . stderr . is_empty ( ) { cause = String :: from_utf8 ( assemble . stderr ) . expect ( " " ) ; } else { cause = String :: from_utf8 ( assemble . stdout ) . expect ( " " ) ; } return Err ( BuildError :: AssemblyError ( cause ) ) ; } Ok ( ( ) ) }
Try to assemble the provided testprogram for RISCV cores
Try to assemble the provided testprogram for RISCV cores
testprogram
&TestProgram