From 3149e5793c7cdada7f7b9e296e65ee9009aba4a9 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 7 Jun 2019 02:18:45 +0300 Subject: [PATCH] tests: add reconfigure test, add shell script to run tests --- run-tests.sh | 20 ++++++++++++++++++++ tests/reconfigure/wscript | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 run-tests.sh create mode 100644 tests/reconfigure/wscript diff --git a/run-tests.sh b/run-tests.sh new file mode 100644 index 0000000..4c99fb1 --- /dev/null +++ b/run-tests.sh @@ -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 diff --git a/tests/reconfigure/wscript b/tests/reconfigure/wscript new file mode 100644 index 0000000..860fa3b --- /dev/null +++ b/tests/reconfigure/wscript @@ -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