#!/bin/sh # build smoke: `jolt build` compiles a multi-namespace app (macro + cross-ns + # clojure.string) into a standalone binary, which then runs with no jolt source # or Chez install on the path — args reach -main, output matches. root="$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)" cd "$root" app="$root/test/chez/build-app" out="$(mktemp -d)/app-bin" trap 'rm -rf "$(dirname "$out")"' EXIT echo "build smoke: compiling app.core -> $out" if ! JOLT_PWD="$app" bin/joltc build -m app.core -o "$out" >/dev/null 2>&1; then echo " FAIL: jolt build exited non-zero" exit 1 fi [ -x "$out" ] || { echo " FAIL: no executable produced"; exit 1; } # Run from a neutral cwd with args; check the three output lines. got="$(cd / && "$out" alpha bb ccc 2>&1)" want='HELLO FROM A BUILT BINARY! HELLO FROM A BUILT BINARY! args: [alpha bb ccc] sum: 10' if [ "$got" = "$want" ]; then echo "build smoke: passed" else echo " FAIL: binary output mismatch" echo "--- want ---"; echo "$want" echo "--- got ----"; echo "$got" exit 1 fi