ithewei 4 роки тому
батько
коміт
b5248e957c
4 змінених файлів з 47 додано та 0 видалено
  1. 2 0
      .github/workflows/CI.yml
  2. 9 0
      Makefile
  3. 15 0
      scripts/check.sh
  4. 21 0
      scripts/unittest.sh

+ 2 - 0
.github/workflows/CI.yml

@@ -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
@@ -31,6 +32,7 @@ jobs:
         run: |
           ./configure
           make libhv examples unittest evpp
+          make check
 
   build-windows:
     name: build-windows

+ 9 - 0
Makefile

@@ -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
@@ -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 - 0
scripts/check.sh

@@ -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 - 0
scripts/unittest.sh

@@ -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