test.mjs 553 B

123456789101112131415161718
  1. #!/usr/bin/env zx
  2. import 'zx/globals';
  3. import { workingDirectory, getProgramFolders } from '../utils.mjs';
  4. // Save external programs binaries to the output directory.
  5. import './dump.mjs';
  6. const hasSolfmt = await which('solfmt', { nothrow: true });
  7. // Test the programs.
  8. for (const folder of getProgramFolders()) {
  9. cd(`${path.join(workingDirectory, folder)}`);
  10. if (hasSolfmt) {
  11. await $`RUST_LOG=error cargo test-sbf ${process.argv.slice(3)} 2>&1 | solfmt`;
  12. } else {
  13. await $`RUST_LOG=error cargo test-sbf ${process.argv.slice(3)}`;
  14. }
  15. }