GitHub - ahoward/tc: tc - theodore calvin's language-agnostic testing framework 🚁 | simple, portable, unix-style testing for any language
language-agnostic testing for unix hackers theodore "tc" calvin - helicopter pilot, testing framework namesake, legend |=o=o=o=o=o=o=o=o=o=o=o=| tc v1.0.0 - island hopper | testing any language, anywhere ___/ \___ (o) 🚁 fly safe, test well (( tc ))======\ \_______/ (o) ^ ^ ^-----------^ What : Language-agnostic test framework. Write tests once, run against any language (bash, python, rust, go, whatever). How : Tests are directories. Your code reads input.json from stdin, writes expected.json to stdout. That's it. Get Started : # clone and install git clone https://github.com/ahoward/tc.git cd tc # IMPORTANT: Add to PATH (avoids conflict with Unix traffic control command) export PATH="$PWD/tc/bin:$PATH" # verify tc --version # try the hello-world example tc examples/hello-world # create your first test tc new tests/my-feature That's it. See full docs for advanced features. tc conflicts with the Unix traffic control command. You MUST add this project's tc to your PATH. # Add to PATH for current session export PATH="$PWD/tc/bin:$PATH" # Add to shell config for persistence (optional) echo 'export PATH="$PWD/tc/bin:$PATH"' >> ~/.bashrc # or ~/.zshrc Verify : which tc # should show: ./tc/bin/tc (NOT /usr/sbin/tc) tc --version # should show: tc v1.0.0 - island hopper tc is a dead-simple testing framework that lets you: test any language with the same test suite organize tests as directories with json input/output run tests with zero dependencies (just jq) port code between languages without rewriting tests simple • portable • language-agnostic • unix • spec-driven 🤖 In the AI age, specifications and tests are permanent while implementations are disposable. Tests are the spec. Code is a build artifact. Port languages freely, keep tests forever. See projects/ and examples/multi-lang-dao/ for a working example of identical DAO interfaces in 5 languages (Ruby, Go, Python, JavaScript, Rust) all passing the same test suite. Vision : Disposable applications. Swap languages freely, keep tests forever. See docs/THEORY.md for the full system adapter pattern vision. # test execution tc # run all tests (KISS!) tc <suite-path> # run single test suite tc <path> --all # run all suites in directory tree tc <path> --tags TAG # run suites matching tag tc <path> --parallel # run all suites in parallel (auto CPU detection) tc <path> --parallel N # run with N parallel workers # test generation tc new <test-path> # generate new test suite tc init [directory] # initialize test directory with README # discovery & metadata tc list [path] # list all test suites with metadata tc tags [path] # show all available tags tc explain <suite> # explain what a test suite does # info tc --version # show version tc --help # show help TTY mode (terminal): Clean single-line status with 🚁 spinner, fail-fast behavior Non-TTY mode (CI/CD): Traditional verbose output with full logs Override : TC_FANCY_OUTPUT=true/false → full docs | | → tc new guide → system adapter theory (WIP) my-feature/ ├── run # executable: reads input.json, writes json to stdout └── data/ └── scenario-1/ ├── input.json # test input └── expected.json # expected output tc my-feature # ✓ pass...
Preview: ~500 words
Continue reading at Hacker News
Read Full Article