test-rust.mjs 427 B

123456789101112131415
  1. #!/usr/bin/env zx
  2. import 'zx/globals';
  3. import { workingDirectory } from '../utils.mjs';
  4. // Start the local validator if it's not already running.
  5. await $`pnpm validator --force`;
  6. // Run the tests.
  7. cd(path.join(workingDirectory, 'clients', 'rust'));
  8. const hasSolfmt = await which('solfmt', { nothrow: true });
  9. if (hasSolfmt) {
  10. await $`cargo test-sbf ${argv._} 2>&1 | solfmt`;
  11. } else {
  12. await $`cargo test-sbf ${argv._}`;
  13. }