mirror of
https://github.com/nillerusr/source-engine.git
synced 2024-12-22 06:06:50 +00:00
workflows: add tests.yml
This commit is contained in:
parent
9aa0ecab6a
commit
8b6ad0d342
42
.github/workflows/tests.yml
vendored
Normal file
42
.github/workflows/tests.yml
vendored
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
name: Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "*"
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests-linux-i386:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Run tests linux-i386
|
||||||
|
run: |
|
||||||
|
scripts/tests-ubuntu-i386.sh
|
||||||
|
|
||||||
|
tests-linux-amd64:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Run tests linux-amd64
|
||||||
|
run: |
|
||||||
|
scripts/tests-ubuntu-amd64.sh
|
||||||
|
|
||||||
|
tests-windows-i386:
|
||||||
|
runs-on: windows-2019
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Run tests windows-i386
|
||||||
|
run: |
|
||||||
|
git submodule init && git submodule update
|
||||||
|
./waf.bat configure -T release --tests --prefix=out/
|
||||||
|
./waf.bat install
|
||||||
|
cd out
|
||||||
|
$env:Path = "bin";
|
||||||
|
./unittest.exe
|
10
scripts/tests-ubuntu-amd64.sh
Executable file
10
scripts/tests-ubuntu-amd64.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
git submodule init && git submodule update
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -f -y gdb libopenal-dev g++-multilib gcc-multilib libpng-dev libjpeg-dev libfreetype6-dev libfontconfig1-dev libcurl4-gnutls-dev libsdl2-dev zlib1g-dev libbz2-dev libedit-dev
|
||||||
|
|
||||||
|
./waf configure -T release --disable-warns --tests --prefix=out/ --64bits $* &&
|
||||||
|
./waf install &&
|
||||||
|
cd out &&
|
||||||
|
LD_LIBRARY_PATH=. ./unittest
|
11
scripts/tests-ubuntu-i386.sh
Executable file
11
scripts/tests-ubuntu-i386.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
git submodule init && git submodule update
|
||||||
|
sudo dpkg --add-architecture i386
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -f -y libopenal-dev:i386 g++-multilib gcc-multilib libpng-dev:i386 libjpeg-dev:i386 libfreetype6-dev:i386 libfontconfig1-dev:i386 libcurl4-gnutls-dev:i386 libsdl2-dev:i386 zlib1g-dev:i386 libbz2-dev:i386 libedit-dev:i386
|
||||||
|
|
||||||
|
PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig ./waf configure -T release --disable-warns --tests --prefix=out/ $* &&
|
||||||
|
./waf install &&
|
||||||
|
cd out &&
|
||||||
|
LD_LIBRARY_PATH=. ./unittest
|
44
unitlib/wscript
Executable file
44
unitlib/wscript
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
#! /usr/bin/env python
|
||||||
|
# encoding: utf-8
|
||||||
|
|
||||||
|
from waflib import Utils
|
||||||
|
import os
|
||||||
|
|
||||||
|
top = '.'
|
||||||
|
PROJECT_NAME = 'unitlib'
|
||||||
|
|
||||||
|
def options(opt):
|
||||||
|
# stub
|
||||||
|
return
|
||||||
|
|
||||||
|
def configure(conf):
|
||||||
|
conf.env.append_unique('DEFINES', ['UNITLIB_DLL_EXPORT=1'])
|
||||||
|
|
||||||
|
def build(bld):
|
||||||
|
source = [
|
||||||
|
'unitlib.cpp'
|
||||||
|
]
|
||||||
|
|
||||||
|
includes = [
|
||||||
|
'.',
|
||||||
|
'../',
|
||||||
|
'../public',
|
||||||
|
'../public/tier1',
|
||||||
|
'../public/tier0',
|
||||||
|
'../common'
|
||||||
|
]
|
||||||
|
|
||||||
|
defines = []
|
||||||
|
libs = []
|
||||||
|
|
||||||
|
bld.shlib(
|
||||||
|
source = source,
|
||||||
|
target = PROJECT_NAME,
|
||||||
|
name = PROJECT_NAME,
|
||||||
|
features = 'c cxx',
|
||||||
|
includes = includes,
|
||||||
|
defines = defines,
|
||||||
|
use = libs,
|
||||||
|
subsystem = bld.env.MSVC_SUBSYSTEM,
|
||||||
|
idx = bld.get_taskgen_count()
|
||||||
|
)
|
@ -40,6 +40,7 @@ SpewRetval_t UnitTestSpew( SpewType_t type, char const *pMsg )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
printf( "%s", pMsg );
|
printf( "%s", pMsg );
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
if ( Sys_IsDebuggerPresent() )
|
if ( Sys_IsDebuggerPresent() )
|
||||||
return ( type == SPEW_ASSERT || type == SPEW_ERROR ) ? SPEW_DEBUGGER : SPEW_CONTINUE;
|
return ( type == SPEW_ASSERT || type == SPEW_ERROR ) ? SPEW_DEBUGGER : SPEW_CONTINUE;
|
||||||
|
@ -23,6 +23,7 @@ def build(bld):
|
|||||||
if bld.env.DEST_OS != 'win32':
|
if bld.env.DEST_OS != 'win32':
|
||||||
libs += [ 'DL', 'LOG' ]
|
libs += [ 'DL', 'LOG' ]
|
||||||
else:
|
else:
|
||||||
|
bld.env.LDFLAGS += ['/subsystem:console']
|
||||||
libs += ['USER32', 'SHELL32']
|
libs += ['USER32', 'SHELL32']
|
||||||
|
|
||||||
install_path = bld.env.BINDIR
|
install_path = bld.env.BINDIR
|
||||||
|
Loading…
Reference in New Issue
Block a user