diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-15 22:32:38 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-16 11:46:31 +0300 |
commit | e771c6b80168de37b74cc57dec502dfa418a19a6 (patch) | |
tree | 1d2c8ba68cd1e1331d45cde2fc76d25eee007c08 /tests/update.test | |
parent | 1ffe9fa27ee9829c16446a09aa5bd94bcc60ab68 (diff) |
Add some more tests
Diffstat (limited to 'tests/update.test')
-rw-r--r-- | tests/update.test | 95 |
1 files changed, 86 insertions, 9 deletions
diff --git a/tests/update.test b/tests/update.test index 23055c6..3e8e5f5 100644 --- a/tests/update.test +++ b/tests/update.test @@ -5,26 +5,26 @@ # Here we test both update and clean commands. # -.include common.test project.test +.include common.test -init += cc "config.cxx=$config.cxx" -d prj 2>! +cxx = cc "config.cxx=$config.cxx" + +new += 2>! +init += $cxx -d prj 2>! deinit += -d prj -clean += -d prj -: project +: single-pkg-cfg : { - $clone_prj; - - $init -C @cfg &prj-cfg/***; + $new -C @cfg prj $cxx &prj/*** &prj-cfg/***; - $* 2>>/EOE; + $* -d 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} EOE - $clean 2>>/EOE; + $clean -d prj 2>>/EOE; rm prj-cfg/prj/prj/exe{prj} rm prj-cfg/prj/prj/obje{prj} rm prj-cfg/prj/fsdir{prj/} @@ -36,3 +36,80 @@ clean += -d prj drop prj EOE } + +: multi-pkg-cfg +: +{ + $new -t empty prj &prj/***; + + $new --package pkg1 -d prj; + $new --package pkg2 -d prj; + + $init -C @cfg1 &prj-cfg1/***; + $init -C @cfg2 &prj-cfg2/***; + + # Update. + # + $* -d prj/pkg1 2>>/EOE; # Default (cfg1). + mkdir prj-cfg1/pkg1/fsdir{pkg1/} + c++ prj/pkg1/pkg1/cxx{pkg1}@prj-cfg1/pkg1/pkg1/ + ld prj-cfg1/pkg1/pkg1/exe{pkg1} + EOE + + $* @cfg2 -d prj/pkg1 2>>/EOE; # By name (cfg2). + mkdir prj-cfg2/pkg1/fsdir{pkg1/} + c++ prj/pkg1/pkg1/cxx{pkg1}@prj-cfg2/pkg1/pkg1/ + ld prj-cfg2/pkg1/pkg1/exe{pkg1} + EOE + + $* --all -d prj 2>>/EOE; # All configs (and packages). + in configuration @cfg1: + mkdir prj-cfg1/pkg2/fsdir{pkg2/} + c++ prj/pkg2/pkg2/cxx{pkg2}@prj-cfg1/pkg2/pkg2/ + ld prj-cfg1/pkg2/pkg2/exe{pkg2} + info: prj-cfg1/dir{pkg1/} is up to date + + in configuration @cfg2: + mkdir prj-cfg2/pkg2/fsdir{pkg2/} + c++ prj/pkg2/pkg2/cxx{pkg2}@prj-cfg2/pkg2/pkg2/ + ld prj-cfg2/pkg2/pkg2/exe{pkg2} + info: prj-cfg2/dir{pkg1/} is up to date + EOE + + # Clean. + # + $clean -d prj/pkg1 2>>/EOE; # Default (cfg1). + rm prj-cfg1/pkg1/pkg1/exe{pkg1} + rm prj-cfg1/pkg1/pkg1/obje{pkg1} + rm prj-cfg1/pkg1/fsdir{pkg1/} + EOE + + $clean @cfg2 -d prj/pkg1 2>>/EOE; # By name (cfg2). + rm prj-cfg2/pkg1/pkg1/exe{pkg1} + rm prj-cfg2/pkg1/pkg1/obje{pkg1} + rm prj-cfg2/pkg1/fsdir{pkg1/} + EOE + + $clean --all -d prj 2>>/EOE; # All configs (and packages). + in configuration @cfg1: + rm prj-cfg1/pkg2/pkg2/exe{pkg2} + rm prj-cfg1/pkg2/pkg2/obje{pkg2} + rm prj-cfg1/pkg2/fsdir{pkg2/} + info: prj-cfg1/dir{pkg1/} is clean + + in configuration @cfg2: + rm prj-cfg2/pkg2/pkg2/exe{pkg2} + rm prj-cfg2/pkg2/pkg2/obje{pkg2} + rm prj-cfg2/pkg2/fsdir{pkg2/} + info: prj-cfg2/dir{pkg1/} is clean + EOE + + $deinit 2>>/"EOE" + deinitializing in project $~/prj/ + deinitializing package pkg1 + deinitializing package pkg2 + synchronizing: + drop pkg1 + drop pkg2 + EOE +} |