Skip to content

Commit

Permalink
make check
Browse files Browse the repository at this point in the history
  • Loading branch information
ithewei committed Aug 18, 2021
1 parent ff6d2ff commit b5248e9
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
sudo apt install libssl-dev libnghttp2-dev
./configure --with-openssl --with-nghttp2
make libhv examples unittest evpp
make check
build-macos:
name: build-macos
Expand All @@ -31,6 +32,7 @@ jobs:
run: |
./configure
make libhv examples unittest evpp
make check
build-windows:
name: build-windows
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ unittest: prepare
$(CC) -g -Wall -O0 -std=c99 -I. -Ibase -Iprotocol -o bin/ftp unittest/ftp_test.c protocol/ftp.c base/hsocket.c
$(CC) -g -Wall -O0 -std=c99 -I. -Ibase -Iprotocol -Iutil -o bin/sendmail unittest/sendmail_test.c protocol/smtp.c base/hsocket.c util/base64.c

run-unittest: unittest
bash scripts/unittest.sh

check: examples
bash scripts/check.sh

evpp: prepare libhv
$(CXX) -g -Wall -O0 -std=c++11 -I. -Ibase -Issl -Ievent -Icpputil -Ievpp -o bin/EventLoop_test evpp/EventLoop_test.cpp -Llib -lhv -pthread
$(CXX) -g -Wall -O0 -std=c++11 -I. -Ibase -Issl -Ievent -Icpputil -Ievpp -o bin/EventLoopThread_test evpp/EventLoopThread_test.cpp -Llib -lhv -pthread
Expand All @@ -168,4 +174,7 @@ echo-servers:
$(CXX) -g -Wall -std=c++11 -o bin/poco_echo echo-servers/poco_echo.cpp -lPocoNet -lPocoUtil -lPocoFoundation
# $(CXX) -g -Wall -std=c++11 -o bin/muduo_echo echo-servers/muduo_echo.cpp -lmuduo_net -lmuduo_base -pthread

echo-benchmark: echo-servers
bash echo-servers/benchmark.sh

.PHONY: clean prepare install libhv examples unittest evpp echo-servers
15 changes: 15 additions & 0 deletions scripts/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

SCRIPT_DIR=$(cd `dirname $0`; pwd)
ROOT_DIR=${SCRIPT_DIR}/..
cd ${ROOT_DIR}

bin/httpd -c etc/httpd.conf -s restart -d
ps aux | grep httpd
HTTPS=`netstat -atn | grep 8443 | wc -l`

bin/http_client_test
bin/curl -v http://127.0.0.1:8080/
if [ $HTTPS -gt 0 ]; then
bin/curl -v https://127.0.0.1:8443/
fi
21 changes: 21 additions & 0 deletions scripts/unittest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

SCRIPT_DIR=$(cd `dirname $0`; pwd)
ROOT_DIR=${SCRIPT_DIR}/..
cd ${ROOT_DIR}

bin/date
bin/ifconfig
bin/mkdir_p 123/456
bin/ls
bin/rmdir_p 123/456

bin/defer_test
bin/hstring_test
# bin/hatomic_test
# bin/hatomic_cpp_test
# bin/hthread_test
# bin/hmutex_test
bin/socketpair_test
# bin/threadpool_test
# bin/objectpool_test

0 comments on commit b5248e9

Please sign in to comment.