Pārlūkot izejas kodu

Add Dylan language test (#4999)

* Add Dylan language test

* fix route in readme

* remove redundancy

* remove tar noise
Nate 6 gadi atpakaļ
vecāks
revīzija
d6b4af8c5b

+ 1 - 0
.travis.yml

@@ -27,6 +27,7 @@ env:
     - "TESTLANG=Crystal"
     - "TESTLANG=D"
     - "TESTLANG=Dart"
+    - "TESTLANG=Dylan"
     - "TESTLANG=Elixir"
     - "TESTLANG=Erlang"
     - "TESTLANG=FSharp"

+ 14 - 0
frameworks/Dylan/dylan/README.md

@@ -0,0 +1,14 @@
+# [OpenDylan](https://opendylan.org) Benchmarking Test
+
+### Plaintext Test
+
+* [Plaintext test source](dylan-server.dylan)
+
+## Infrastructure Software Versions
+The tests were run with:
+* [OpenDylan 2019.1](https://opendylan.org/documentation/release-notes/2019.1.html)
+
+## Test URLs
+### Plaintext Test
+
+http://localhost:8080/plaintext

+ 19 - 0
frameworks/Dylan/dylan/benchmark_config.json

@@ -0,0 +1,19 @@
+{
+  "framework": "dylan",
+  "tests": [{
+    "default": {
+      "plaintext_url": "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "platform": "Dylan",
+      "framework": "None",
+      "language": "Dylan",
+      "flavor": "OpenDylan",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "dylan",
+      "versus": "dylan"
+    }
+  }]
+}

+ 17 - 0
frameworks/Dylan/dylan/dylan-server.dylan

@@ -0,0 +1,17 @@
+Module: dylan-server
+
+define class <hello-page> (<resource>)
+end;
+
+define method respond (page :: <hello-page>, #key)
+  let stream = current-response();
+  set-header(stream, "Content-Type", "text/plain;charset=utf-8");
+  set-header(stream, "Date", as-rfc1123-string(current-date()));
+  write(stream, "Hello, World!");
+end;
+
+let server = make(<http-server>, listeners: list("0.0.0.0:8080"));
+
+add-resource(server, "/plaintext", make(<hello-page>));
+
+start-server(server);

+ 27 - 0
frameworks/Dylan/dylan/dylan.dockerfile

@@ -0,0 +1,27 @@
+FROM buildpack-deps:bionic
+
+RUN apt-get -yqq update
+RUN apt-get -yqq install libgc-dev libunwind-dev
+
+WORKDIR /opt
+
+RUN wget -q https://opendylan.org/downloads/opendylan/2019.1/opendylan-2019.1-x86_64-linux.tar.bz2
+RUN tar xjf opendylan-2019.1-x86_64-linux.tar.bz2
+
+RUN git clone --recursive https://github.com/dylan-lang/http
+
+ENV PATH /opt/opendylan-2019.1/bin:$PATH
+
+WORKDIR /
+
+RUN make-dylan-app dylan-server
+
+ENV OPEN_DYLAN_USER_REGISTRIES /dylan-server/registry:/opt/http/registry
+
+COPY *.dylan dylan-server/
+
+WORKDIR /dylan-server
+
+RUN dylan-compiler -build dylan-server.lid
+
+CMD ./_build/bin/dylan-server

+ 17 - 0
frameworks/Dylan/dylan/library.dylan

@@ -0,0 +1,17 @@
+Module: dylan-user
+
+define library dylan-server
+  use common-dylan;
+  use io, import: { streams };
+  use http-common;
+  use http-server;
+  use system, import: { date };
+end library dylan-server;
+
+define module dylan-server
+  use common-dylan;
+  use date, import: { as-rfc1123-string, current-date };
+  use http-common;
+  use http-server;
+  use streams, import: { write };
+end module dylan-server;