babashka/script/lib_tests/clj_yaml_tests

24 lines
610 B
Text
Raw Normal View History

#!/usr/bin/env bash
set -eo pipefail
if [ "$BABASHKA_TEST_ENV" = "native" ]; then
BB_CMD="./bb"
else
BB_CMD="lein bb"
fi
$BB_CMD -e "
(require '[clojure.java.io :as io])
(def test-file (io/file (System/getProperty \"java.io.tmpdir\") \"core_test.clj\"))
(io/copy
(io/input-stream \"https://raw.githubusercontent.com/clj-commons/clj-yaml/master/test/clj_yaml/core_test.clj\")
test-file)
(load-file test-file)
(require '[clojure.test :as t])
(let [{:keys [:test :pass :fail :error]} (t/run-tests 'clj-yaml.core-test)]
(when-not (pos? test)
(System/exit 1))
(System/exit (+ fail error)))
"