mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
Merge pull request #243 from eupn/svd2utra-generate-smaller-tests
svd2utra: generate smaller compile tests for each peripheral
This commit is contained in:
commit
f4eb0ac5b7
1 changed files with 11 additions and 5 deletions
|
|
@ -900,16 +900,20 @@ fn print_tests<U: Write>(peripherals: &[Peripheral], out: &mut U) -> std::io::Re
|
||||||
let test_header = r####"
|
let test_header = r####"
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
#[test]
|
|
||||||
#[ignore]
|
|
||||||
fn compile_check() {
|
|
||||||
use super::*;
|
|
||||||
"####
|
"####
|
||||||
.as_bytes();
|
.as_bytes();
|
||||||
out.write_all(test_header)?;
|
out.write_all(test_header)?;
|
||||||
|
|
||||||
for peripheral in peripherals {
|
for peripheral in peripherals {
|
||||||
let mod_name = peripheral.name.to_lowercase();
|
let mod_name = peripheral.name.to_lowercase();
|
||||||
let per_name = peripheral.name.to_lowercase() + "_csr";
|
let per_name = peripheral.name.to_lowercase() + "_csr";
|
||||||
|
|
||||||
|
write!(out, r####"
|
||||||
|
#[test]
|
||||||
|
#[ignore]
|
||||||
|
fn compile_check_{}() {{
|
||||||
|
use super::*;"####, per_name)?;
|
||||||
|
|
||||||
writeln!(
|
writeln!(
|
||||||
out,
|
out,
|
||||||
" let mut {} = CSR::new(HW_{}_BASE as *mut u32);",
|
" let mut {} = CSR::new(HW_{}_BASE as *mut u32);",
|
||||||
|
|
@ -958,9 +962,11 @@ mod tests {
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
writeln!(out, " }}")?;
|
||||||
}
|
}
|
||||||
writeln!(out, " }}")?;
|
|
||||||
writeln!(out, "}}")?;
|
writeln!(out, "}}")?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue