tests: add reconfigure test, add shell script to run tests

This commit is contained in:
Alibek Omarov 2019-06-07 02:18:45 +03:00
parent 05432a020f
commit 3149e5793c
2 changed files with 40 additions and 0 deletions

20
run-tests.sh Normal file
View File

@ -0,0 +1,20 @@
#!/bin/bash
die()
{
exit 1
}
# build waf
./build-waf.sh
# install conan
python -m pip install pip --upgrade --user
pip install conan --user
# run tests
python waf-$1 configure build msdev clean || die
# reconfigure needs a special case
python waf-$1 -t tests/reconfigure -o build-reconfigure configure --test-option || die
python waf-$1 -t tests/reconfigure -o build-reconfigure configure --reconfigure || die

20
tests/reconfigure/wscript Normal file
View File

@ -0,0 +1,20 @@
#! /usr/bin/env python
# encoding: utf-8
# a1batross, 2019
VERSION = '1.0'
APPNAME = 'waifu-tests'
top = '.'
def options(opt):
opt.add_option('--test-option', default=False, dest='TEST_OPTION', action='store_true')
opt.load('reconfigure')
def configure(conf):
conf.load('reconfigure')
if not getattr(conf.options, 'TEST_OPTION', False):
raise Exception('TEST FAILED')
def build(bld):
pass