mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-03-11 13:31:03 +00:00
wscript: refactoring, replace --enable-fs-tests with --enable-tests
* Run filesystem tests in sequential order, to avoid tests being run before filesystem_stdio DLL is linked * Include new interface test in filesystem
This commit is contained in:
parent
db40d58208
commit
d86ab19351
@ -1,12 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from waflib.Tools import waf_unit_test
|
|
||||||
|
|
||||||
def options(opt):
|
def options(opt):
|
||||||
grp = opt.add_option_group('filesystem_stdio options')
|
pass
|
||||||
|
|
||||||
grp.add_option('--enable-fs-tests', action='store_true', dest = 'FS_TESTS', default = False,
|
|
||||||
help = 'enable filesystem_stdio tests')
|
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
nortti = {
|
nortti = {
|
||||||
@ -15,8 +10,6 @@ def configure(conf):
|
|||||||
}
|
}
|
||||||
conf.env.append_unique('CXXFLAGS', conf.get_flags_by_compiler(nortti, conf.env.COMPILER_CC))
|
conf.env.append_unique('CXXFLAGS', conf.get_flags_by_compiler(nortti, conf.env.COMPILER_CC))
|
||||||
|
|
||||||
conf.env.FS_TESTS = conf.options.FS_TESTS
|
|
||||||
|
|
||||||
if conf.env.DEST_OS != 'android':
|
if conf.env.DEST_OS != 'android':
|
||||||
if conf.env.cxxshlib_PATTERN.startswith('lib'):
|
if conf.env.cxxshlib_PATTERN.startswith('lib'):
|
||||||
conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:]
|
conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:]
|
||||||
@ -32,21 +25,25 @@ def build(bld):
|
|||||||
libs += [ 'public' ]
|
libs += [ 'public' ]
|
||||||
|
|
||||||
bld.shlib(target = 'filesystem_stdio',
|
bld.shlib(target = 'filesystem_stdio',
|
||||||
features = 'cxx',
|
features = 'cxx seq',
|
||||||
source = bld.path.ant_glob(['*.c', '*.cpp']),
|
source = bld.path.ant_glob(['*.c', '*.cpp']),
|
||||||
use = libs,
|
use = libs,
|
||||||
install_path = bld.env.LIBDIR,
|
install_path = bld.env.LIBDIR,
|
||||||
subsystem = bld.env.MSVC_SUBSYSTEM)
|
subsystem = bld.env.MSVC_SUBSYSTEM)
|
||||||
|
|
||||||
if bld.env.FS_TESTS:
|
if bld.env.TESTS:
|
||||||
# build in same module, so dynamic linking will work
|
# build in same module, so dynamic linking will work
|
||||||
# for now (until we turn libpublic to shared module lol)
|
# for now (until we turn libpublic to shared module lol)
|
||||||
bld.program(features = 'test',
|
tests = {
|
||||||
source = 'tests/caseinsensitive.c',
|
'caseinsensitive' : 'tests/caseinsensitive.c',
|
||||||
target = 'test_caseinsensitive',
|
'interface' : 'tests/interface.cpp',
|
||||||
use = libs + [ 'DL' ],
|
}
|
||||||
rpath = '$ORIGIN',
|
|
||||||
subsystem = bld.env.CONSOLE_SUBSYSTEM,
|
for i in tests:
|
||||||
install_path = None)
|
bld.program(features = 'test seq',
|
||||||
bld.add_post_fun(waf_unit_test.summary)
|
source = tests[i],
|
||||||
bld.add_post_fun(waf_unit_test.set_exit_code)
|
target = 'test_%s' % i,
|
||||||
|
use = libs + ['DL'],
|
||||||
|
rpath = '$ORIGIN',
|
||||||
|
subsystem = bld.env.CONSOLE_SUBSYSTEM,
|
||||||
|
install_path = None)
|
||||||
|
9
wscript
9
wscript
@ -3,6 +3,7 @@
|
|||||||
# a1batross, mittorn, 2018
|
# a1batross, mittorn, 2018
|
||||||
|
|
||||||
from waflib import Build, Context, Logs
|
from waflib import Build, Context, Logs
|
||||||
|
from waflib.Tools import waf_unit_test
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -127,6 +128,9 @@ def options(opt):
|
|||||||
grp.add_option('--disable-werror', action = 'store_true', dest = 'DISABLE_WERROR', default = False,
|
grp.add_option('--disable-werror', action = 'store_true', dest = 'DISABLE_WERROR', default = False,
|
||||||
help = 'disable compilation abort on warning')
|
help = 'disable compilation abort on warning')
|
||||||
|
|
||||||
|
grp.add_option('--enable-tests', action = 'store_true', dest = 'TESTS', default = False,
|
||||||
|
help = 'enable building standalone tests (does not enable engine tests!) [default: %default]')
|
||||||
|
|
||||||
grp = opt.add_option_group('Renderers options')
|
grp = opt.add_option_group('Renderers options')
|
||||||
|
|
||||||
grp.add_option('--enable-all-renderers', action='store_true', dest='ALL_RENDERERS', default=False,
|
grp.add_option('--enable-all-renderers', action='store_true', dest='ALL_RENDERERS', default=False,
|
||||||
@ -325,6 +329,7 @@ def configure(conf):
|
|||||||
conf.env.append_unique('CFLAGS', cflags)
|
conf.env.append_unique('CFLAGS', cflags)
|
||||||
conf.env.append_unique('CXXFLAGS', cxxflags)
|
conf.env.append_unique('CXXFLAGS', cxxflags)
|
||||||
|
|
||||||
|
conf.env.TESTS = conf.options.TESTS
|
||||||
conf.env.ENABLE_UTILS = conf.options.ENABLE_UTILS
|
conf.env.ENABLE_UTILS = conf.options.ENABLE_UTILS
|
||||||
conf.env.ENABLE_FUZZER = conf.options.ENABLE_FUZZER
|
conf.env.ENABLE_FUZZER = conf.options.ENABLE_FUZZER
|
||||||
conf.env.DEDICATED = conf.options.DEDICATED
|
conf.env.DEDICATED = conf.options.DEDICATED
|
||||||
@ -466,3 +471,7 @@ def build(bld):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
bld.add_subproject(i.name)
|
bld.add_subproject(i.name)
|
||||||
|
|
||||||
|
if bld.env.TESTS:
|
||||||
|
bld.add_post_fun(waf_unit_test.summary)
|
||||||
|
bld.add_post_fun(waf_unit_test.set_exit_code)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user