diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2023-11-02 22:38:27 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2023-11-09 16:07:15 +0300 |
commit | 69115d2d8a35dfb22b1858b9b956ced2048b78e3 (patch) | |
tree | c2f28d52198b537c50ce61d076877d8ea285ef57 /tests | |
parent | a52f444c25a558947d8ecea1642e09c92867c280 (diff) |
Add support for buildfile-in-prefix sub-option for lib and exe project types in bdep-new
Diffstat (limited to 'tests')
-rw-r--r-- | tests/new.testscript | 1358 |
1 files changed, 1227 insertions, 131 deletions
diff --git a/tests/new.testscript b/tests/new.testscript index d8c0b9c..82d41f5 100644 --- a/tests/new.testscript +++ b/tests/new.testscript @@ -14,6 +14,10 @@ config_cxx = [cmdline] config.cxx=$quote($recall($cxx.path) $cxx.config.mode, tr status += -d prj +b = [cmdline] $build +t = [cmdline] $build test: +i = [cmdline] $build install: config.install.root=./install &install/*** + : no-cfg : { @@ -31,9 +35,19 @@ status += -d prj sed -n -e 's/^(type: .+)$/\1/p' prj-foo/manifest >:''; sed -n -e 's/^language: (.+)$/\1/p' prj-foo/manifest >'c++'; - $build prj-foo/ $config_cxx 2>>~%EOE% + $b prj-foo/ $config_cxx 2>>~%EOE%; %(c\+\+|ld) .+%{2} EOE + + $t prj-foo/ $config_cxx 2>>~%EOE%; + %test .+% + EOE + + $i prj-foo/ $config_cxx 2>>/~%EOE% + %.* + install prj-foo/prj-foo/exe{prj-foo} -> install/bin/ + %.* + EOE } : exe-lib-prefix @@ -46,11 +60,19 @@ status += -d prj sed -n -e 's/^type: (.+)$/\1/p' libprj-foo/manifest >'exe'; - $build libprj-foo/ $config_cxx 2>>~%EOE% + $b libprj-foo/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{2} EOE } + : exe-buildfile-in-prefix + : + { + $* -t exe,buildfile-in-prefix -l c++ prj-foo 2>>EOE != 0 + error: --type|-t,buildfile-in-prefix requires both source prefix and source subdirectory + EOE + } + : exe-c++-suffix : { @@ -60,7 +82,7 @@ status += -d prj sed -n -e 's/^(language: .+)$/\1/p' foo.c++/manifest >:''; - $build foo.c++/ $config_cxx 2>>~%EOE% + $b foo.c++/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{2} EOE } @@ -84,7 +106,7 @@ status += -d prj int bar; EOI - $build foo/ $config_cxx $config_c 2>>~%EOE% + $b foo/ $config_cxx $config_c 2>>~%EOE% %(c\+\+|c|ld) .+%{3} EOE } @@ -98,9 +120,19 @@ status += -d prj sed -n -e 's/^(type: .+)$/\1/p' libprj-foo/manifest >:''; - $build libprj-foo/ $config_cxx 2>>~%EOE% + $b libprj-foo/ $config_cxx 2>>~%EOE%; %(version|c\+\+|ar|ld) .+%{7} EOE + + $t libprj-foo/ $config_cxx 2>>~%EOE%; + %test .+% + EOE + + $i libprj-foo/ $config_cxx 2>>/~%EOE% + %.* + install libprj-foo/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %.* + EOE } : lib-no-lib-prefix @@ -113,11 +145,19 @@ status += -d prj sed -n -e 's/^type: (.+)$/\1/p' prj-foo/manifest >'lib'; - $build prj-foo/ $config_cxx 2>>~%EOE% + $b prj-foo/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } + : lib-buildfile-in-prefix + : + { + $* -t lib,buildfile-in-prefix -l c++ libprj-foo 2>>EOE != 0 + error: --type|-t,buildfile-in-prefix requires both source prefix and source subdirectory + EOE + } + : lib-c++-c : { @@ -139,7 +179,7 @@ status += -d prj #include "fox.h" EOI - $build libfoo/ $config_cxx $config_c 2>>~%EOE% + $b libfoo/ $config_cxx $config_c 2>>~%EOE% %(version|c\+\+|c|ld|ar) .+%{10} EOE } @@ -161,11 +201,42 @@ status += -d prj created new executable project prj-foo in $~/prj-foo/ EOE - $build prj-foo/ $config_cxx 2>>~%EOE% + $b prj-foo/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{2} EOE } + : exe-prefix-buildfile-in-prefix + : + { + $* -t exe,prefix=src,subdir=prj/foo,buildfile-in-prefix -l c++ prj-foo 2>>/"EOE" &prj-foo/***; + created new executable project prj-foo in $~/prj-foo/ + EOE + + $b prj-foo/ $config_cxx 2>>/~%EOE%; + c++ prj-foo/src/prj/foo/cxx{prj-foo} -> prj-foo/src/prj/foo/obje{prj-foo} + ld prj-foo/src/exe{prj-foo} + EOE + + $t prj-foo/ $config_cxx 2>>~%EOE%; + %test .+% + EOE + + $i prj-foo/ $config_cxx 2>>/~%EOE% + %.* + install prj-foo/src/exe{prj-foo} -> install/bin/ + %.* + EOE + } + + : exe-prefix-no-subdir-buildfile-in-prefix + : + { + $* -t exe,prefix=src,no-subdir,buildfile-in-prefix -l c++ prj-foo 2>>EOE != 0 + error: --type|-t,buildfile-in-prefix requires both source prefix and source subdirectory + EOE + } + : lib-prefix : { @@ -173,11 +244,55 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $config_cxx 2>>~%EOE% + $b libprj-foo/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } + : lib-prefix-buildfile-in-prefix + : + { + $* -t lib,prefix=src,buildfile-in-prefix -l c++ libprj-foo 2>>/"EOE" &libprj-foo/***; + created new library project libprj-foo in $~/libprj-foo/ + EOE + + $b libprj-foo/ $config_cxx 2>>/~%EOE%; + %.* + version libprj-foo/src/libprj-foo/in{version} -> libprj-foo/src/libprj-foo/hxx{version} + %.* + c++ libprj-foo/src/libprj-foo/cxx{prj-foo} -> libprj-foo/src/libprj-foo/objs{prj-foo} + %.* + ld libprj-foo/src/libs{prj-foo} + %.* + EOE + + $t libprj-foo/ $config_cxx 2>>~%EOE%; + %test .+% + EOE + + $i libprj-foo/ $config_cxx 2>>/~%EOE% + %.* + %( + install libprj-foo/src/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %.* + install libprj-foo/src/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %| + install libprj-foo/src/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %.* + install libprj-foo/src/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %) + %.* + EOE + } + + : lib-prefix-no-subdir-buildfile-in-prefix + : + { + $* -t lib,prefix=src,no-subdir,buildfile-in-prefix,no-version -l c++ libprj-foo 2>>EOE != 0 + error: --type|-t,buildfile-in-prefix requires both source prefix and source subdirectory + EOE + } + : lib-split : { @@ -185,8 +300,68 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $config_cxx 2>>~%EOE% - %(version|c\+\+|ar|ld) .+%{7} + $b libprj-foo/ $config_cxx 2>>/~%EOE%; + %.* + version libprj-foo/include/libprj-foo/in{version} -> libprj-foo/include/libprj-foo/hxx{version} + %.* + c++ libprj-foo/src/libprj-foo/cxx{prj-foo} -> libprj-foo/src/libprj-foo/objs{prj-foo} + %.* + ld libprj-foo/src/libprj-foo/libs{prj-foo} + %.* + EOE + + $t libprj-foo/ $config_cxx 2>>~%EOE%; + %test .+% + EOE + + $i libprj-foo/ $config_cxx 2>>/~%EOE% + %.* + %( + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %| + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %) + %.* + EOE + } + + : lib-split-buildfile-in-prefix + : + { + $* -t lib,split,buildfile-in-prefix -l c++ libprj-foo 2>>/"EOE" &libprj-foo/***; + created new library project libprj-foo in $~/libprj-foo/ + EOE + + $b libprj-foo/ $config_cxx 2>>/~%EOE%; + %.* + version libprj-foo/include/libprj-foo/in{version} -> libprj-foo/include/libprj-foo/hxx{version} + %.* + c++ libprj-foo/src/libprj-foo/cxx{prj-foo} -> libprj-foo/src/libprj-foo/objs{prj-foo} + %.* + ld libprj-foo/src/libs{prj-foo} + %.* + EOE + + $t libprj-foo/ $config_cxx 2>>~%EOE%; + %test .+% + EOE + + $i libprj-foo/ $config_cxx 2>>/~%EOE% + %.* + %( + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %| + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %) + %.* EOE } @@ -213,7 +388,7 @@ status += -d prj #include "fox.h" EOI - $build libfoo/ $config_cxx $config_c 2>>~%EOE% + $b libfoo/ $config_cxx $config_c 2>>~%EOE% %(version|c\+\+|c|ar|ld) .+%{10} EOE } @@ -225,8 +400,60 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $config_cxx 2>>~%EOE% - %(version|c\+\+|ld) .+%{3} + $b libprj-foo/ $config_cxx 2>>/~%EOE%; + version libprj-foo/include/libprj-foo/in{version} -> libprj-foo/include/libprj-foo/hxx{version} + c++ libprj-foo/tests/basics/cxx{driver} -> libprj-foo/tests/basics/obje{driver} + ld libprj-foo/tests/basics/exe{driver} + EOE + + $t libprj-foo/ $config_cxx 2>>~%EOE%; + %test .+% + EOE + + $i libprj-foo/ $config_cxx 2>>/~%EOE% + %.* + %( + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %| + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %) + %.* + EOE + } + + : lib-split-binless-buildfile-in-prefix + : + { + $* -t lib,split,binless,buildfile-in-prefix -l c++ libprj-foo 2>>/"EOE" &libprj-foo/***; + created new library project libprj-foo in $~/libprj-foo/ + EOE + + $b libprj-foo/ $config_cxx 2>>/~%EOE%; + version libprj-foo/include/libprj-foo/in{version} -> libprj-foo/include/libprj-foo/hxx{version} + c++ libprj-foo/tests/basics/cxx{driver} -> libprj-foo/tests/basics/obje{driver} + ld libprj-foo/tests/basics/exe{driver} + EOE + + $t libprj-foo/ $config_cxx 2>>~%EOE%; + %test .+% + EOE + + $i libprj-foo/ $config_cxx 2>>/~%EOE% + %.* + %( + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %| + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %) + %.* EOE } @@ -245,7 +472,7 @@ status += -d prj #include "fox.h" EOI - $build libfoo/ $config_cxx $config_c 2>>~%EOE% + $b libfoo/ $config_cxx $config_c 2>>~%EOE% %(version|c\+\+|c|ld) .+%{4} EOE } @@ -257,8 +484,68 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $config_cxx 2>>~%EOE% - %(version|c\+\+|ld) .+%{5} + $b libprj-foo/ $config_cxx 2>>/~%EOE%; + %.* + version libprj-foo/include/libprj-foo/in{version} -> libprj-foo/include/libprj-foo/hxx{version} + %.* + c++ libprj-foo/src/libprj-foo/cxx{prj-foo.test} -> libprj-foo/src/libprj-foo/obje{prj-foo.test} + %.* + ld libprj-foo/src/libprj-foo/exe{prj-foo.test} + %.* + EOE + + $t libprj-foo/ $config_cxx 2>>~%EOE%; + %test .+%{2} + EOE + + $i libprj-foo/ $config_cxx 2>>/~%EOE% + %.* + %( + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %| + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %) + %.* + EOE + } + + : lib-split-binless-unit-tests-buildfile-in-prefix + : + { + $* -t lib,split,binless,unit-tests,buildfile-in-prefix -l c++ libprj-foo 2>>/"EOE" &libprj-foo/***; + created new library project libprj-foo in $~/libprj-foo/ + EOE + + $b libprj-foo/ $config_cxx 2>>/~%EOE%; + %.* + version libprj-foo/include/libprj-foo/in{version} -> libprj-foo/include/libprj-foo/hxx{version} + %.* + c++ libprj-foo/src/libprj-foo/cxx{prj-foo.test} -> libprj-foo/src/libprj-foo/obje{prj-foo.test} + %.* + ld libprj-foo/src/libprj-foo/exe{prj-foo.test} + %.* + EOE + + $t libprj-foo/ $config_cxx 2>>~%EOE%; + %test .+%{2} + EOE + + $i libprj-foo/ $config_cxx 2>>/~%EOE% + %.* + %( + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %| + install libprj-foo/include/libprj-foo/hxx{version} -> install/include/libprj-foo/ + %.* + install libprj-foo/include/libprj-foo/hxx{prj-foo} -> install/include/libprj-foo/ + %) + %.* EOE } @@ -269,7 +556,19 @@ status += -d prj created new executable project foo in $~/foo/ EOE - $build foo/ $config_cxx 2>>~%EOE% + $b foo/ $config_cxx 2>>~%EOE% + %(c\+\+|ld|ar) .+%{5} + EOE + } + + : exe-unit-tests-buildfile-in-prefix + : + { + $* -t exe,prefix=src/bar,subdir=prj,unit-tests,buildfile-in-prefix -l c++ foo 2>>/"EOE" &foo/***; + created new executable project foo in $~/foo/ + EOE + + $b foo/ $config_cxx 2>>~%EOE% %(c\+\+|ld|ar) .+%{5} EOE } @@ -297,7 +596,7 @@ status += -d prj } EOI - $build foo/ $config_cxx $config_c 2>>~%EOE% + $b foo/ $config_cxx $config_c 2>>~%EOE% %(c\+\+|c|ld|ar) .+%{8} EOE } @@ -309,7 +608,19 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_cxx 2>>~%EOE% + $b libfoo/ $config_cxx 2>>~%EOE% + %(version|c\+\+|ar|ld) .+%{11} + EOE + } + + : lib-unit-tests-buildfile-in-prefix + : + { + $* -t lib,prefix=src,unit-tests,buildfile-in-prefix -l c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + $b libfoo/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{11} EOE } @@ -337,7 +648,7 @@ status += -d prj } EOI - $build libfoo/ $config_cxx $config_c 2>>~%EOE% + $b libfoo/ $config_cxx $config_c 2>>~%EOE% %(version|c\+\+|c|ar|ld) .+%{15} EOE } @@ -349,7 +660,7 @@ status += -d prj created new executable project foo in $~/foo/ EOE - $build foo/ $config_cxx 2>>~%EOE% + $b foo/ $config_cxx 2>>~%EOE% %(c\+\+|ld|ar) .+%{5} EOE } @@ -361,7 +672,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_cxx 2>>~%EOE% + $b libfoo/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{11} EOE } @@ -390,7 +701,7 @@ status += -d prj %.* EOE - $build foo/ $config_cxx 2>>~%EOE% + $b foo/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{2} EOE } @@ -404,7 +715,7 @@ status += -d prj test -f foo/README.md == 1; - $build foo/ $config_cxx 2>>~%EOE% + $b foo/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{2} EOE } @@ -417,7 +728,19 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_cxx 2>>~%EOE% + $b libfoo/ $config_cxx 2>>~%EOE% + %(c\+\+|ar|ld) .+%{10} + EOE + } + + : lib-no-version-buildfile-in-prefix + : + { + $* -t lib,prefix=src,unit-tests,no-version,buildfile-in-prefix -l c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + $b libfoo/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{10} EOE } @@ -429,8 +752,60 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_cxx 2>>~%EOE% - %(version|c\+\+|ld) .+%{3} + $b libfoo/ $config_cxx 2>>/~%EOE%; + version libfoo/libfoo/in{version} -> libfoo/libfoo/hxx{version} + c++ libfoo/tests/basics/cxx{driver} -> libfoo/tests/basics/obje{driver} + ld libfoo/tests/basics/exe{driver} + EOE + + $t libfoo/ $config_cxx 2>>~%EOE%; + %test .+% + EOE + + $i libfoo/ $config_cxx 2>>/~%EOE% + %.* + %( + install libfoo/libfoo/hxx{foo} -> install/include/libfoo/ + %.* + install libfoo/libfoo/hxx{version} -> install/include/libfoo/ + %| + install libfoo/libfoo/hxx{version} -> install/include/libfoo/ + %.* + install libfoo/libfoo/hxx{foo} -> install/include/libfoo/ + %) + %.* + EOE + } + + : lib-binless-buildfile-in-prefix + : + { + $* -t lib,prefix=src,binless,buildfile-in-prefix -l c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + $b libfoo/ $config_cxx 2>>/~%EOE%; + version libfoo/src/libfoo/in{version} -> libfoo/src/libfoo/hxx{version} + c++ libfoo/tests/basics/cxx{driver} -> libfoo/tests/basics/obje{driver} + ld libfoo/tests/basics/exe{driver} + EOE + + $t libfoo/ $config_cxx 2>>~%EOE%; + %test .+% + EOE + + $i libfoo/ $config_cxx 2>>/~%EOE% + %.* + %( + install libfoo/src/libfoo/hxx{foo} -> install/include/libfoo/ + %.* + install libfoo/src/libfoo/hxx{version} -> install/include/libfoo/ + %| + install libfoo/src/libfoo/hxx{version} -> install/include/libfoo/ + %.* + install libfoo/src/libfoo/hxx{foo} -> install/include/libfoo/ + %) + %.* EOE } @@ -441,8 +816,68 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_cxx 2>>~%EOE% - %(version|c\+\+|ld) .+%{5} + $b libfoo/ $config_cxx 2>>/~%EOE%; + %.* + version libfoo/libfoo/in{version} -> libfoo/libfoo/hxx{version} + %.* + c++ libfoo/libfoo/cxx{foo.test} -> libfoo/libfoo/obje{foo.test} + %.* + ld libfoo/libfoo/exe{foo.test} + %.* + EOE + + $t libfoo/ $config_cxx 2>>~%EOE%; + %test .+%{2} + EOE + + $i libfoo/ $config_cxx 2>>/~%EOE% + %.* + %( + install libfoo/libfoo/hxx{foo} -> install/include/libfoo/ + %.* + install libfoo/libfoo/hxx{version} -> install/include/libfoo/ + %| + install libfoo/libfoo/hxx{version} -> install/include/libfoo/ + %.* + install libfoo/libfoo/hxx{foo} -> install/include/libfoo/ + %) + %.* + EOE + } + + : lib-binless-unit-tests-buildfile-in-prefix + : + { + $* -t lib,prefix=src,unit-tests,binless -l c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + $b libfoo/ $config_cxx 2>>/~%EOE%; + %.* + version libfoo/src/libfoo/in{version} -> libfoo/src/libfoo/hxx{version} + %.* + c++ libfoo/src/libfoo/cxx{foo.test} -> libfoo/src/libfoo/obje{foo.test} + %.* + ld libfoo/src/libfoo/exe{foo.test} + %.* + EOE + + $t libfoo/ $config_cxx 2>>~%EOE%; + %test .+%{2} + EOE + + $i libfoo/ $config_cxx 2>>/~%EOE% + %.* + %( + install libfoo/src/libfoo/hxx{foo} -> install/include/libfoo/ + %.* + install libfoo/src/libfoo/hxx{version} -> install/include/libfoo/ + %| + install libfoo/src/libfoo/hxx{version} -> install/include/libfoo/ + %.* + install libfoo/src/libfoo/hxx{foo} -> install/include/libfoo/ + %) + %.* EOE } @@ -453,7 +888,19 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $config_cxx 2>>~%EOE% + $b libprj-foo/ $config_cxx 2>>~%EOE% + %(version|c\+\+|ar|ld) .+%{7} + EOE + } + + : lib-alt-subdir-buildfile-in-prefix + : + { + $* -l c++ -t lib,prefix-include=include,prefix-source=src/foo/bar,subdir=libprj/foo libprj-foo 2>>/"EOE" &libprj-foo/***; + created new library project libprj-foo in $~/libprj-foo/ + EOE + + $b libprj-foo/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -466,11 +913,11 @@ status += -d prj EOE if $posix - $build libfoo/ $config_cxx 2>>~%EOE% + $b libfoo/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE else - $build 'clean:' libfoo/ 2>>~%EOE% + $b 'clean:' libfoo/ 2>>~%EOE% %info: .+ is clean% EOE end @@ -486,7 +933,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_cxx 2>>~%EOE%; + $b libfoo/ $config_cxx 2>>~%EOE%; %(version|c\+\+|ar|ld|def) .+%{9,10} EOE @@ -495,6 +942,22 @@ status += -d prj end } + : basics-buildfile-in-prefix + : + { + $* -t lib,prefix=src,auto-symexport,buildfile-in-prefix -l c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + $b libfoo/ $config_cxx 2>>~%EOE%; + %(version|c\+\+|ar|ld|def) .+%{9,10} + EOE + + if ($cxx.target.system == 'win32-msvc') + test -f libfoo/src/foo.def + end + } + : unit-tests : { @@ -502,9 +965,29 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_cxx 2>>~%EOE% + $b libfoo/ $config_cxx 2>>~%EOE%; %(version|c\+\+|ar|ld|def) .+%{11,12} EOE + + if ($cxx.target.system == 'win32-msvc') + test -f libfoo/libfoo/foo.def + end + } + + : unit-tests-buildfile-in-prefix + : + { + $* -t lib,prefix=src,auto-symexport,unit-tests,buildfile-in-prefix -l c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + $b libfoo/ $config_cxx 2>>~%EOE%; + %(version|c\+\+|ar|ld|def) .+%{11,12} + EOE + + if ($cxx.target.system == 'win32-msvc') + test -f libfoo/src/foo.def + end } : split @@ -514,9 +997,29 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_cxx 2>>~%EOE% + $b libfoo/ $config_cxx 2>>~%EOE%; %(version|c\+\+|ar|ld|def) .+%{9,10} EOE + + if ($cxx.target.system == 'win32-msvc') + test -f libfoo/src/libfoo/foo.def + end + } + + : split-buildfile-in-prefix + : + { + $* -t lib,auto-symexport,split,buildfile-in-prefix -l c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + $b libfoo/ $config_cxx 2>>~%EOE%; + %(version|c\+\+|ar|ld|def) .+%{9,10} + EOE + + if ($cxx.target.system == 'win32-msvc') + test -f libfoo/src/foo.def + end } : unit-tests-split @@ -526,9 +1029,300 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_cxx 2>>~%EOE% + $b libfoo/ $config_cxx 2>>~%EOE%; + %(version|c\+\+|ar|ld|def) .+%{11,12} + EOE + + if ($cxx.target.system == 'win32-msvc') + test -f libfoo/src/libfoo/foo.def + end + } + + : unit-tests-split-buildfile-in-prefix + : + { + $* -t lib,auto-symexport,unit-tests,split,buildfile-in-prefix -l c++ libfoo 2>>/"EOE" &libfoo/***; + created new library project libfoo in $~/libfoo/ + EOE + + $b libfoo/ $config_cxx 2>>~%EOE%; %(version|c\+\+|ar|ld|def) .+%{11,12} EOE + + if ($cxx.target.system == 'win32-msvc') + test -f libfoo/src/foo.def + end + } + } + + : split + { + : buildfile + : + { + : no-src-dir-split + : + { + $* -t lib,prefix-source=src,prefix-include=src/libhello,no-subdir-include,buildfile-in-prefix,no-version libhello 2>>/"EOE" &libhello/***; + info: --type|-t,buildfile-in-prefix ignored for include prefix because either prefix or subdirectory is absent + created new library project libhello in $~/libhello/ + EOE + + test -f libhello/src/buildfile; + test -f libhello/src/libhello/buildfile; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + c++ libhello/src/libhello/cxx{hello} -> libhello/src/libhello/objs{hello} + %.* + ld libhello/src/libs{hello} + %.* + EOE + + $t libhello/ $config_cxx 2>>~%EOE%; + %test .+% + EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + install libhello/src/libhello/hxx{hello} -> install/include/ + %.* + EOE + } + + : failure + { + : src-is-root + : + { + $* -t lib,prefix-include=include,prefix-source=.,no-subdir-include,buildfile-in-prefix,no-version libhello 2>>EOE != 0 + info: --type|-t,buildfile-in-prefix ignored for include prefix because either prefix or subdirectory is absent + error: source buildfile directory is project/package root + EOE + } + + : header-is-root + : + { + $* -t lib,prefix-source=src,prefix-include=.,no-subdir-source,buildfile-in-prefix libhello 2>>EOE != 0 + info: --type|-t,buildfile-in-prefix ignored for source prefix because either prefix or subdirectory is absent + error: header buildfile directory is project/package root + EOE + } + + : src-subdir-of-hdr + : + { + : binless + : + { + $* -t lib,prefix-include=src,prefix-source=src/foo,binless,unit-tests,no-subdir,no-version libhello 2>>/"EOE" != 0 + error: split layout where source buildfile directory is a subdirectory of header buildfile directory is not supported + info: header buildfile directory: $~/libhello/src/ + info: source buildfile directory: $~/libhello/src/foo/ + EOE + } + + : binfull + : + { + $* -t lib,prefix-include=src,prefix-source=src/foo,unit-tests,no-subdir,no-version libhello 2>>/"EOE" != 0 + error: split layout where source buildfile directory is a subdirectory of header buildfile directory is not supported + info: header buildfile directory: $~/libhello/src/ + info: source buildfile directory: $~/libhello/src/foo/ + EOE + } + } + + : hdr-subdir-of-src + : + { + : binless + : + { + $* -t lib,prefix-include=src/foo,prefix-source=src,binless,unit-tests,no-subdir,no-version libhello 2>>/"EOE" != 0 + error: split layout where header buildfile directory is a subdirectory of source buildfile directory is not supported for binless library + info: source buildfile directory: $~/libhello/src/ + info: header buildfile directory: $~/libhello/src/foo/ + EOE + } + } + } + } + + : source + { + : no-buildfile-split + : + { + : hdr-inside-src + : + { + : binless + : + { + $* -t lib,prefix=src,binless,no-subdir-source,unit-tests,buildfile-in-prefix libhello 2>>/"EOE" &libhello/***; + info: --type|-t,buildfile-in-prefix ignored for source prefix because either prefix or subdirectory is absent + created new library project libhello in $~/libhello/ + EOE + + test -f libhello/src/buildfile; + test -f libhello/src/libhello/buildfile == 1; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + version libhello/src/libhello/in{version} -> libhello/src/libhello/hxx{version} + %.* + c++ libhello/src/cxx{hello.test} -> libhello/src/obje{hello.test} + %.* + ld libhello/src/exe{hello.test} + %.* + EOE + + $t libhello/ $config_cxx 2>>~%EOE%; + %test .+%{2} + EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + %( + install libhello/src/libhello/hxx{hello} -> install/include/libhello/ + %.* + install libhello/src/libhello/hxx{version} -> install/include/libhello/ + %| + install libhello/src/libhello/hxx{version} -> install/include/libhello/ + %.* + install libhello/src/libhello/hxx{hello} -> install/include/libhello/ + %) + %.* + EOE + } + + : binful + : + { + $* -t lib,prefix=src,no-subdir-source,unit-tests,buildfile-in-prefix libhello 2>>/"EOE" &libhello/***; + info: --type|-t,buildfile-in-prefix ignored for source prefix because either prefix or subdirectory is absent + created new library project libhello in $~/libhello/ + EOE + + test -f libhello/src/buildfile; + test -f libhello/src/libhello/buildfile == 1; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + version libhello/src/libhello/in{version} -> libhello/src/libhello/hxx{version} + %.* + c++ libhello/src/cxx{hello} -> libhello/src/objs{hello} + %.* + ld libhello/src/libs{hello} + %.* + EOE + + $t libhello/ $config_cxx 2>>~%EOE%; + %test .+%{2} + EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + %( + install libhello/src/libhello/hxx{hello} -> install/include/libhello/ + %.* + install libhello/src/libhello/hxx{version} -> install/include/libhello/ + %| + install libhello/src/libhello/hxx{version} -> install/include/libhello/ + %.* + install libhello/src/libhello/hxx{hello} -> install/include/libhello/ + %) + %.* + EOE + } + } + + : src-inside-hdr + : + { + : binless + : + { + $* -t lib,prefix=src,binless,no-subdir-include,unit-tests,buildfile-in-prefix,no-version libhello 2>>/"EOE" &libhello/***; + info: --type|-t,buildfile-in-prefix ignored for include prefix because either prefix or subdirectory is absent + created new library project libhello in $~/libhello/ + EOE + + test -f libhello/src/buildfile; + test -f libhello/src/libhello/buildfile == 1; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + c++ libhello/src/libhello/cxx{hello.test} -> libhello/src/libhello/obje{hello.test} + %.* + ld libhello/src/libhello/exe{hello.test} + %.* + EOE + + $t libhello/ $config_cxx 2>>~%EOE%; + %test .+%{2} + EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + install libhello/src/hxx{hello} -> install/include/ + %.* + EOE + } + + : binful + : + { + $* -t lib,prefix=src,no-subdir-include,unit-tests,buildfile-in-prefix,no-version libhello 2>>/"EOE" &libhello/***; + info: --type|-t,buildfile-in-prefix ignored for include prefix because either prefix or subdirectory is absent + created new library project libhello in $~/libhello/ + EOE + + test -f libhello/src/buildfile; + test -f libhello/src/libhello/buildfile == 1; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + c++ libhello/src/libhello/cxx{hello} -> libhello/src/libhello/objs{hello} + %.* + ld libhello/src/libs{hello} + %.* + EOE + + $t libhello/ $config_cxx 2>>~%EOE%; + %test .+%{2} + EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + install libhello/src/hxx{hello} -> install/include/ + %.* + EOE + } + } + } + + : failure + : + { + : src-is-root + : + { + $* -t lib,prefix-include=include,prefix-source=.,no-subdir-source libhello 2>>EOE != 0 + error: split source directory is project/package root + EOE + } + + : header-is-root + : + { + $* -t lib,prefix-include=.,prefix-source=src,no-subdir-include,no-version libhello 2>>EOE != 0 + error: split header directory is project/package root + EOE + } + } } } @@ -543,7 +1337,7 @@ status += -d prj sed -n -e 's/^language: (.+)$/\1/p' prj-foo/manifest >'c'; - $build prj-foo/ $config_c 2>>~%EOE% + $b prj-foo/ $config_c 2>>~%EOE% %(c|ld) .+%{2} EOE } @@ -557,7 +1351,7 @@ status += -d prj sed -n -e 's/^(language: .+)$/\1/p' foo.c/manifest >:''; - $build foo.c/ $config_c 2>>~%EOE% + $b foo.c/ $config_c 2>>~%EOE% %(c|ld) .+%{2} EOE } @@ -581,7 +1375,7 @@ status += -d prj int bar; EOI - $build foo/ $config_c $config_cxx 2>>~%EOE% + $b foo/ $config_c $config_cxx 2>>~%EOE% %(c|c\+\+|ld) .+%{3} EOE } @@ -593,7 +1387,7 @@ status += -d prj created new executable project prj-foo in $~/prj-foo/ EOE - $build prj-foo/ $config_c 2>>~%EOE% + $b prj-foo/ $config_c 2>>~%EOE% %(c|ld) .+%{2} EOE } @@ -605,7 +1399,7 @@ status += -d prj created new executable project foo in $~/foo/ EOE - $build foo/ $config_c 2>>~%EOE% + $b foo/ $config_c 2>>~%EOE% %(c|ld|ar) .+%{5} EOE } @@ -632,7 +1426,7 @@ status += -d prj } EOI - $build foo/ $config_c $config_cxx 2>>~%EOE% + $b foo/ $config_c $config_cxx 2>>~%EOE% %(c|c\+\+|ld|ar) .+%{8} EOE } @@ -644,7 +1438,7 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $config_c 2>>~%EOE% + $b libprj-foo/ $config_c 2>>~%EOE% %(version|c|ar|ld) .+%{7} EOE } @@ -672,7 +1466,7 @@ status += -d prj #include "fox.hpp" EOI - $build libfoo/ $config_c $config_cxx 2>>~%EOE% + $b libfoo/ $config_c $config_cxx 2>>~%EOE% %(version|c|c\+\+|ld|ar) .+%{10} EOE } @@ -684,7 +1478,7 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $config_c 2>>~%EOE% + $b libprj-foo/ $config_c 2>>~%EOE% %(version|c|ar|ld) .+%{3} EOE } @@ -696,7 +1490,7 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $config_c 2>>~%EOE% + $b libprj-foo/ $config_c 2>>~%EOE% %(version|c|ar|ld) .+%{7} EOE } @@ -708,7 +1502,7 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $config_c 2>>~%EOE% + $b libprj-foo/ $config_c 2>>~%EOE% %(version|c|ar|ld) .+%{7} EOE } @@ -736,7 +1530,7 @@ status += -d prj #include "fox.hxx" EOI - $build libfoo/ $config_c $config_cxx 2>>~%EOE% + $b libfoo/ $config_c $config_cxx 2>>~%EOE% %(version|c|c\+\+|ar|ld) .+%{10} EOE } @@ -748,7 +1542,7 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $config_c 2>>~%EOE% + $b libprj-foo/ $config_c 2>>~%EOE% %(version|c|ld) .+%{3} EOE } @@ -768,7 +1562,7 @@ status += -d prj #include "fox.hxx" EOI - $build libfoo/ $config_c $config_cxx 2>>~%EOE% + $b libfoo/ $config_c $config_cxx 2>>~%EOE% %(version|c|c\+\+|ld) .+%{4} EOE } @@ -780,7 +1574,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_c 2>>~%EOE% + $b libfoo/ $config_c 2>>~%EOE% %(version|c|ar|ld) .+%{5} EOE } @@ -792,7 +1586,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_c 2>>~%EOE% + $b libfoo/ $config_c 2>>~%EOE% %(version|c|ar|ld) .+%{11} EOE } @@ -819,7 +1613,7 @@ status += -d prj } EOI - $build libfoo/ $config_c $config_cxx 2>>~%EOE% + $b libfoo/ $config_c $config_cxx 2>>~%EOE% %(version|c|c\+\+|ar|ld) .+%{15} EOE } @@ -831,7 +1625,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_c 2>>~%EOE% + $b libfoo/ $config_c 2>>~%EOE% %(version|c|ld) .+%{5} EOE } @@ -844,11 +1638,11 @@ status += -d prj EOE if $posix - $build libfoo/ $config_c 2>>~%EOE% + $b libfoo/ $config_c 2>>~%EOE% %(version|c|ar|ld) .+%{7} EOE else - $build 'clean:' libfoo/ 2>>~%EOE% + $b 'clean:' libfoo/ 2>>~%EOE% %info: .+ is clean% EOE end @@ -864,7 +1658,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_c 2>>~%EOE%; + $b libfoo/ $config_c 2>>~%EOE%; %(version|c|ar|ld|def) .+%{9,10} EOE @@ -880,7 +1674,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_c 2>>~%EOE% + $b libfoo/ $config_c 2>>~%EOE% %(version|c|ar|ld|def) .+%{11,12} EOE } @@ -892,7 +1686,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_c 2>>~%EOE% + $b libfoo/ $config_c 2>>~%EOE% %(version|c|ar|ld|def) .+%{9,10} EOE } @@ -904,7 +1698,7 @@ status += -d prj created new library project libfoo in $~/libfoo/ EOE - $build libfoo/ $config_c 2>>~%EOE% + $b libfoo/ $config_c 2>>~%EOE% %(version|c|ar|ld|def) .+%{11,12} EOE } @@ -962,7 +1756,7 @@ status += -d prj created new library package libprj in $~/prj/libprj/ EOE - $build prj/libprj/ $config_cxx 2>>~%EOE% + $b prj/libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -980,7 +1774,7 @@ status += -d prj created new library package libprj in $~/prj/libprj/ EOE - $build prj/libprj/ $config_cxx 2>>~%EOE% + $b prj/libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -998,7 +1792,7 @@ status += -d prj created new library package libprj in $~/prj/libprj/ EOE - $build prj/libprj/ $config_cxx 2>>~%EOE% + $b prj/libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -1016,7 +1810,7 @@ status += -d prj created new library package libprj in $~/prj/libprj/ EOE - $build prj/libprj/ $config_cxx 2>>~%EOE% + $b prj/libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ld) .+%{3} EOE } @@ -1034,7 +1828,7 @@ status += -d prj created new library package libprj in $~/prj/libprj/ EOE - $build prj/libprj/ $config_cxx 2>>~%EOE% + $b prj/libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ld) .+%{5} EOE } @@ -1088,7 +1882,7 @@ status += -d prj # test -f prj/libprj/README.md == 1; - $build prj/ $config_cxx 2>>~%EOE% + $b prj/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{6} EOE } @@ -1106,7 +1900,7 @@ status += -d prj created new library source subdirectory libprj in $~/prj/libs/src/libprj/ EOE - $build prj/ $config_cxx 2>>~%EOE% + $b prj/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{6} EOE } @@ -1126,7 +1920,7 @@ status += -d prj $~/prj/src/libprj/ EOE - $build prj/ $config_cxx 2>>~%EOE% + $b prj/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{6} EOE } @@ -1144,7 +1938,7 @@ status += -d prj created new library source subdirectory libprj in $~/prj/include/libprj/ EOE - $build prj/ $config_cxx 2>>~%EOE% + $b prj/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{2} EOE } @@ -1164,7 +1958,7 @@ status += -d prj $~/prj/src/libprj/ EOE - $build prj/ $config_cxx 2>>~%EOE% + $b prj/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{4} EOE } @@ -1186,7 +1980,7 @@ status += -d prj created new executable source subdirectory prj in $~/prj/prj/ EOE - $build prj/ $config_cxx 2>>~%EOE% + $b prj/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{6} EOE } @@ -1204,7 +1998,7 @@ status += -d prj created new library source subdirectory prj in $~/prj/core/prj/ EOE - $build prj/ $config_cxx 2>>~%EOE% + $b prj/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{8} EOE } @@ -1223,7 +2017,7 @@ status += -d prj test -f libprj/libprj/prj.cxx; test -f libprj/libprj/prj.hxx; - $build libprj/ $config_cxx 2>>~%EOE% + $b libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -1238,7 +2032,7 @@ status += -d prj test -f libprj/libprj/prj.cpp; test -f libprj/libprj/prj.hpp; - $build libprj/ $config_cxx 2>>~%EOE% + $b libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -1253,7 +2047,7 @@ status += -d prj test -f libprj/libprj/prj.c++; test -f libprj/libprj/prj.h++; - $build libprj/ $config_cxx 2>>~%EOE% + $b libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -1268,7 +2062,7 @@ status += -d prj test -f libprj/libprj/prj.cc; test -f libprj/libprj/prj.hh; - $build libprj/ $config_cxx 2>>~%EOE% + $b libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -1283,7 +2077,7 @@ status += -d prj test -f libprj/libprj/prj.c; test -f libprj/libprj/prj.h; - $build libprj/ $config_cxx 2>>~%EOE% + $b libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -1298,7 +2092,7 @@ status += -d prj test -f libprj/libprj/prj.cxx; test -f libprj/libprj/prj; - $build libprj/ $config_cxx 2>>~%EOE% + $b libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -1324,7 +2118,7 @@ status += -d prj %.+ EOO - $build libprj/ $config_cxx 2>>~%EOE% + $b libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -1339,7 +2133,7 @@ status += -d prj test -f libprj/libprj/prj.cpp; test -f libprj/libprj/prj.hxx; - $build libprj/ $config_cxx 2>>~%EOE% + $b libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -1353,7 +2147,7 @@ status += -d prj test -f libprj/libprj/prj.cpp; test -f libprj/libprj/prj.hpp; - $build libprj/ $config_cxx 2>>~%EOE% + $b libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -1432,7 +2226,7 @@ status += -d prj %.+ EOO - $build prj/ $config_c 2>>~%EOE% + $b prj/ $config_c 2>>~%EOE% %(c|ar|ld) .+%{5} EOE } @@ -1447,7 +2241,7 @@ status += -d prj test -f libprj/buildfile; test -f libprj/libprj/version.h.in == 1; - $build libprj/ $config_c 2>>~%EOE% + $b libprj/ $config_c 2>>~%EOE% %(c|ar|ld) .+%{6} EOE } @@ -1462,7 +2256,7 @@ status += -d prj test -f libprj/build2file; test -d libprj/libprj == 1; - $build libprj/ $config_c 2>>~%EOE% + $b libprj/ $config_c 2>>~%EOE% %info: .+ is up to date% EOE } @@ -1491,7 +2285,7 @@ status += -d prj test -f libprj/libprj/prj; test -f libprj/libprj/prj.cpp; - $build libprj/ $config_cxx 2>>~%EOE% + $b libprj/ $config_cxx 2>>~%EOE% %(c\+\+|ar|ld) .+%{6} EOE } @@ -1506,7 +2300,7 @@ status += -d prj test -f libprj/libprj/prj.h; test -f libprj/libprj/prj.c; - $build libprj/ $config_c 2>>~%EOE% + $b libprj/ $config_c 2>>~%EOE% %(c|ar|ld) .+%{6} EOE } @@ -1564,7 +2358,7 @@ status += -d prj CMakeCache.txt EOO - $build prj/libprj/ $config_cxx 2>>~%EOE% + $b prj/libprj/ $config_cxx 2>>~%EOE% %(version|c\+\+|ar|ld) .+%{7} EOE } @@ -1731,7 +2525,7 @@ status += -d prj mkdir hello/tests; touch hello/tests/hello.test.cxx; - $build hello/ $config_cxx 2>>~%EOE% + $b hello/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{2} EOE } @@ -1746,7 +2540,7 @@ status += -d prj mkdir hello/tests; touch hello/tests/hello.test.cxx; - $build hello/ $config_cxx 2>>~%EOE% + $b hello/ $config_cxx 2>>~%EOE% %(c\+\+|ld|ar) .+%{5} EOE } @@ -1765,7 +2559,7 @@ status += -d prj mkdir libhello/tests; touch libhello/tests/hello.test.cxx; - $build libhello/ $config_cxx 2>>~%EOE% + $b libhello/ $config_cxx 2>>~%EOE% %(c\+\+|ld|ar) .+%{4} EOE } @@ -1783,7 +2577,7 @@ status += -d prj mkdir libhello/tests; touch libhello/tests/hello.test.cxx; - $build libhello/ $config_cxx 2>>~%EOE% + $b libhello/ $config_cxx 2>>~%EOE% %(c\+\+|ld|ar) .+%{8} EOE } @@ -1798,7 +2592,7 @@ status += -d prj mkdir libhello/tests; touch libhello/tests/hello.test.cxx; - $build libhello/ $config_cxx 2>>~%EOE% + $b libhello/ $config_cxx 2>>~%EOE% %(c\+\+|ld) .+%{2} EOE } @@ -1811,8 +2605,6 @@ status += -d prj : Here we smoke test the common source code layouts listed in bdep-new(1). : { - t = [cmdline] $build test: - : subdir : { @@ -1820,13 +2612,33 @@ status += -d prj created new library project libhello in $~/libhello/ EOE - $build libhello/ $config_cxx 2>>~%EOE%; - %(version|c\+\+|ld|ar) .+%{7} + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + version libhello/hello/in{version} -> libhello/hello/hxx{version} + %.* + c++ libhello/hello/cxx{hello} -> libhello/hello/objs{hello} + %.* + ld libhello/hello/libs{hello} + %.* EOE - $t libhello/ $config_cxx 2>>~%EOE% + $t libhello/ $config_cxx 2>>~%EOE%; %test .+% EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + %( + install libhello/hello/hxx{hello} -> install/include/hello/ + %.* + install libhello/hello/hxx{version} -> install/include/hello/ + %| + install libhello/hello/hxx{version} -> install/include/hello/ + %.* + install libhello/hello/hxx{hello} -> install/include/hello/ + %) + %.* + EOE } : combined-prefix @@ -1836,7 +2648,7 @@ status += -d prj created new executable project hello in $~/hello/ EOE - $build hello/ $config_cxx 2>>~%EOE%; + $b hello/ $config_cxx 2>>~%EOE%; %(c\+\+|ld) .+%{2} EOE @@ -1852,13 +2664,36 @@ status += -d prj created new library project libhello in $~/libhello/ EOE - $build libhello/ $config_cxx 2>>~%EOE%; - %(version|c\+\+|ld|ar) .+%{7} + test -f libhello/include/libhello/buildfile; + test -f libhello/libhello/buildfile; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + version libhello/include/libhello/in{version} -> libhello/include/libhello/hxx{version} + %.* + c++ libhello/libhello/cxx{hello} -> libhello/libhello/objs{hello} + %.* + ld libhello/libhello/libs{hello} + %.* EOE - $t libhello/ $config_cxx 2>>~%EOE% + $t libhello/ $config_cxx 2>>~%EOE%; %test .+% EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + %( + install libhello/include/libhello/hxx{hello} -> install/include/libhello/ + %.* + install libhello/include/libhello/hxx{version} -> install/include/libhello/ + %| + install libhello/include/libhello/hxx{version} -> install/include/libhello/ + %.* + install libhello/include/libhello/hxx{hello} -> install/include/libhello/ + %) + %.* + EOE } : split @@ -1868,13 +2703,36 @@ status += -d prj created new library project libhello in $~/libhello/ EOE - $build libhello/ $config_cxx 2>>~%EOE%; - %(version|c\+\+|ld|ar) .+%{7} + test -f libhello/include/libhello/buildfile; + test -f libhello/src/libhello/buildfile; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + version libhello/include/libhello/in{version} -> libhello/include/libhello/hxx{version} + %.* + c++ libhello/src/libhello/cxx{hello} -> libhello/src/libhello/objs{hello} + %.* + ld libhello/src/libhello/libs{hello} + %.* EOE - $t libhello/ $config_cxx 2>>~%EOE% + $t libhello/ $config_cxx 2>>~%EOE%; %test .+% EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + %( + install libhello/include/libhello/hxx{hello} -> install/include/libhello/ + %.* + install libhello/include/libhello/hxx{version} -> install/include/libhello/ + %| + install libhello/include/libhello/hxx{version} -> install/include/libhello/ + %.* + install libhello/include/libhello/hxx{hello} -> install/include/libhello/ + %) + %.* + EOE } : prefix-no-subdir @@ -1884,7 +2742,7 @@ status += -d prj created new executable project hello in $~/hello/ EOE - $build hello/ $config_cxx 2>>~%EOE%; + $b hello/ $config_cxx 2>>~%EOE%; %(c\+\+|ld) .+%{2} EOE @@ -1900,13 +2758,26 @@ status += -d prj created new library project libhello in $~/libhello/ EOE - $build libhello/ $config_cxx 2>>~%EOE%; - %(c\+\+|ld|ar) .+%{6} + test -f libhello/include/buildfile; + test -f libhello/src/buildfile; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + c++ libhello/src/cxx{hello} -> libhello/src/objs{hello} + %.* + ld libhello/src/libs{hello} + %.* EOE - $t libhello/ $config_cxx 2>>~%EOE% + $t libhello/ $config_cxx 2>>~%EOE%; %test .+% EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + install libhello/include/hxx{hello} -> install/include/ + %.* + EOE } : no-subdir @@ -1916,8 +2787,25 @@ status += -d prj created new library project libhello in $~/libhello/ EOE - $build libhello/ $config_cxx 2>>~%EOE% - %(c\+\+|ld|ar) .+%{4} + test -d libhello/libhello/ == 1; + test -f libhello/buildfile; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + c++ libhello/cxx{hello} -> libhello/objs{hello} + %.* + ld libhello/libs{hello} + %.* + EOE + + $t libhello/ $config_cxx 2>>EOE != 0; + <buildspec>: error: target libhello/ does not support operation test + EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + install libhello/hxx{hello} -> install/include/ + %.* EOE } @@ -1928,13 +2816,36 @@ status += -d prj created new library project libhello in $~/libhello/ EOE - $build libhello/ $config_cxx 2>>~%EOE%; - %(version|c\+\+|ld|ar) .+%{7} + test -f libhello/include/hello/buildfile; + test -f libhello/src/buildfile; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + version libhello/include/hello/in{version} -> libhello/include/hello/hxx{version} + %.* + c++ libhello/src/cxx{hello} -> libhello/src/objs{hello} + %.* + ld libhello/src/libs{hello} + %.* EOE - $t libhello/ $config_cxx 2>>~%EOE% + $t libhello/ $config_cxx 2>>~%EOE%; %test .+% EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + %( + install libhello/include/hello/hxx{hello} -> install/include/hello/ + %.* + install libhello/include/hello/hxx{version} -> install/include/hello/ + %| + install libhello/include/hello/hxx{version} -> install/include/hello/ + %.* + install libhello/include/hello/hxx{hello} -> install/include/hello/ + %) + %.* + EOE } : split-no-subdir-include @@ -1944,13 +2855,26 @@ status += -d prj created new library project libhello in $~/libhello/ EOE - $build libhello/ $config_cxx 2>>~%EOE%; - %(c\+\+|ld|ar) .+%{6} + test -f libhello/include/buildfile; + test -f libhello/src/hello/buildfile; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + c++ libhello/src/hello/cxx{hello} -> libhello/src/hello/objs{hello} + %.* + ld libhello/src/hello/libs{hello} + %.* EOE - $t libhello/ $config_cxx 2>>~%EOE% + $t libhello/ $config_cxx 2>>~%EOE%; %test .+% EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + install libhello/include/hxx{hello} -> install/include/ + %.* + EOE } : include-in-src @@ -1962,13 +2886,36 @@ status += -d prj created new library project libhello in $~/libhello/ EOE - $build libhello/ $config_cxx 2>>~%EOE%; - %(version|c\+\+|ld|ar) .+%{7} + test -f libhello/src/hello/buildfile; + test -f libhello/src/include/hello/buildfile; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + version libhello/src/include/hello/in{version} -> libhello/src/include/hello/hxx{version} + %.* + c++ libhello/src/hello/cxx{hello} -> libhello/src/hello/objs{hello} + %.* + ld libhello/src/hello/libs{hello} + %.* EOE - $t libhello/ $config_cxx 2>>~%EOE% + $t libhello/ $config_cxx 2>>~%EOE%; %test .+% EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + %( + install libhello/src/include/hello/hxx{hello} -> install/include/hello/ + %.* + install libhello/src/include/hello/hxx{version} -> install/include/hello/ + %| + install libhello/src/include/hello/hxx{version} -> install/include/hello/ + %.* + install libhello/src/include/hello/hxx{hello} -> install/include/hello/ + %) + %.* + EOE } : include-in-src-no-subdir-source @@ -1981,13 +2928,36 @@ subdir=hello,no-subdir-source \ created new library project libhello in $~/libhello/ EOE - $build libhello/ $config_cxx 2>>~%EOE%; - %(version|c\+\+|ld|ar) .+%{7} + test -f libhello/src/buildfile; + test -f libhello/src/include/hello/buildfile; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + version libhello/src/include/hello/in{version} -> libhello/src/include/hello/hxx{version} + %.* + c++ libhello/src/cxx{hello} -> libhello/src/objs{hello} + %.* + ld libhello/src/libs{hello} + %.* EOE - $t libhello/ $config_cxx 2>>~%EOE% + $t libhello/ $config_cxx 2>>~%EOE%; %test .+% EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + %( + install libhello/src/include/hello/hxx{hello} -> install/include/hello/ + %.* + install libhello/src/include/hello/hxx{version} -> install/include/hello/ + %| + install libhello/src/include/hello/hxx{version} -> install/include/hello/ + %.* + install libhello/src/include/hello/hxx{hello} -> install/include/hello/ + %) + %.* + EOE } : boost @@ -2000,13 +2970,36 @@ subdir=hello,no-subdir-source \ created new library project libhello in $~/libhello/ EOE - $build libhello/ $config_cxx 2>>~%EOE%; - %(version|c\+\+|ld|ar) .+%{7} + test -f libhello/libs/hello/src/buildfile; + test -f libhello/include/hello/buildfile; + + $b libhello/ $config_cxx 2>>/~%EOE%; + %.* + version libhello/include/hello/in{version} -> libhello/include/hello/hxx{version} + %.* + c++ libhello/libs/hello/src/cxx{hello} -> libhello/libs/hello/src/objs{hello} + %.* + ld libhello/libs/hello/src/libs{hello} + %.* EOE - $t libhello/ $config_cxx 2>>~%EOE% + $t libhello/ $config_cxx 2>>~%EOE%; %test .+% EOE + + $i libhello/ $config_cxx 2>>/~%EOE% + %.* + %( + install libhello/include/hello/hxx{hello} -> install/include/hello/ + %.* + install libhello/include/hello/hxx{version} -> install/include/hello/ + %| + install libhello/include/hello/hxx{version} -> install/include/hello/ + %.* + install libhello/include/hello/hxx{hello} -> install/include/hello/ + %) + %.* + EOE } : multiple-components @@ -2027,6 +3020,9 @@ subdir=hello1,no-subdir-source \ $~/hello/libhello1/src/ EOE + test -f hello/libhello1/include/hello1/buildfile; + test -f hello/libhello1/src/buildfile; + $* -d hello --source \ -l c++ \ -t lib,\ @@ -2038,9 +3034,30 @@ subdir=hello2,no-subdir-source \ $~/hello/libhello2/src/ EOE - $build hello/ $config_cxx 2>>~%EOE% + test -f hello/libhello2/include/hello2/buildfile; + test -f hello/libhello2/src/buildfile; + + $b hello/ $config_cxx 2>>~%EOE%; %(c\+\+|ld|ar) .+%{8} EOE + + $t hello/ $config_cxx 2>>/EOE; + info: dir{hello/} has nothing to test + EOE + + $i hello/ $config_cxx 2>>/~%EOE% + %.* + %( + install hello/libhello1/include/hello1/hxx{hello1} -> install/include/hello1/ + %.* + install hello/libhello2/include/hello2/hxx{hello2} -> install/include/hello2/ + %| + install hello/libhello2/include/hello2/hxx{hello2} -> install/include/hello2/ + %.* + install hello/libhello1/include/hello1/hxx{hello1} -> install/include/hello1/ + %) + %.* + EOE } : multiple-components-diff-prefixes @@ -2061,17 +3078,96 @@ subdir=hello,no-subdir-source \ $~/hello/libs/libhello/src/ EOE + test -f hello/libs/libhello/include/hello/buildfile; + test -f hello/libs/libhello/src/buildfile; + $* -d hello --source -l c++ -t exe,prefix=src hello 2>>/"EOE"; created new executable source subdirectory hello in $~/hello/src/hello/ EOE - $build hello/ $config_cxx 2>>~%EOE%; + test -f hello/src/hello/buildfile; + + $b hello/ $config_cxx 2>>~%EOE%; %(c\+\+|ld|ar) .+%{6} EOE - $t hello/ $config_cxx 2>>~%EOE% + $t hello/ $config_cxx 2>>~%EOE%; %test .+% EOE + + $i hello/ $config_cxx 2>>/~%EOE% + %.* + %( + install hello/libs/libhello/include/hello/hxx{hello} -> install/include/hello/ + %.* + install hello/src/hello/exe{hello} -> install/bin/ + %| + install hello/src/hello/exe{hello} -> install/bin/ + %.* + install hello/libs/libhello/include/hello/hxx{hello} -> install/include/hello/ + %) + %.* + EOE + } + + : packaging-third-party + : + { + $* -l c -t empty hello 2>>/"EOE" &hello/***; + created new empty project hello in $~/hello/ + EOE + + $* -d hello --package \ + -l c \ + -t lib,split,subdir=hello,no-version,no-symexport,buildfile-in-prefix \ + libhello 2>>/"EOE"; + created new library package libhello in $~/hello/libhello/ + EOE + + test -f hello/libhello/include/buildfile; + test -f hello/libhello/include/buildfile; + + cat <<EOI >=hello/libhello/src/hello.def; + EXPORTS + say_hello + EOI + + cat <<EOI >+hello/libhello/src/buildfile; + + libs{hello}: def{hello}: include = ($c.target.class == 'windows') + EOI + + $* -d hello --package \ + -l c \ + -t exe,prefix=src,subdir=hello-app,buildfile-in-prefix \ + hello 2>>/"EOE"; + created new executable package hello in $~/hello/hello/ + EOE + + test -f hello/hello/src/buildfile; + + $b hello/libhello/ $config_c 2>>/~%EOE%; + %.* + c hello/libhello/src/hello/c{hello} -> hello/libhello/src/hello/objs{hello} + %.* + ld hello/libhello/src/libs{hello} + %.* + EOE + + $b hello/hello/ $config_c 2>>/~%EOE%; + c hello/hello/src/hello-app/c{hello} -> hello/hello/src/hello-app/obje{hello} + ld hello/hello/src/exe{hello} + EOE + + $t hello/libhello/ hello/hello/ $config_c 2>>~%EOE%; + %test .+%{2} + EOE + + $i hello/libhello/ $config_c 2>>/~%EOE% + %.* + install hello/libhello/include/hello/h{hello} -> install/include/hello/ + %.* + EOE } } } @@ -2090,7 +3186,7 @@ subdir=hello,no-subdir-source \ $status >'prj configured 0.1.0-a.0.19700101000000'; - $build prj/ 2>>~%EOE% + $b prj/ 2>>~%EOE% %(mkdir|c\+\+|ld|ln) .+%{4} EOE } @@ -2112,7 +3208,7 @@ subdir=hello,no-subdir-source \ $status >'prj configured 0.1.0-a.0.19700101000000'; - $build prj/ 2>>~%EOE% + $b prj/ 2>>~%EOE% %(mkdir|c\+\+|ld|ln) .+%{4} EOE } |