-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
choo: factor out library pieces, add arbitrary arg #133
Conversation
779203c
to
2bd1dde
Compare
pub mod test { | ||
use super::*; | ||
use tokio::fs; | ||
use tracing::info; | ||
|
||
pub async fn test_nockapp( | ||
entry: std::path::PathBuf, | ||
deps_dir: std::path::PathBuf, | ||
) -> Result<crown::nockapp::NockApp, Error> { | ||
let cli = ChooCli { | ||
boot: BootCli { | ||
save_interval: 1000, | ||
new: false, | ||
trace: false, | ||
log_level: "trace".to_string(), | ||
color: ColorChoice::Auto, | ||
state_jam: None, | ||
}, | ||
entry, | ||
directory: deps_dir, | ||
arbitrary: false, | ||
}; | ||
initialize_nockapp(cli).await | ||
} | ||
|
||
pub async fn test_build(nockapp: &mut crown::nockapp::NockApp) -> Result<(), Error> { | ||
nockapp.run().await?; | ||
// TODO this doesn't work because choo exits when compilation is done. | ||
// Verify output file exists and is not empty | ||
let metadata = fs::metadata("out.jam").await?; | ||
info!("Output file size: {} bytes", metadata.len()); | ||
assert!(metadata.len() > 0, "Output file is empty"); | ||
Ok(()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we deleting the tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We aren't deleting the tests, these are functions that I moved out of the test module because they're used to build jams, possibly outside of tests. @bitemyapp is there a specific reason why you have them in the test module?
apps/choo/tests/build.rs
Outdated
@@ -1,4 +1,5 @@ | |||
use choo::test::*; | |||
use choo::{initialize_nockapp_, run_build}; | |||
use crown::kernel::boot::default_boot_cli; | |||
use tracing::{debug, info}; | |||
|
|||
// TODO: Move this to an integration test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this comment go away now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but I can make the change to move them to integration tests in this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, it already is. I was looking at this on my phone. Will delete comment now
No description provided.