Skip to content
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

Merged
merged 4 commits into from
Jan 31, 2025
Merged

Conversation

litlep-nibbyt
Copy link
Contributor

No description provided.

Comment on lines -143 to -176
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(())
}
Copy link
Contributor

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?

Copy link
Contributor Author

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?

@@ -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.
Copy link
Contributor

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?

Copy link
Contributor Author

@litlep-nibbyt litlep-nibbyt Jan 31, 2025

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

Copy link
Contributor Author

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

@litlep-nibbyt litlep-nibbyt enabled auto-merge (squash) January 31, 2025 18:44
@litlep-nibbyt litlep-nibbyt merged commit 69cd084 into master Jan 31, 2025
1 check passed
@litlep-nibbyt litlep-nibbyt deleted the jyw/extends branch January 31, 2025 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants