From 77410b0cdde47219d6c6a36533fcb9354f17c3dd Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 6 Mar 2019 23:06:30 +0300 Subject: Use new setup for unit tests --- build2/buildfile | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'build2/buildfile') diff --git a/build2/buildfile b/build2/buildfile index bd730c3..64935f3 100644 --- a/build2/buildfile +++ b/build2/buildfile @@ -5,15 +5,33 @@ import libs = libbutl%lib{butl} import libs += libpkgconf%lib{pkgconf} -exe{b}: cxx{b} libue{b} +./: exe{b}: cxx{b} libue{b} -libue{b}: {hxx ixx txx cxx}{** -b -b-options -config -version} \ - {hxx ixx cxx}{b-options} {hxx}{config version} \ +libue{b}: {hxx ixx txx cxx}{** -b -b-options -config -version -**.test...} \ + {hxx ixx cxx}{b-options} {hxx}{config version} \ $libs hxx{config}: in{config} hxx{version}: in{version} $src_root/manifest +# Unit tests. +# +exe{*.test}: +{ + test = true + install = false +} + +for t: cxx{**.test...} +{ + d = $directory($t) + n = $name($t)... + b = $path.base($name($t)) + + ./: $d/exe{$n}: $t $d/{hxx ixx txx}{+$n} $d/testscript{+$n +$b+*.test...} + $d/exe{$n}: libue{b}: bin.whole = false +} + # Build options. # # Pass our compiler target to be used as build2 host. -- cgit v1.1