From 9e16772ce25364be7b025cf65d71d2224de9db02 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 5 Apr 2021 21:59:11 +0300 Subject: Add support for multi-language C/C++ projects in bdep-new --- tests/new.testscript | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 300 insertions(+) (limited to 'tests/new.testscript') diff --git a/tests/new.testscript b/tests/new.testscript index 1f5947d..4d98feb 100644 --- a/tests/new.testscript +++ b/tests/new.testscript @@ -33,6 +33,25 @@ status += -d prj EOE } + : exe-c++-c + : + { + $* -t exe -l c++,c foo 2>>/"EOE" &foo/***; + created new executable project foo in $~/foo/ + EOE + + touch foo/foo/bar.h; + + cat <=foo/foo/bar.c; + #include + int bar; + EOI + + $build foo/ $config_cxx $config_c 2>>~%EOE% + %(c\+\+|c|ld) .+%{3} + EOE + } + : lib : { @@ -45,6 +64,32 @@ status += -d prj EOE } + : lib-c++-c + : + { + $* -t lib -l c++,c libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + touch libfoo/libfoo/bar.h; + + cat <=libfoo/libfoo/bar.c; + #include + int bar; + EOI + + touch libfoo/tests/basics/fox.h; + + cat <=libfoo/tests/basics/fox.c; + #include + #include "fox.h" + EOI + + $build libfoo/ $config_cxx $config_c 2>>~%EOE% + %(version\.in|c\+\+|c|ld|ar) .+%{10} + EOE + } + : exe-prefix : { @@ -81,6 +126,34 @@ status += -d prj EOE } + : lib-split-c + : + { + $* -t lib,split -l c++,c libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + touch libfoo/include/libfoo/bar.h; + touch libfoo/src/libfoo/baz.h; + + cat <=libfoo/src/libfoo/bar.c; + #include + #include "baz.h" + int bar; + EOI + + touch libfoo/tests/basics/fox.h; + + cat <=libfoo/tests/basics/fox.c; + #include + #include "fox.h" + EOI + + $build libfoo/ $config_cxx $config_c 2>>~%EOE% + %(version\.in|c\+\+|c|ar|ld) .+%{10} + EOE + } + : lib-split-binless : { @@ -93,6 +166,26 @@ status += -d prj EOE } + : lib-split-binless-c + : + { + $* -t lib,split,binless -l c++,c libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + touch libfoo/include/libfoo/bar.h; + touch libfoo/tests/basics/fox.h; + + cat <=libfoo/tests/basics/fox.c; + #include + #include "fox.h" + EOI + + $build libfoo/ $config_cxx $config_c 2>>~%EOE% + %(version\.in|c\+\+|c|ld) .+%{4} + EOE + } + : lib-split-binless-unit-tests : { @@ -117,6 +210,34 @@ status += -d prj EOE } + # @@ TMP Disable until the 'multiple rules matching updating' error is fixed + # in build2. + # + #\ + : exe-unit-tests-c + : + { + $* -t exe,unit-tests -l c++,c foo 2>>/"EOE" &foo/***; + created new executable project foo in $~/foo/ + EOE + + touch foo/foo/bar.h; + + cat <=foo/foo/bar.c; + #include + int bar; + EOI + + cat <=foo/foo/bar.test.c; + #include + EOI + + $build foo/ $config_cxx $config_c 2>>~%EOE% + %(c\+\+|c|ld|ar) .+%{4} + EOE + } + #\ + : lib-unit-tests : { @@ -129,6 +250,34 @@ status += -d prj EOE } + # @@ TMP Disable until the 'multiple rules matching updating' error is fixed + # in build2. + # + #\ + : lib-unit-tests-c + : + { + $* -t lib,unit-tests -l c++,c libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + touch libfoo/libfoo/bar.h; + + cat <=libfoo/libfoo/bar.c; + #include + int bar; + EOI + + cat <=libfoo/libfoo/bar.test.c; + #include + EOI + + $build libfoo/ $config_cxx $config_c 2>>~%EOE% + %(version\.in|c\+\+|c|ar|ld) .+%{11} + EOE + } + #\ + : exe-alt-naming : { @@ -259,6 +408,25 @@ status += -d prj EOE } + : exe-c-c++ + : + { + $* -t exe -l c,c++ foo 2>>/"EOE" &foo/***; + created new executable project foo in $~/foo/ + EOE + + touch foo/foo/bar.hxx; + + cat <=foo/foo/bar.cxx; + #include + int bar; + EOI + + $build foo/ $config_c $config_cxx 2>>~%EOE% + %(c|c\+\+|ld) .+%{3} + EOE + } + : exe-c-prefix : { @@ -283,6 +451,34 @@ status += -d prj EOE } + # @@ TMP Disable until the 'multiple rules matching updating' error is fixed + # in build2. + # + #\ + : exe-c-unit-tests-c++ + : + { + $* -t exe,unit-tests -l c,c++ foo 2>>/"EOE" &foo/***; + created new executable project foo in $~/foo/ + EOE + + touch foo/foo/bar.hxx; + + cat <=foo/foo/bar.cxx; + #include + int bar; + EOI + + cat <=foo/foo/bar.test.cxx; + #include + EOI + + $build foo/ $config_c $config_cxx 2>>~%EOE% + %(c|c\+\+|ld|ar) .+%{4} + EOE + } + #\ + : lib-c : { @@ -295,6 +491,34 @@ status += -d prj EOE } + : lib-c-c++ + : + { + # While at it, also test the hxx/cxx sub-options. + # + $* -t lib -l c,c++,hxx=hpp,cxx=cpp libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + touch libfoo/libfoo/bar.hpp; + + cat <=libfoo/libfoo/bar.cpp; + #include + int bar; + EOI + + touch libfoo/tests/basics/fox.hpp; + + cat <=libfoo/tests/basics/fox.cpp; + #include + #include "fox.hpp" + EOI + + $build libfoo/ $config_c $config_cxx 2>>~%EOE% + %(version\.in|c|c\+\+|ld|ar) .+%{10} + EOE + } + : lib-c-binless : { @@ -331,6 +555,34 @@ status += -d prj EOE } + : lib-c-split-c++ + : + { + $* -t lib,split -l c,c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + touch libfoo/include/libfoo/bar.hxx; + touch libfoo/src/libfoo/baz.hxx; + + cat <=libfoo/src/libfoo/bar.cxx; + #include + #include "baz.hxx" + int bar; + EOI + + touch libfoo/tests/basics/fox.hxx; + + cat <=libfoo/tests/basics/fox.cxx; + #include + #include "fox.hxx" + EOI + + $build libfoo/ $config_c $config_cxx 2>>~%EOE% + %(version\.in|c|c\+\+|ar|ld) .+%{10} + EOE + } + : lib-c-split-binless : { @@ -343,6 +595,26 @@ status += -d prj EOE } + : lib-c-split-binless-c++ + : + { + $* -t lib,split,binless -l c,c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + touch libfoo/include/libfoo/bar.hxx; + touch libfoo/tests/basics/fox.hxx; + + cat <=libfoo/tests/basics/fox.cxx; + #include + #include "fox.hxx" + EOI + + $build libfoo/ $config_c $config_cxx 2>>~%EOE% + %(version\.in|c|c\+\+|ld) .+%{4} + EOE + } + : lib-c-split-binless-unit-tests : { @@ -367,6 +639,34 @@ status += -d prj EOE } + # @@ TMP Disable until the 'multiple rules matching updating' error is fixed + # in build2. + # + #\ + : lib-c-unit-tests-c++ + : + { + $* -t lib,unit-tests -l c,c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + touch libfoo/libfoo/bar.hxx; + + cat <=libfoo/libfoo/bar.cxx; + #include + int bar; + EOI + + cat <=libfoo/libfoo/bar.test.cxx; + #include + EOI + + $build libfoo/ $config_c $config_cxx 2>>~%EOE% + %(version\.in|c|c\+\+|ar|ld) .+%{11} + EOE + } + #\ + : lib-c-binless-unit-tests : { -- cgit v1.1