Test =h on Linux (#17697)

This commit is contained in:
Khairul Azhar Kasmiran 2020-09-23 20:09:21 +08:00 committed by GitHub
parent ac6bdc1e7e
commit 6511ec9cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 2 deletions

View File

@ -45,6 +45,7 @@ jobs:
build_system: meson
compiler: gcc
run_tests: true
meson_options: -Duse_webui=true
enabled: ${{ github.event_name != 'pull_request' }}
timeout: 45
- name: linux-acr-clang-build
@ -65,7 +66,7 @@ jobs:
compiler: gcc
newshell: true
run_tests: true
meson_options: -Db_coverage=true
meson_options: -Db_coverage=true -Duse_webui=true
coverage: true
enabled: true
timeout: 50
@ -81,7 +82,7 @@ jobs:
build_system: meson
compiler: gcc
cflags: '-DR2_ASSERT_STDOUT=1'
meson_options: -Db_sanitize=address,undefined
meson_options: -Db_sanitize=address,undefined -Duse_webui=true
asan: true
asan_options: 'detect_leaks=0,detect_odr_violation=0,allocator_may_return_null=1'
run_tests: true

View File

@ -0,0 +1,19 @@
NAME==h
FILE=--
CMDS=!scripts/test-webserver.sh
EXPECT=<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=false" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<title>radare2 webui</title>
EOF
EXPECT_ERR=<<EOF
Starting http server...
open http://localhost:9090/
r2 -C http://localhost:9090/cmd/
EOF
RUN

5
test/scripts/test-webserver.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
r2 -qq -c=h - &
curl -s --retry 6 --retry-connrefused http://localhost:9090/ | head -n 8
kill $!