test.mjs 580 B

1234567891011121314151617181920
  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. // Test the programs.
  7. await Promise.all(
  8. getProgramFolders().map(async (folder) => {
  9. await $`cd ${path.join(workingDirectory, folder)}`.quiet();
  10. const hasSolfmt = await which('solfmt', { nothrow: true });
  11. if (hasSolfmt) {
  12. await $`RUST_LOG=error cargo test-sbf ${argv._} 2>&1 | solfmt`;
  13. } else {
  14. await $`RUST_LOG=error cargo test-sbf ${argv._}`;
  15. }
  16. })
  17. );