aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-12-26 21:29:09 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-01-02 23:52:50 +0200
commit74f15263b6a9d7fe1f717235a7177e7e4a681d3d (patch)
treec7a5619a6996f44a01716202adab950b7076d95c /test cases
parentee8a6e6fc5b58b5756f4e01271e77399f2d973bb (diff)
downloadmeson-74f15263b6a9d7fe1f717235a7177e7e4a681d3d.zip
meson-74f15263b6a9d7fe1f717235a7177e7e4a681d3d.tar.gz
meson-74f15263b6a9d7fe1f717235a7177e7e4a681d3d.tar.bz2
Can set envvars in test setups.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/unit/2 testsetups/buggy.c3
-rw-r--r--test cases/unit/2 testsetups/meson.build1
2 files changed, 4 insertions, 0 deletions
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')