Skip to content

Commit

Permalink
chore: automatically clear any unwanted directories in test_programs (
Browse files Browse the repository at this point in the history
#5081)

# Description

## Problem\*

Closes #5035

## Summary\*

Alternative to #5035 which just deletes any test programs which don't
have a Nargo.toml file.

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
TomAFrench authored May 22, 2024
1 parent 4ae91cf commit e807f0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions test_programs/rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ process_dir() {
local current_dir=$2
local dir_name=$(basename "$dir")

if [[ ! -f "$dir/Nargo.toml" ]]; then
# This directory isn't a proper test but just hold some stale build artifacts
# We then delete it and carry on.
rm -rf $dir
return 0
fi


if [[ ! -d "$current_dir/acir_artifacts/$dir_name" ]]; then
mkdir -p $current_dir/acir_artifacts/$dir_name
fi
Expand Down
3 changes: 2 additions & 1 deletion tooling/nargo_cli/src/cli/info_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ pub(crate) fn run(args: InfoCommand, config: NargoConfig) -> Result<(), CliError
} else {
// Otherwise print human-readable table.
if !info_report.programs.is_empty() {
let mut program_table = table!([Fm->"Package", Fm->"Function", Fm->"Expression Width", Fm->"ACIR Opcodes"]);
let mut program_table =
table!([Fm->"Package", Fm->"Function", Fm->"Expression Width", Fm->"ACIR Opcodes"]);

for program_info in info_report.programs {
let program_rows: Vec<Row> = program_info.into();
Expand Down

0 comments on commit e807f0d

Please sign in to comment.