diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c264439fc..a7e4fca73 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -54,6 +54,27 @@ jobs: WebKit/WebKitBuild/Release/bin/jsc builds/out-adv/core-advanced-test.js | tee test-out.txt grep -qxF '0 failures, 0 errors.' test-out.txt + # Runtime Tests + runtime-windows-test: + name: Runtime Windows Tests + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + + - uses: DeLaGuardo/setup-clojure@3.5 + with: + cli: '1.10.1.763' + + - name: Build tests + run: clojure -M:runtime.test.build + shell: powershell + + - name: Run tests + run: | + node builds/out-adv/core-advanced-test.js | tee test-out.txt + findstr "0 failures, 0 errors." test-out.txt + shell: powershell + # Self-host Tests self-host-test: name: Self-host Tests diff --git a/src/main/clojure/cljs/externs.clj b/src/main/clojure/cljs/externs.clj index b7b42fa36..e940461e7 100644 --- a/src/main/clojure/cljs/externs.clj +++ b/src/main/clojure/cljs/externs.clj @@ -16,7 +16,8 @@ [com.google.javascript.jscomp.parsing Config$JsDocParsing] [com.google.javascript.rhino Node Token JSTypeExpression JSDocInfo$Visibility] - [java.util.logging Level])) + [java.util.logging Level] + [java.net URL])) (def ^:dynamic *ignore-var* false) (def ^:dynamic *source-file* nil) @@ -288,9 +289,9 @@ {} externs)))) (defn resource->source-file - [resource] + [^URL resource] (-> (SourceFile/builder) - (.withPath (.toPath (io/file (.getPath resource)))) + (.withPath (.getPath resource)) (.withContent (io/input-stream resource)) (.build))) @@ -313,6 +314,8 @@ '[clojure.pprint :refer [pprint]] '[cljs.js-deps :as js-deps]) + (resource->source-file (io/resource "goog/dom/dom.js")) + (pprint (get-in (analyze-goog-file "goog/dom/dom.js") [:defs 'setTextContent])) diff --git a/src/test/cljs/test_runner.cljs b/src/test/cljs/test_runner.cljs index 7a6023c85..0c2900009 100644 --- a/src/test/cljs/test_runner.cljs +++ b/src/test/cljs/test_runner.cljs @@ -56,7 +56,11 @@ [cljs.extend-to-native-test])) (set! *print-newline* false) -(set-print-fn! js/print) + +;; When testing Windows we default to Node.js +(if (exists? js/print) + (set-print-fn! js/print) + (enable-console-print!)) (run-tests 'cljs.apply-test