test-rust.mjs 477 B

1234567891011121314151617
  1. #!/usr/bin/env zx
  2. import 'zx/globals';
  3. import { cliArguments, workingDirectory } from '../utils.mjs';
  4. // Configure additional arguments here, e.g.:
  5. // ['--arg1', '--arg2', ...cliArguments()]
  6. const testArgs = cliArguments();
  7. const hasSolfmt = await which('solfmt', { nothrow: true });
  8. // Run the tests.
  9. cd(path.join(workingDirectory, 'clients', 'rust'));
  10. if (hasSolfmt) {
  11. await $`cargo test-sbf ${testArgs} 2>&1 | solfmt`;
  12. } else {
  13. await $`cargo test-sbf ${testArgs}`;
  14. }