From 74f15263b6a9d7fe1f717235a7177e7e4a681d3d Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 26 Dec 2016 21:29:09 +0200 Subject: Can set envvars in test setups. --- test cases/unit/2 testsetups/buggy.c | 3 +++ test cases/unit/2 testsetups/meson.build | 1 + 2 files changed, 4 insertions(+) (limited to 'test cases') diff --git a/test cases/unit/2 testsetups/buggy.c b/test cases/unit/2 testsetups/buggy.c index 1aa56f9..5d20a24 100644 --- a/test cases/unit/2 testsetups/buggy.c +++ b/test cases/unit/2 testsetups/buggy.c @@ -7,5 +7,8 @@ int main(int argc, char **argv) { char *ten = malloc(10); do_nasty(ten); free(ten); + if(getenv("TEST_ENV")) { + printf("TEST_ENV is set.\n"); + } return 0; } diff --git a/test cases/unit/2 testsetups/meson.build b/test cases/unit/2 testsetups/meson.build index f2295f5..23682a7 100644 --- a/test cases/unit/2 testsetups/meson.build +++ b/test cases/unit/2 testsetups/meson.build @@ -2,6 +2,7 @@ project('testsetups', 'c') vg = find_program('valgrind', required : false) +# This is only set when running under Valgrind test setup. env = environment() env.set('TEST_ENV', '1') -- cgit v1.1