mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
progress on test ...
This commit is contained in:
parent
405623610d
commit
45d49f5dcc
8 changed files with 49 additions and 48 deletions
|
|
@ -7,7 +7,7 @@
|
|||
(executable
|
||||
(name sse_server_domains)
|
||||
(modules sse_server_domains)
|
||||
(enabled_if (>= %{ocaml_version} 5.00.0))
|
||||
(enabled_if (>= %{ocaml_version} 5.0.0))
|
||||
(libraries tiny_httpd tiny_httpd_domains unix ptime ptime.clock.os))
|
||||
|
||||
(executable
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
(executable
|
||||
(name echo_domains)
|
||||
(flags :standard -warn-error -a+8)
|
||||
(enabled_if (>= %{ocaml_version} 5.00.0))
|
||||
(enabled_if (>= %{ocaml_version} 5.0.0))
|
||||
(modules echo_domains vfs_domains)
|
||||
(libraries tiny_httpd tiny_httpd_camlzip tiny_httpd_domains))
|
||||
|
||||
|
|
@ -34,7 +34,15 @@
|
|||
(enabled_if (= %{system} "linux"))
|
||||
(package tiny_httpd)
|
||||
(action
|
||||
(with-stdout-to %{targets} (run %{script}))))
|
||||
(with-stdout-to %{targets} (run %{script} 8082))))
|
||||
|
||||
(rule
|
||||
(targets test_output_domains.txt)
|
||||
(deps (:script ./run_test.sh) ./sse_client.exe ./sse_server_domains.exe)
|
||||
(enabled_if (and (= %{system} "linux") (>= %{ocaml_version} 5.0.0)))
|
||||
(package tiny_httpd)
|
||||
(action
|
||||
(with-stdout-to %{targets} (run %{script} 8083))))
|
||||
|
||||
(rule
|
||||
(alias runtest)
|
||||
|
|
@ -44,6 +52,14 @@
|
|||
(action
|
||||
(diff test_output.txt.expected test_output.txt)))
|
||||
|
||||
(rule
|
||||
(alias runtest)
|
||||
(package tiny_httpd_domains)
|
||||
(enabled_if (and (= %{system} "linux") (>= %{ocaml_version} 5.0.0)))
|
||||
(deps test_output_domains.txt)
|
||||
(action
|
||||
(diff test_output_domains.txt.expected test_output_domains.txt)))
|
||||
|
||||
; produce an embedded FS
|
||||
(rule
|
||||
(targets vfs.ml)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PORT=8082
|
||||
PORT=$1
|
||||
|
||||
./sse_server.exe -p $PORT &
|
||||
PID=$!
|
||||
|
|
@ -10,14 +10,3 @@ sleep 0.1
|
|||
|
||||
kill $PID
|
||||
echo "success"
|
||||
|
||||
if [ -f ./sse_server_domains.exe ]; then
|
||||
./sse_server_domains.exe -p $PORT &
|
||||
PID=$!
|
||||
|
||||
sleep 0.1
|
||||
./sse_client.exe -p $PORT --alarm=1 /count | tr -d '\r' || true
|
||||
|
||||
kill $PID
|
||||
echo "success with domains"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -24,29 +24,3 @@ data: 8
|
|||
data: 9
|
||||
|
||||
success
|
||||
listening on http://localhost:8082/
|
||||
connect to 127.0.0.1:8082
|
||||
HTTP/1.1 200 OK
|
||||
content-type: text/event-stream
|
||||
|
||||
data: 0
|
||||
|
||||
data: 1
|
||||
|
||||
data: 2
|
||||
|
||||
data: 3
|
||||
|
||||
data: 4
|
||||
|
||||
data: 5
|
||||
|
||||
data: 6
|
||||
|
||||
data: 7
|
||||
|
||||
data: 8
|
||||
|
||||
data: 9
|
||||
|
||||
success with domains
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
(library
|
||||
(name tiny_httpd_domains)
|
||||
(public_name tiny_httpd_domains)
|
||||
(enabled_if (>= %{ocaml_version} 5.00.0))
|
||||
(enabled_if (>= %{ocaml_version} 5.0.0))
|
||||
(synopsis "Allowing to use ocaml domains instead of theads")
|
||||
(flags :standard -safe-string -warn-error -a+8)
|
||||
(libraries tiny_httpd domainslib))
|
||||
|
|
|
|||
28
tests/dune
28
tests/dune
|
|
@ -5,7 +5,15 @@
|
|||
(locks /port)
|
||||
(enabled_if (= %{system} "linux"))
|
||||
(package tiny_httpd_camlzip)
|
||||
(action (with-stdout-to %{targets} (run ./echo1.sh %{bin}))))
|
||||
(action (with-stdout-to %{targets} (run ./echo1.sh %{bin} 8085))))
|
||||
|
||||
(rule
|
||||
(targets echo1_domains.out)
|
||||
(deps (:bin ../examples/echo_domains.exe))
|
||||
(locks /port)
|
||||
(enabled_if (and (= %{system} "linux") (>= %{ocaml_version} 5.0.0)))
|
||||
(package tiny_httpd_domains)
|
||||
(action (with-stdout-to %{targets} (run ./echo1.sh %{bin} 8095))))
|
||||
|
||||
(rule
|
||||
(alias runtest)
|
||||
|
|
@ -13,19 +21,33 @@
|
|||
(enabled_if (= %{system} "linux"))
|
||||
(action (diff echo1.expect echo1.out)))
|
||||
|
||||
(rule
|
||||
(alias runtest)
|
||||
(package tiny_httpd_camlzip)
|
||||
(enabled_if (and (= %{system} "linux") (>= %{ocaml_version} 5.0.0)))
|
||||
(action (diff echo1_domains.expect echo1_domains.out)))
|
||||
|
||||
(rule
|
||||
(targets sse_count.out)
|
||||
(deps (:bin ../examples/sse_server.exe))
|
||||
(locks /port)
|
||||
(enabled_if (= %{system} "linux"))
|
||||
(package tiny_httpd)
|
||||
(action (with-stdout-to %{targets} (run ./sse_count.sh %{bin}))))
|
||||
(action (with-stdout-to %{targets} (run ./sse_count.sh %{bin} 8086))))
|
||||
|
||||
(rule
|
||||
(targets sse_count_domains.out)
|
||||
(deps (:bin ../examples/sse_server_domains.exe))
|
||||
(locks /port)
|
||||
(enabled_if (and (= %{system} "linux") (>= %{ocaml_version} 5.0.0)))
|
||||
(package tiny_httpd_domains)
|
||||
(action (with-stdout-to %{targets} (run ./sse_count.sh %{bin} 8096))))
|
||||
|
||||
(rule
|
||||
(alias runtest)
|
||||
(package tiny_httpd)
|
||||
(enabled_if (= %{system} "linux"))
|
||||
(action (diff sse_count.expect sse_count.out)))
|
||||
(action (diff sse_count_domains.expect sse_count_domains.out)))
|
||||
|
||||
(rule
|
||||
(targets upload-out)
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ sub
|
|||
<a href="/vfs/test_out.txt">
|
||||
test_out.txt
|
||||
</a>
|
||||
(431b)
|
||||
(209b)
|
||||
</li>
|
||||
</ul>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
ECHO=$1
|
||||
PORT=8085
|
||||
PORT=$2
|
||||
|
||||
"$ECHO" -p $PORT &
|
||||
PID=$!
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
SSE_SERVER=$1
|
||||
PORT=8086
|
||||
PORT=$2
|
||||
|
||||
"$SSE_SERVER" -p $PORT &
|
||||
PID=$!
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue