2

I have an application written in c++ and tests for it. Partially written on c++ and partially on python.
With c++ tests everything is clear. How I can run python based tests in the same build phase?
The following code does not run my python file with tests.

def build(bld):
    bld(features="test", rule="touch ${SRC}", source="main.py")

    ## printing test results to output
    from waflib.Tools import waf_unit_test

    bld.add_post_fun(waf_unit_test.summary)
Amit Yadav
  • 4,422
  • 5
  • 34
  • 79
denys
  • 2,437
  • 6
  • 31
  • 55

1 Answers1

0

You want the test_scripts feature:

def build(bld):
    bld(features='test_scripts',
        rule='touch ${SRC}',
        test_scripts_source = 'main.py',
        test_scripts_template = 'python ${SCRIPT}',
        source='main.py')

     from waflib.Tools import waf_unit_test
     bld.add_post_fun(waf_unit_test.summary)