add elm-animator runner

This commit is contained in:
mdgriffith 2020-08-09 09:34:35 -04:00
parent f271e041ac
commit 9609a945c4
3 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,18 @@
port module Run exposing (main)
{-| -}
import Benchmark exposing (..)
import Benchmark.Runner exposing (BenchmarkProgram, program)
import Benchmark.Runner.Json
import Benchmarks
import Html
import Json.Encode
main : Benchmark.Runner.Json.JsonBenchmark
main =
Benchmark.Runner.Json.program reportResults Benchmarks.suite
port reportResults : Json.Encode.Value -> Cmd msg

View File

@ -0,0 +1,22 @@
<html>
<head>
<meta charset="UTF-8" />
<title>Main</title>
<script src="output/elm.opt.js"></script>
</head>
<body>
<div id="myapp"></div>
<script>
var app = Elm.Run.init({
node: document.getElementById('myapp'),
});
window.results = [];
app.ports.reportResults.subscribe(function(message) {
window.results = message;
document.title = 'done';
});
</script>
</body>
</html>

View File

@ -0,0 +1,21 @@
<html>
<head>
<meta charset="UTF-8" />
<title>Main</title>
<script src="output/elm.opt.transformed.js"></script>
</head>
<body>
<div id="myapp"></div>
<script>
var app = Elm.Run.init({
node: document.getElementById('myapp'),
});
window.results = [];
app.ports.reportResults.subscribe(function(message) {
window.results = message;
document.title = 'done';
});
</script>
</body>
</html>