-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c99aacd
commit 2df47ae
Showing
14 changed files
with
209 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Graal tests | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
java: ['17'] | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
version: 'latest' | ||
java-version: ${{ matrix.java }} | ||
components: 'native-image' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: DeLaGuardo/[email protected] | ||
with: | ||
lein: latest | ||
bb: latest | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: deps-${{ hashFiles('deps.edn') }} | ||
restore-keys: deps- | ||
|
||
- run: bb graal-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Main tests | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
strategy: | ||
matrix: | ||
java: ['17', '18', '19'] | ||
os: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'corretto' | ||
java-version: ${{ matrix.java }} | ||
|
||
- uses: DeLaGuardo/[email protected] | ||
with: | ||
lein: latest | ||
|
||
- uses: actions/cache@v4 | ||
id: cache-deps | ||
with: | ||
path: ~/.m2/repository | ||
key: deps-${{ hashFiles('project.clj') }} | ||
restore-keys: deps- | ||
|
||
- run: lein test-all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,3 @@ pom.xml* | |
/target/ | ||
/checkouts/ | ||
/logs/ | ||
/docs/ | ||
/doc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: ptaoussanis | ||
custom: "https://www.taoensso.com/clojure" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{:paths ["bb"] | ||
:tasks | ||
{:requires ([graal-tests]) | ||
graal-tests | ||
{:doc "Run Graal native-image tests" | ||
:task | ||
(do | ||
(graal-tests/uberjar) | ||
(graal-tests/native-image) | ||
(graal-tests/run-tests))}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bb | ||
|
||
(ns graal-tests | ||
(:require | ||
[clojure.string :as str] | ||
[babashka.fs :as fs] | ||
[babashka.process :refer [shell]])) | ||
|
||
(defn uberjar [] | ||
(let [command "lein with-profiles +graal-tests uberjar" | ||
command | ||
(if (fs/windows?) | ||
(if (fs/which "lein") | ||
command | ||
;; Assume PowerShell powershell module | ||
(str "powershell.exe -command " (pr-str command))) | ||
command)] | ||
|
||
(shell command))) | ||
|
||
(defn executable [dir name] | ||
(-> (fs/glob dir (if (fs/windows?) (str name ".{exe,bat,cmd}") name)) | ||
first | ||
fs/canonicalize | ||
str)) | ||
|
||
(defn native-image [] | ||
(let [graalvm-home (System/getenv "GRAALVM_HOME") | ||
bin-dir (str (fs/file graalvm-home "bin"))] | ||
(shell (executable bin-dir "gu") "install" "native-image") | ||
(shell (executable bin-dir "native-image") | ||
"--features=clj_easy.graal_build_time.InitClojureClasses" | ||
"--no-fallback" "-jar" "target/graal-tests.jar" "graal_tests"))) | ||
|
||
(defn run-tests [] | ||
(let [{:keys [out]} (shell {:out :string} (executable "." "graal_tests"))] | ||
(assert (str/includes? out "loaded") out) | ||
(println "Native image works!"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{:cljdoc/docstring-format :plaintext} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,63 @@ | ||
(defproject com.taoensso/touchstone "2.1.0" | ||
:author "Peter Taoussanis <https://www.taoensso.com>" | ||
:description "Split testing library for Clojure" | ||
:url "https://github.com/ptaoussanis/touchstone" | ||
:license {:name "Eclipse Public License" | ||
:url "http://www.eclipse.org/legal/epl-v10.html" | ||
:distribution :repo | ||
:comments "Same as Clojure"} | ||
:min-lein-version "2.3.3" | ||
:global-vars {*warn-on-reflection* true | ||
*assert* true} | ||
:dependencies | ||
[[org.clojure/clojure "1.5.1"] | ||
[com.taoensso/encore "2.68.0"] | ||
[com.taoensso/carmine "2.14.0"] | ||
[org.clojure/math.combinatorics "0.0.7"]] | ||
:description "Simple A/B testing library for Clojure" | ||
:url "https://github.com/taoensso/touchstone" | ||
|
||
:license | ||
{:name "Eclipse Public License - v 1.0" | ||
:url "https://www.eclipse.org/legal/epl-v10.html"} | ||
|
||
:plugins | ||
[[lein-pprint "1.1.2"] | ||
[lein-ancient "0.6.10"] | ||
[lein-codox "0.9.5"]] | ||
:test-paths ["test" #_"src"] | ||
|
||
:dependencies | ||
[[com.taoensso/encore "3.31.0"] | ||
[com.taoensso/carmine "3.1.0"] | ||
[org.clojure/math.combinatorics "0.1.6"]] | ||
|
||
:profiles | ||
{;; :default [:base :system :user :provided :dev] | ||
:server-jvm {:jvm-opts ^:replace ["-server"]} | ||
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]} | ||
:1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]} | ||
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]} | ||
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]} | ||
:1.9 {:dependencies [[org.clojure/clojure "1.9.0-alpha10"]]} | ||
:test {:dependencies [[org.clojure/test.check "0.9.0"] | ||
[ring/ring-core "1.5.0"]]} | ||
:provided {:dependencies [[org.clojure/clojurescript "1.11.60"] | ||
[org.clojure/clojure "1.11.1"]]} | ||
:c1.11 {:dependencies [[org.clojure/clojure "1.11.1"]]} | ||
:c1.10 {:dependencies [[org.clojure/clojure "1.10.3"]]} | ||
:c1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]} | ||
|
||
:graal-tests | ||
{:source-paths ["test"] | ||
:main taoensso.graal-tests | ||
:aot [taoensso.graal-tests] | ||
:uberjar-name "graal-tests.jar" | ||
:dependencies | ||
[[org.clojure/clojure "1.11.1"] | ||
[com.github.clj-easy/graal-build-time "1.0.5"]]} | ||
|
||
:dev | ||
[:1.9 :test :server-jvm]} | ||
{:jvm-opts ["-server" #_"-Dtaoensso.elide-deprecated=true"] | ||
|
||
:global-vars | ||
{*warn-on-reflection* true | ||
*assert* true | ||
*unchecked-math* false #_:warn-on-boxed} | ||
|
||
:dependencies | ||
[[org.clojure/test.check "1.1.1"] | ||
[ring/ring-core "1.9.6"]] | ||
|
||
:test-paths ["test" "src"] | ||
:plugins | ||
[[lein-pprint "1.3.2"] | ||
[lein-ancient "0.7.0"] | ||
[lein-cljsbuild "1.1.8"] | ||
[com.taoensso.forks/lein-codox "0.10.11"]] | ||
|
||
:codox | ||
{:language :clojure | ||
:source-uri "https://github.com/ptaoussanis/carmine/blob/master/{filepath}#L{line}"} | ||
:codox | ||
{:language #{:clojure #_:clojurescript} | ||
:base-language :clojure}}} | ||
|
||
:aliases | ||
{"test-all" ["with-profile" "+1.9:+1.8:+1.7:+1.6:+1.5" "test"] | ||
"deploy-lib" ["do" "deploy" "clojars," "install"] | ||
"start-dev" ["with-profile" "+dev" "repl" ":headless"]} | ||
{"start-dev" ["with-profile" "+dev" "repl" ":headless"] | ||
"build-once" ["do" ["clean"] ["cljsbuild" "once"]] | ||
"deploy-lib" ["do" ["build-once"] ["deploy" "clojars"] ["install"]] | ||
|
||
:repositories {"sonatype-oss-public" | ||
"https://oss.sonatype.org/content/groups/public/"}) | ||
"test-clj" ["with-profile" "+c1.11:+c1.10:+c1.9" "test"] | ||
"test-cljs" ["with-profile" "+test" "cljsbuild" "test"] | ||
"test-all" ["do" ["clean"] ["test-clj"] ["test-cljs"]]}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(ns taoensso.graal-tests | ||
(:require [taoensso.touchstone :as touchstone]) | ||
(:gen-class)) | ||
|
||
(defn -main [& args] (println "Namespace loaded successfully")) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(ns taoensso.touchstone-tests | ||
(:require | ||
[clojure.test :as test :refer [deftest testing is]] | ||
[taoensso.encore :as enc])) | ||
|
||
(comment | ||
(remove-ns 'taoensso.touchstone-tests) | ||
(test/run-tests 'taoensso.touchstone-tests)) | ||
|
||
;;;; | ||
|
||
;; (deftest pass (is (= 1 1))) | ||
;; (deftest fail (is (= 1 0))) |