Skip to content

Runtime tests for Windows #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions src/main/clojure/cljs/externs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)))

Expand All @@ -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]))
Expand Down
6 changes: 5 additions & 1 deletion src/test/cljs/test_runner.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down