Hasty Briefsbeta

Show HN: A "Cram tests" script for windows shells

15 days ago
  • #Cram
  • #Windows
  • #Testing
  • Cram tests can now run on Windows Powershell and Cmd.
  • Features present in craM but not yet in craW include basics interpretation of .t files and generation of corresponding .err files.
  • Supports Powershell and Cmd via --shell=powershell and --shell=cmd flags.
  • Includes sandboxed test directory and promotion of .err to .t via -i -y flags.
  • Cram environment variables are duplicated as Powershell environment items and proper variables.
  • Test framework behavior includes non-zero return code and diff display when .err differs from .t.
  • Displays error codes after command if non-zero and supports regular expressions for expected output.
  • Configuration options via .cramrc and CRAM environment variable.
  • Usage: craw.py [OPTIONS] TESTS... with various options like --interactive, --yes, --promote, --keep-tmpdir, and --shell.
  • Non-indented lines are comments; lines starting with ' $ ' are shell commands; lines starting with ' ' are expected outputs.
  • TESTDIR environment variable is set to the directory from which craw is executed.
  • Exit codes are displayed for failing commands.
  • Future work may include a unittest harness for more involved testing like property tests, fuzzing, or error handling.