diff options
Diffstat (limited to 'tests/new.test')
-rw-r--r-- | tests/new.test | 83 |
1 files changed, 59 insertions, 24 deletions
diff --git a/tests/new.test b/tests/new.test index 96cb4c5..cdb1537 100644 --- a/tests/new.test +++ b/tests/new.test @@ -4,42 +4,77 @@ .include common.test +status += -d prj + +cxx = cc "config.cxx=$config.cxx" + : exe { - $* -t exe hello 2>>/"EOE" &hello/***; - created new executable project hello in $~/hello/ + $* -t exe -l c++ prj 2>>/"EOE" &prj/***; + created new executable project prj in $~/prj/ EOE - $build hello/ 2>>/EOE - c++ hello/hello/cxx{hello} - ld hello/hello/exe{hello} + $build prj/ 2>>/EOE + c++ prj/prj/cxx{prj} + ld prj/prj/exe{prj} EOE } : lib { - $* -t lib libhello 2>>/"EOE" &libhello/***; - created new library project libhello in $~/libhello/ + $* -t lib -l c++ libprj 2>>/"EOE" &libprj/***; + created new library project libprj in $~/libprj/ EOE - # We build the project by chunks to make sure the output is reproducible (no, - # -s doesn't really help). - # - echo "#include <libhello/version.hxx>" >+libhello/libhello/hello.hxx; - - $build libhello/libhello/libs{hello} 2>>/EOE; - ver libhello/libhello/version.hxx.in - c++ libhello/libhello/cxx{hello} - ld libhello/libhello/libs{hello} + $build libprj/ 2>>/~%EOE% + %.{4} + %ld libprj/.+%{3} EOE +} - $build libhello/libhello/ 2>>/EOE; - c++ libhello/libhello/cxx{hello} - ld libhello/libhello/liba{hello} - EOE +: cfg +{ + : dir-and-name + : + { + $* -C prj-config @cfg prj $cxx 2>>/~"%EOE%" &prj/*** &prj-config/***; + created new executable project prj in $~/prj/ + created configuration @cfg $~/prj-config/ \(1, default, forwarded, auto-synchronized\) + synchronizing: + % new prj.+19700101000000% + EOE - $build libhello/ 2>>/EOE - c++ libhello/tests/basics/cxx{driver} - ld libhello/tests/basics/exe{driver} - EOE + $status >'prj configured 0.1.0-a.0.19700101000000'; + + $build prj/ 2>>/EOE + mkdir prj-config/prj/fsdir{prj/} + c++ prj/prj/cxx{prj}@prj-config/prj/prj/ + ld prj-config/prj/prj/exe{prj} + ln prj-config/prj/prj/exe{prj} -> prj/prj/ + EOE + } + + : name + : + : Test deducing the configuration directory path from project source + : directory path and configuration name. Here we also use the dash-prefixed + : name (as in Windows PowerShell where the leading '@' character is special). + : + { + $* -C -@cfg prj $cxx 2>>/~"%EOE%" &prj/*** &prj-cfg/***; + created new executable project prj in $~/prj/ + created configuration @cfg $~/prj-cfg/ \(1, default, forwarded, auto-synchronized\) + synchronizing: + % new prj.+19700101000000% + EOE + + $status >'prj configured 0.1.0-a.0.19700101000000'; + + $build prj/ 2>>/EOE + mkdir prj-cfg/prj/fsdir{prj/} + c++ prj/prj/cxx{prj}@prj-cfg/prj/prj/ + ld prj-cfg/prj/prj/exe{prj} + ln prj-cfg/prj/prj/exe{prj} -> prj/prj/ + EOE + } } |