-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6de2d2e
commit b03caf1
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env zx | ||
import 'zx/globals'; | ||
import { | ||
cliArguments, | ||
getProgramFolders, | ||
workingDirectory, | ||
} from '../utils.mjs'; | ||
|
||
// Save external programs binaries to the output directory. | ||
import './dump.mjs'; | ||
|
||
// Configure additional arguments here, e.g.: | ||
// ['--arg1', '--arg2', ...cliArguments()] | ||
const benchArgs = [ | ||
'--features', | ||
'bpf-entrypoint', | ||
...cliArguments(), | ||
]; | ||
|
||
const hasSolfmt = await which('solfmt', { nothrow: true }); | ||
|
||
// Test the programs. | ||
await Promise.all( | ||
getProgramFolders().map(async (folder) => { | ||
const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml'); | ||
|
||
if (hasSolfmt) { | ||
await $`RUST_LOG=error cargo bench --manifest-path ${manifestPath} ${benchArgs} 2>&1 | solfmt`; | ||
} else { | ||
await $`RUST_LOG=error cargo bench --manifest-path ${manifestPath} ${benchArgs}`; | ||
} | ||
}) | ||
); |