From 4f841757b84ddb2cf844252633dc2403569aa066 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 29 Aug 2018 15:41:07 +0200 Subject: Add unit-tests option to bdep-new If specified (-t exe,unit-tests or -t lib,unit-tests) then generate build infrastructure for unit testing. --- tests/new.test | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 3 deletions(-) (limited to 'tests/new.test') diff --git a/tests/new.test b/tests/new.test index 6ae37e4..ee53668 100644 --- a/tests/new.test +++ b/tests/new.test @@ -8,7 +8,8 @@ # test.arguments += --no-checks -cxx = "config.cxx=$config.cxx" +c = config.c="$recall($c.path)" +cxx = config.cxx="$recall($cxx.path)" status += -d prj @@ -21,7 +22,7 @@ status += -d prj : exe { - $* --no-amalgamation -t exe -l c++ prj-foo 2>>/"EOE" &prj-foo/***; + $* -t exe -l c++ prj-foo 2>>/"EOE" &prj-foo/***; created new executable project prj-foo in $~/prj-foo/ EOE @@ -30,9 +31,20 @@ status += -d prj EOE } + : exe-c + { + $* -t exe -l c prj-foo 2>>/"EOE" &prj-foo/***; + created new executable project prj-foo in $~/prj-foo/ + EOE + + $build prj-foo/ $c 2>>~%EOE% + %(c|ld) .+%{2} + EOE + } + : lib { - $* --no-amalgamation -t lib -l c++ libprj-foo 2>>/"EOE" &libprj-foo/***; + $* -t lib -l c++ libprj-foo 2>>/"EOE" &libprj-foo/***; created new library project libprj-foo in $~/libprj-foo/ EOE @@ -41,6 +53,61 @@ status += -d prj EOE } + : lib-c + { + $* -t lib -l c libprj-foo 2>>/"EOE" &libprj-foo/***; + created new library project libprj-foo in $~/libprj-foo/ + EOE + + $build libprj-foo/ $c 2>>~%EOE% + %(version\.in|c|ar|ld) .+%{7} + EOE + } + + : exe-unit-tests + { + $* -t exe,unit-tests -l c++ foo 2>>/"EOE" &foo/***; + created new executable project foo in $~/foo/ + EOE + + $build foo/ $cxx 2>>~%EOE% + %(c\+\+|ld|ar) .+%{5} + EOE + } + + : exe-c-unit-tests + { + $* -t exe,unit-tests -l c foo 2>>/"EOE" &foo/***; + created new executable project foo in $~/foo/ + EOE + + $build foo/ $c 2>>~%EOE% + %(c|ld|ar) .+%{5} + EOE + } + + : lib-unit-tests + { + $* -t lib,unit-tests -l c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + $build libfoo/ $cxx 2>>~%EOE% + %(version\.in|c\+\+|ar|ld) .+%{11} + EOE + } + + : lib-c-unit-tests + { + $* -t lib,unit-tests -l c libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + $build libfoo/ $c 2>>~%EOE% + %(version\.in|c|ar|ld) .+%{11} + EOE + } + : pkg : { -- cgit v1.1