mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
make the CI options command line driven
This commit is contained in:
parent
350276c08a
commit
630dd6a784
2 changed files with 23 additions and 10 deletions
|
|
@ -23,6 +23,7 @@ def main():
|
||||||
|
|
||||||
pass_log = {}
|
pass_log = {}
|
||||||
err_log = []
|
err_log = []
|
||||||
|
timeout = 240 # a bit longer to allow for a compilation to happen
|
||||||
for seed in range(0, 501):
|
for seed in range(0, 501):
|
||||||
err_log.append("Starting seed {}".format(seed))
|
err_log.append("Starting seed {}".format(seed))
|
||||||
seed_env = os.environ
|
seed_env = os.environ
|
||||||
|
|
@ -35,7 +36,7 @@ def main():
|
||||||
|
|
||||||
passing = 'PASS'
|
passing = 'PASS'
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
['cargo', 'xtask', 'run'],
|
['cargo', 'xtask', 'pddb-ci'],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
#shell=True,
|
#shell=True,
|
||||||
|
|
@ -47,7 +48,7 @@ def main():
|
||||||
realtime_output = proc.stdout.readline()
|
realtime_output = proc.stdout.readline()
|
||||||
if (realtime_output == '' and proc.poll() is not None) or (time.time() - start_time > 20):
|
if (realtime_output == '' and proc.poll() is not None) or (time.time() - start_time > 20):
|
||||||
proc.kill()
|
proc.kill()
|
||||||
if time.time() - start_time > 20:
|
if time.time() - start_time > timeout:
|
||||||
logging.debug("timeout on generation")
|
logging.debug("timeout on generation")
|
||||||
passing = 'FAIL TIMEOUT'
|
passing = 'FAIL TIMEOUT'
|
||||||
break
|
break
|
||||||
|
|
@ -81,6 +82,8 @@ def main():
|
||||||
passing = 'FAIL AUTH'
|
passing = 'FAIL AUTH'
|
||||||
proc.kill()
|
proc.kill()
|
||||||
|
|
||||||
|
timeout = 20 # reset the timeout after the first run to something shorter, now that any potential compilation step is done
|
||||||
|
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
['python', './tools/pddbdbg.py', '--name', args.name],
|
['python', './tools/pddbdbg.py', '--name', args.name],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
}
|
}
|
||||||
Some("renode-aes-test") => renode_image(false, &aestest_pkgs, &[])?,
|
Some("renode-aes-test") => renode_image(false, &aestest_pkgs, &[])?,
|
||||||
Some("renode-image-debug") => renode_image(true, &hw_pkgs, &[])?,
|
Some("renode-image-debug") => renode_image(true, &hw_pkgs, &[])?,
|
||||||
Some("run") => run(false, &hw_pkgs)?,
|
Some("run") => run(false, &hw_pkgs, None)?,
|
||||||
|
Some("pddb-ci") => run(false, &hw_pkgs, Some(
|
||||||
|
&["--features", "pddb/ci", "--features", "pddb/deterministic"]
|
||||||
|
))?,
|
||||||
Some("hw-image") => {
|
Some("hw-image") => {
|
||||||
build_hw_image(false, env::args().nth(2), &hw_pkgs, lkey, kkey, None, &[])?
|
build_hw_image(false, env::args().nth(2), &hw_pkgs, lkey, kkey, None, &[])?
|
||||||
}
|
}
|
||||||
|
|
@ -172,7 +175,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
None,
|
None,
|
||||||
&[],
|
&[],
|
||||||
)?,
|
)?,
|
||||||
Some("pddb-hosted") => run(false, &pddb_dev_pkgs)?,
|
Some("pddb-hosted") => run(false, &pddb_dev_pkgs, None)?,
|
||||||
Some("benchmark") => build_hw_image(
|
Some("benchmark") => build_hw_image(
|
||||||
false,
|
false,
|
||||||
env::args().nth(2),
|
env::args().nth(2),
|
||||||
|
|
@ -230,7 +233,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
Some("sr-test") => {
|
Some("sr-test") => {
|
||||||
build_hw_image(false, env::args().nth(2), &sr_pkgs, lkey, kkey, None, &[])?
|
build_hw_image(false, env::args().nth(2), &sr_pkgs, lkey, kkey, None, &[])?
|
||||||
}
|
}
|
||||||
Some("debug") => run(true, &hw_pkgs)?,
|
Some("debug") => run(true, &hw_pkgs, None)?,
|
||||||
Some("burn-kernel") => update_usb(true, false, false, false)?,
|
Some("burn-kernel") => update_usb(true, false, false, false)?,
|
||||||
Some("burn-loader") => update_usb(false, true, false, false)?,
|
Some("burn-loader") => update_usb(false, true, false, false)?,
|
||||||
Some("nuke-soc") => update_usb(false, false, true, false)?,
|
Some("nuke-soc") => update_usb(false, false, true, false)?,
|
||||||
|
|
@ -380,7 +383,7 @@ fn build_hw_image(
|
||||||
|
|
||||||
let kernel = build_kernel(debug)?;
|
let kernel = build_kernel(debug)?;
|
||||||
let mut init = vec![];
|
let mut init = vec![];
|
||||||
let base_path = build(packages, debug, Some(PROGRAM_TARGET), None, extra_args)?;
|
let base_path = build(packages, debug, Some(PROGRAM_TARGET), None, extra_args, None)?;
|
||||||
for pkg in packages {
|
for pkg in packages {
|
||||||
let mut pkg_path = base_path.clone();
|
let mut pkg_path = base_path.clone();
|
||||||
pkg_path.push(pkg);
|
pkg_path.push(pkg);
|
||||||
|
|
@ -396,7 +399,7 @@ fn build_hw_image(
|
||||||
debug,
|
debug,
|
||||||
Some(KERNEL_TARGET),
|
Some(KERNEL_TARGET),
|
||||||
Some("loader".into()),
|
Some("loader".into()),
|
||||||
None,
|
None, None,
|
||||||
)?;
|
)?;
|
||||||
loader.push(PathBuf::from("loader"));
|
loader.push(PathBuf::from("loader"));
|
||||||
|
|
||||||
|
|
@ -534,10 +537,10 @@ fn renode_image(debug: bool, packages: &[&str], extra_packages: &[&str]) -> Resu
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(debug: bool, init: &[&str]) -> Result<(), DynError> {
|
fn run(debug: bool, init: &[&str], features: Option<&[&str]>) -> Result<(), DynError> {
|
||||||
let stream = if debug { "debug" } else { "release" };
|
let stream = if debug { "debug" } else { "release" };
|
||||||
|
|
||||||
build(init, debug, None, None, None)?;
|
build(init, debug, None, None, None, features)?;
|
||||||
|
|
||||||
// Build and run the kernel
|
// Build and run the kernel
|
||||||
let mut args = vec!["run"];
|
let mut args = vec!["run"];
|
||||||
|
|
@ -583,7 +586,7 @@ fn build_kernel(debug: bool) -> Result<PathBuf, DynError> {
|
||||||
debug,
|
debug,
|
||||||
Some(KERNEL_TARGET),
|
Some(KERNEL_TARGET),
|
||||||
Some("kernel".into()),
|
Some("kernel".into()),
|
||||||
None,
|
None, None,
|
||||||
)?;
|
)?;
|
||||||
path.push("kernel");
|
path.push("kernel");
|
||||||
Ok(path)
|
Ok(path)
|
||||||
|
|
@ -832,11 +835,18 @@ fn build(
|
||||||
target: Option<&str>,
|
target: Option<&str>,
|
||||||
directory: Option<PathBuf>,
|
directory: Option<PathBuf>,
|
||||||
extra_args: Option<&[&str]>,
|
extra_args: Option<&[&str]>,
|
||||||
|
features: Option<&[&str]>,
|
||||||
) -> Result<PathBuf, DynError> {
|
) -> Result<PathBuf, DynError> {
|
||||||
ensure_compiler(&target)?;
|
ensure_compiler(&target)?;
|
||||||
let stream = if debug { "debug" } else { "release" };
|
let stream = if debug { "debug" } else { "release" };
|
||||||
let mut args = vec!["build"];
|
let mut args = vec!["build"];
|
||||||
print!("Building");
|
print!("Building");
|
||||||
|
|
||||||
|
if let Some(feature) = features {
|
||||||
|
for &a in feature {
|
||||||
|
args.push(a);
|
||||||
|
}
|
||||||
|
}
|
||||||
for package in packages {
|
for package in packages {
|
||||||
print!(" {}", package);
|
print!(" {}", package);
|
||||||
args.push("--package");
|
args.push("--package");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue