Permalink
Browse files

added valgrind test

  • Loading branch information...
gafferongames committed Jun 1, 2017
1 parent fefa844 commit 7378feadbe114b1471526dda9050aeff6317d2b0
Showing with 71 additions and 29 deletions.
  1. +2 −1 .gitignore
  2. +1 −1 .travis.yml
  3. +1 −1 README.md
  4. +0 −6 TODO
  5. +2 −2 docker/Dockerfile
  6. +7 −7 docker/copyFiles.bat
  7. +21 −11 premake5.lua
  8. +37 −0 valgrind/Dockerfile
View
@@ -32,5 +32,6 @@ Release
Secure
.vs
cov-int
Docker/libyojimbo
docker/yojimbo
valgrind/yojimbo
docs
View
@@ -48,7 +48,7 @@ before_install:
addons:
coverity_scan:
project:
name: "networkprotocol/libyojimbo"
name: "networkprotocol/yojimbo"
description: "Build submitted via Travis CI"
notification_email: glenn.fiedler@gmail.com
build_command_prepend: "./premake5 gmake; make clean"
View
@@ -12,7 +12,7 @@ It is designed around the networking requirements of competitive realtime multip
Work over the past few months has been focused on documenting and finalizing the API. This work is nearly complete and a new release is imminent.
For more details please refer to the [roadmap](https://github.com/networkprotocol/libyojimbo/blob/master/ROADMAP.md).
For more details please refer to the [roadmap](https://github.com/networkprotocol/yojimbo/blob/master/ROADMAP.md).
## Author
View
6 TODO
@@ -64,12 +64,6 @@ TODO
------------
Add define to replace all allocators with default (so everything goes through malloc).
Setup a valgrind to check for memory leaks and trashes inside docker with the soak test.
------------
Implement packet loss, latency, jitter estimates from reliable.io
Integrate QoS settings above with yojimbo client/server and connection.
View
@@ -28,9 +28,9 @@ RUN wget https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.1.5.tar.gz && \
make && make install && \
ldconfig
ADD libyojimbo /app/libyojimbo
ADD yojimbo /app/yojimbo
RUN cd libyojimbo && find . -exec touch {} \; && premake5 gmake && make -j32 test server config=release_x64 && ./bin/test && cp /app/libyojimbo/bin/server /app && rm -rf libyojimbo
RUN cd yojimbo && find . -exec touch {} \; && premake5 gmake && make -j32 test server config=release_x64 && ./bin/test && cp /app/yojimbo/bin/server /app && rm -rf yojimbo
ENTRYPOINT ./server
View
@@ -1,11 +1,11 @@
@echo off
rmdir /s /q libyojimbo
mkdir libyojimbo
mkdir libyojimbo\tests
copy ..\*.h libyojimbo
copy ..\*.cpp libyojimbo
copy ..\tests\*.* libyojimbo\tests
rmdir /s /q yojimbo
mkdir yojimbo
mkdir yojimbo\tests
copy ..\*.h yojimbo
copy ..\*.cpp yojimbo
copy ..\tests\*.* yojimbo\tests
copy ..\premake5.lua libyojimbo
robocopy /MIR /DCOPY:T ..\tlsf libyojimbo\tlsf
robocopy /MIR /DCOPY:T ..\tlsf yojimbo\tlsf
REM because robocopy sometimes sets non-zero error codes on successful operation. what the actual fuck windows
cmd /c "exit /b 0"
View
@@ -1,5 +1,5 @@
libyojimbo_version = "0.5.0"
yojimbo_version = "0.5.0"
if os.is "windows" then
debug_libs = { "sodium-debug", "mbedtls-debug", "mbedx509-debug", "mbedcrypto-debug" }
@@ -148,10 +148,19 @@ if not os.is "windows" then
description = "Build and run a yojimbo server inside a docker container",
execute = function ()
os.execute "docker run --rm --privileged alpine hwclock -s" -- workaround for clock getting out of sync on macos. see https://docs.docker.com/docker-for-mac/troubleshoot/#issues
os.execute "rm -rf docker/libyojimbo && mkdir -p docker/libyojimbo && mkdir -p docker/libyojimbo/tests && cp *.h docker/libyojimbo && cp *.cpp docker/libyojimbo && cp premake5.lua docker/libyojimbo && cp tests/* docker/libyojimbo/tests && cp -R reliable.io docker/libyojimbo && cp -R netcode.io docker/libyojimbo && cp -R tlsf docker/libyojimbo && cd docker && docker build -t \"networkprotocol:yojimbo-server\" . && rm -rf libyojimbo && docker run -ti -p 40000:40000/udp networkprotocol:yojimbo-server"
os.execute "rm -rf docker/yojimbo && mkdir -p docker/yojimbo && mkdir -p docker/yojimbo/tests && cp *.h docker/yojimbo && cp *.cpp docker/yojimbo && cp premake5.lua docker/yojimbo && cp tests/* docker/yojimbo/tests && cp -R reliable.io docker/yojimbo && cp -R netcode.io docker/yojimbo && cp -R tlsf docker/yojimbo && cd docker && docker build -t \"networkprotocol:yojimbo-server\" . && rm -rf yojimbo && docker run -ti -p 40000:40000/udp networkprotocol:yojimbo-server"
end
}
newaction
{
trigger = "valgrind",
description = "Run valgrind over tests inside docker",
execute = function ()
os.execute "rm -rf valgrind/yojimbo && mkdir -p valgrind/yojimbo && mkdir -p valgrind/yojimbo/tests && cp *.h valgrind/yojimbo && cp *.cpp valgrind/yojimbo && cp premake5.lua valgrind/yojimbo && cp tests/* valgrind/yojimbo/tests && cp -R reliable.io valgrind/yojimbo && cp -R netcode.io valgrind/yojimbo && cp -R tlsf valgrind/yojimbo && cd valgrind && docker build -t \"networkprotocol:yojimbo-valgrind\" . && rm -rf netcode.io && docker run -ti networkprotocol:yojimbo-valgrind"
end
}
newaction
{
trigger = "matcher",
@@ -246,16 +255,16 @@ if not os.is "windows" then
files_to_zip = "README.md BUILDING.md CHANGES.md ROADMAP.md *.cpp *.h premake5.lua docker tests tlsf windows"
-- todo: need to update this so it works with netcode.io and reliable.io sub-projects
os.execute( "rm -rf *.zip *.tar.gz" );
os.execute( "rm -rf docker/libyojimbo" );
os.execute( "zip -9r libyojimbo-" .. libyojimbo_version .. ".zip " .. files_to_zip )
os.execute( "unzip libyojimbo-" .. libyojimbo_version .. ".zip -d libyojimbo-" .. libyojimbo_version );
os.execute( "tar -zcvf libyojimbo-" .. libyojimbo_version .. ".tar.gz libyojimbo-" .. libyojimbo_version );
os.execute( "rm -rf libyojimbo-" .. libyojimbo_version );
os.execute( "rm -rf docker/yojimbo" );
os.execute( "zip -9r yojimbo-" .. yojimbo_version .. ".zip " .. files_to_zip )
os.execute( "unzip yojimbo-" .. yojimbo_version .. ".zip -d yojimbo-" .. yojimbo_version );
os.execute( "tar -zcvf yojimbo-" .. yojimbo_version .. ".tar.gz yojimbo-" .. yojimbo_version );
os.execute( "rm -rf yojimbo-" .. yojimbo_version );
os.execute( "mkdir -p release" );
os.execute( "mv libyojimbo-" .. libyojimbo_version .. ".zip release" );
os.execute( "mv libyojimbo-" .. libyojimbo_version .. ".tar.gz release" );
os.execute( "mv yojimbo-" .. yojimbo_version .. ".zip release" );
os.execute( "mv yojimbo-" .. yojimbo_version .. ".tar.gz release" );
os.execute( "echo" );
os.execute( "echo \"*** SUCCESSFULLY CREATED RELEASE - libyojimbo-" .. libyojimbo_version .. " *** \"" );
os.execute( "echo \"*** SUCCESSFULLY CREATED RELEASE - yojimbo-" .. yojimbo_version .. " *** \"" );
os.execute( "echo" );
end
}
@@ -372,7 +381,8 @@ newaction
"Release",
"release",
"cov-int",
"docker/libyojimbo",
"docker/yojimbo",
"valgrind/yojimbo",
"docs",
"xml"
}
View
@@ -0,0 +1,37 @@
FROM phusion/baseimage:0.9.18
CMD ["/sbin/my_init"]
WORKDIR /app
RUN apt-get -y update && apt-get install -y wget make g++ dh-autoreconf pkg-config valgrind cmake
RUN wget https://github.com/jedisct1/libsodium/releases/download/1.0.10/libsodium-1.0.10.tar.gz && \
tar -zxvf libsodium-1.0.10.tar.gz && \
cd libsodium-1.0.10 && \
./configure && \
make && make check && \
make install && \
cd .. && \
rm -rf libsodium* && \
ldconfig
RUN wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha10/premake-5.0.0-alpha10-linux.tar.gz && \
tar -zxvf premake-*.tar.gz && \
rm premake-*.tar.gz && \
mv premake5 /usr/local/bin
RUN wget https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.1.5.tar.gz && \
tar -zxvf mbedtls-2.1.5.tar.gz && \
cd mbedtls-mbedtls-2.1.5 && \
cmake . && \
make && make install && \
ldconfig
ADD yojimbo /app/yojimbo
RUN cd yojimbo && find . -exec touch {} \; && premake5 gmake && make -j32 test && make -j32 soak && cp ./bin/* /app
CMD [ "valgrind", "--tool=memcheck", "--leak-check=yes", "--show-reachable=yes", "--num-callers=20", "--track-fds=yes", "--track-origins=yes", "./test" ]
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

0 comments on commit 7378fea

Please sign in to comment.