diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/config.test | 46 | ||||
-rw-r--r-- | tests/init.test | 47 | ||||
-rw-r--r-- | tests/new.test | 29 | ||||
-rw-r--r-- | tests/sync.test | 39 | ||||
-rw-r--r-- | tests/test.test | 27 | ||||
-rw-r--r-- | tests/update.test | 60 |
6 files changed, 77 insertions, 171 deletions
diff --git a/tests/config.test b/tests/config.test index 5beabcf..3dcd9f6 100644 --- a/tests/config.test +++ b/tests/config.test @@ -40,10 +40,8 @@ deinit += -d prj @cfg $~/cfg-dir/ 1 default,forwarded,auto-synchronized EOO - $update @cfg 2>>/EOE; - mkdir cfg-dir/prj/fsdir{prj/} - c++ prj/prj/cxx{prj}@cfg-dir/prj/prj/ - ld cfg-dir/prj/prj/exe{prj} + $update @cfg 2>>~%EOE%; + %(mkdir|c\+\+|ld) .+%{3} EOE $deinit @cfg 2>>/"EOE" @@ -74,10 +72,8 @@ deinit += -d prj @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized EOO - $update @cfg 2>>/EOE; - mkdir prj-cfg/prj/fsdir{prj/} - c++ prj/prj/cxx{prj}@prj-cfg/prj/prj/ - ld prj-cfg/prj/prj/exe{prj} + $update @cfg 2>>~%EOE%; + %(mkdir|c\+\+|ld) .+%{3} EOE $deinit @cfg 2>>/"EOE" @@ -108,10 +104,8 @@ deinit += -d prj $~/cfg/ 1 default,forwarded,auto-synchronized EOO - $update -c cfg 2>>/EOE; - mkdir cfg/prj/fsdir{prj/} - c++ prj/prj/cxx{prj}@cfg/prj/prj/ - ld cfg/prj/prj/exe{prj} + $update -c cfg 2>>~%EOE%; + %(mkdir|c\+\+|ld) .+%{3} EOE $deinit -c cfg 2>>/"EOE" @@ -182,16 +176,12 @@ deinit += -d prj @cfg2 $~/prj-cfg2/ 2 auto-synchronized EOO - $update --all 2>>/EOE; + $update --all 2>>~%EOE%; in configuration @cfg1: - mkdir prj-cfg1/prj/fsdir{prj/} - c++ prj/prj/cxx{prj}@prj-cfg1/prj/prj/ - ld prj-cfg1/prj/prj/exe{prj} + %(mkdir|c\+\+|ld) .+%{3} in configuration @cfg2: - mkdir prj-cfg2/prj/fsdir{prj/} - c++ prj/prj/cxx{prj}@prj-cfg2/prj/prj/ - ld prj-cfg2/prj/prj/exe{prj} + %(mkdir|c\+\+|ld) .+%{3} EOE $deinit --all 2>>/"EOE" @@ -227,10 +217,8 @@ deinit += -d prj moved configuration @cfg $~/prj-cfg/ 1 to $~/prj-cfg2/ EOE - $update --all 2>>/EOE; - mkdir prj-cfg2/prj/fsdir{prj/} - c++ prj/prj/cxx{prj}@prj-cfg2/prj/prj/ - ld prj-cfg2/prj/prj/exe{prj} + $update --all 2>>~%EOE%; + %(mkdir|c\+\+|ld) .+%{3} EOE $deinit 2>>/"EOE" @@ -259,10 +247,8 @@ deinit += -d prj renamed configuration @cfg $~/prj-cfg/ 1 to @cfg2 EOE - $update @cfg2 2>>/EOE; - mkdir prj-cfg/prj/fsdir{prj/} - c++ prj/prj/cxx{prj}@prj-cfg/prj/prj/ - ld prj-cfg/prj/prj/exe{prj} + $update @cfg2 2>>~%EOE%; + %(mkdir|c\+\+|ld) .+%{3} EOE $deinit 2>>/"EOE" @@ -322,10 +308,8 @@ deinit += -d prj @cfg2 $~/prj-cfg2/ 2 default,forwarded EOO - $update 2>>/EOE; - mkdir prj-cfg2/prj/fsdir{prj/} - c++ prj/prj/cxx{prj}@prj-cfg2/prj/prj/ - ld prj-cfg2/prj/prj/exe{prj} + $update 2>>~%EOE%; + %(mkdir|c\+\+|ld) .+%{3} EOE $deinit --all 2>>/"EOE" diff --git a/tests/init.test b/tests/init.test index 8915189..28f66e2 100644 --- a/tests/init.test +++ b/tests/init.test @@ -32,11 +32,8 @@ deinit += -d prj $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/ + $build prj/ 2>>~%EOE%; + %(mkdir|c\+\+|ld|ln) .+%{4} EOE prj/prj/prj 'testscript' >'Hello, testscript!'; # Make sure is forwarded. @@ -45,10 +42,8 @@ deinit += -d prj info: prj-cfg/dir{prj/} is up to date EOE - $build 'clean:' prj/ 2>>/EOE; - rm prj-cfg/prj/prj/exe{prj} - rm prj-cfg/prj/prj/obje{prj} - rm prj-cfg/prj/fsdir{prj/} + $build 'clean:' prj/ 2>>~%EOE%; + %rm .+%{3} EOE $deinit 2>>/"EOE" @@ -90,27 +85,20 @@ deinit += -d prj prj configured 0.1.0-a.0.19700101000000 EOO - $build prj-cfg1/ 2>>/~%EOE%; - %mkdir prj-cfg1/.+%{2} - %c\+\+ .+%{2} - %ld prj-cfg1/.+%{2} + $build prj-cfg1/ 2>>~%EOE%; + %(mkdir|c\+\+|ld) .+%{6} EOE - $build prj-cfg2/ 2>>/~%EOE%; - %mkdir prj-cfg2/.+%{2} - %c\+\+ .+%{2} - %ld prj-cfg2/.+%{2} + $build prj-cfg2/ 2>>~%EOE%; + %(mkdir|c\+\+|ld) .+%{6} EOE - $build prj/ 2>>/EOE; - ln prj-cfg1/prj/prj/exe{prj} -> prj/prj/ - info: prj-cfg1/dir{prj/} is up to date + $build prj/ 2>>~%EOE%; + %(ln|info:) .+%{2} EOE - $build 'clean:' prj/ 2>>/EOE; - rm prj-cfg1/prj/prj/exe{prj} - rm prj-cfg1/prj/prj/obje{prj} - rm prj-cfg1/prj/fsdir{prj/} + $build 'clean:' prj/ 2>>~%EOE%; + %rm .+%{3} EOE $deinit 2>>/"EOE" @@ -139,11 +127,8 @@ deinit += -d prj $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/ + $build prj/ 2>>~%EOE%; + %(mkdir|c\+\+|ld|ln) .+%{4} EOE # Move the executable package into a separate directory. @@ -202,9 +187,7 @@ deinit += -d prj $build prj-cfg/prj/ 2>>/~"%EOE%"; synchronizing $~/prj-cfg/: % upgrade prj.+19700101000000#2% - %mkdir prj-cfg/.+%{2} - %.{3} - %ld prj-cfg/.+%{2} + %\(mkdir|version\\.in|c\\+\\+|ld) .+%{7} EOE $deinit 2>>/"EOE" diff --git a/tests/new.test b/tests/new.test index 491c155..6ae37e4 100644 --- a/tests/new.test +++ b/tests/new.test @@ -25,9 +25,8 @@ status += -d prj created new executable project prj-foo in $~/prj-foo/ EOE - $build prj-foo/ $cxx 2>>/EOE - c++ prj-foo/prj-foo/cxx{prj-foo} - ld prj-foo/prj-foo/exe{prj-foo} + $build prj-foo/ $cxx 2>>~%EOE% + %(c\+\+|ld) .+%{2} EOE } @@ -37,9 +36,8 @@ status += -d prj created new library project libprj-foo in $~/libprj-foo/ EOE - $build libprj-foo/ $cxx 2>>/~%EOE% - %.{4} - %ld libprj-foo/.+%{3} + $build libprj-foo/ $cxx 2>>~%EOE% + %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -59,9 +57,8 @@ status += -d prj created new library package libprj in $~/prj/libprj/ EOE - $build prj/libprj/ $cxx 2>>/~%EOE% - %.{4} - %ld prj/libprj/.+%{3} + $build prj/libprj/ $cxx 2>>~%EOE% + %(version\.in|c\+\+|ar|ld) .+%{7} EOE } @@ -109,11 +106,8 @@ status += -d prj $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/ + $build prj/ 2>>~%EOE% + %(mkdir|c\+\+|ld|ln) .+%{4} EOE } @@ -134,11 +128,8 @@ status += -d prj $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/ + $build prj/ 2>>~%EOE% + %(mkdir|c\+\+|ld|ln) .+%{4} EOE } } diff --git a/tests/sync.test b/tests/sync.test index c086a02..b297990 100644 --- a/tests/sync.test +++ b/tests/sync.test @@ -63,17 +63,12 @@ deinit += -d prj % libprj configured 0.+% EOO - $build prj/ 2>>/~%EOE%; - %mkdir prj-cfg/.+%{2} - %.{3} - %ld prj-cfg/.+%{2} - ln prj-cfg/prj/prj/exe{prj} -> prj/prj/ + $build prj/ 2>>~%EOE%; + %(mkdir|version\.in|c\+\+|ld|ln) .+%{8} EOE - $build 'clean:' prj/ 2>>/EOE; - rm prj-cfg/prj/prj/exe{prj} - rm prj-cfg/prj/prj/obje{prj} - rm prj-cfg/prj/fsdir{prj/} + $build 'clean:' prj/ 2>>~%EOE%; + %rm .+%{3} EOE $deinit 2>>/"EOE" @@ -181,30 +176,20 @@ deinit += -d prj pkg2 configured 0.1.0-a.0.19700101000000#1 EOE - $build prj/pkg1/ 2>>/~%EOE%; - %mkdir prj-cfg1/.+%{2} - %.{3} - %ld prj-cfg1/.+%{2} - ln prj-cfg1/pkg1/pkg1/exe{pkg1} -> prj/pkg1/pkg1/ + $build prj/pkg1/ 2>>~%EOE%; + %(mkdir|version\.in|c\+\+|ld|ln) .+%{8} EOE - $build prj/pkg2/ 2>>/EOE; - mkdir prj-cfg1/pkg2/fsdir{pkg2/} - c++ prj/pkg2/pkg2/cxx{pkg2}@prj-cfg1/pkg2/pkg2/ - ld prj-cfg1/pkg2/pkg2/exe{pkg2} - ln prj-cfg1/pkg2/pkg2/exe{pkg2} -> prj/pkg2/pkg2/ + $build prj/pkg2/ 2>>~%EOE%; + %(mkdir|c\+\+|ld|ln) .+%{4} EOE - $build 'clean:' prj/pkg1/ 2>>/EOE; - rm prj-cfg1/pkg1/pkg1/exe{pkg1} - rm prj-cfg1/pkg1/pkg1/obje{pkg1} - rm prj-cfg1/pkg1/fsdir{pkg1/} + $build 'clean:' prj/pkg1/ 2>>~%EOE%; + %rm .+%{3} EOE - $build 'clean:' prj/pkg2/ 2>>/EOE; - rm prj-cfg1/pkg2/pkg2/exe{pkg2} - rm prj-cfg1/pkg2/pkg2/obje{pkg2} - rm prj-cfg1/pkg2/fsdir{pkg2/} + $build 'clean:' prj/pkg2/ 2>>~%EOE%; + %rm .+%{3} EOE $deinit 2>>/"EOE" diff --git a/tests/test.test b/tests/test.test index 33952d5..4ee43e0 100644 --- a/tests/test.test +++ b/tests/test.test @@ -15,11 +15,8 @@ deinit += -d prj { $new -C @cfg prj $cxx &prj/*** &prj-cfg/***; - $* -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} - test prj/prj/test{testscript}@prj-cfg/prj/prj/ prj-cfg/prj/prj/exe{prj} + $* -d prj 2>>~%EOE%; + %(mkdir|c\+\+|ld|test) .+%{4} EOE $deinit 2>>/"EOE" @@ -87,10 +84,7 @@ deinit += -d prj % new libprj.+ \\\(required by pkg1\\\)% % upgrade pkg1.+19700101000000#1% % upgrade pkg2.+19700101000000#1% - mkdir prj-cfg1/pkg2/fsdir{pkg2/} - c++ prj/pkg2/pkg2/cxx{pkg2}@prj-cfg1/pkg2/pkg2/ - ld prj-cfg1/pkg2/pkg2/exe{pkg2} - test prj/pkg2/pkg2/test{testscript}@prj-cfg1/pkg2/pkg2/ prj-cfg1/pkg2/pkg2/exe{pkg2} + %\(mkdir|c\\+\\+|ld|test\) .+%{4} EOE $* @cfg2 -d prj/pkg2 2>>/~"%EOE%"; # By name (cfg2). @@ -99,21 +93,14 @@ deinit += -d prj % new libprj.+ \\\(required by pkg1\\\)% % upgrade pkg1.+19700101000000#1% % upgrade pkg2.+19700101000000#1% - mkdir prj-cfg2/pkg2/fsdir{pkg2/} - c++ prj/pkg2/pkg2/cxx{pkg2}@prj-cfg2/pkg2/pkg2/ - ld prj-cfg2/pkg2/pkg2/exe{pkg2} - test prj/pkg2/pkg2/test{testscript}@prj-cfg2/pkg2/pkg2/ prj-cfg2/pkg2/pkg2/exe{pkg2} + %\(mkdir|c\\+\\+|ld|test\) .+%{4} EOE - $* -a --recursive -d prj/pkg1 2>>/~%EOE% # All configs recursive. + $* -a --recursive -d prj/pkg1 2>>~%EOE% # All configs recursive. in configuration @cfg1: - %mkdir prj-cfg1/.+%{3} - %.{7} - %test prj.+%{2} + %(mkdir|version\.in|c\+\+|ld|test) .+%{12} in configuration @cfg2: - %mkdir prj-cfg2/.+%{3} - %.{7} - %test prj.+%{2} + %(mkdir|version\.in|c\+\+|ld|test) .+%{12} EOE } diff --git a/tests/update.test b/tests/update.test index de6aa22..ed4bbd2 100644 --- a/tests/update.test +++ b/tests/update.test @@ -18,16 +18,12 @@ deinit += -d prj { $new -C @cfg prj $cxx &prj/*** &prj-cfg/***; - $* -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} + $* -d prj 2>>~%EOE%; + %(mkdir|c\+\+|ld) .+%{3} 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/} + $clean -d prj 2>>~%EOE%; + %rm .+%{3} EOE $deinit 2>>/"EOE" @@ -50,58 +46,38 @@ deinit += -d prj # 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} + $* -d prj/pkg1 2>>~%EOE%; # Default (cfg1). + %(mkdir|c\+\+|ld) .+%{3} 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} + $* @cfg2 -d prj/pkg1 2>>~%EOE%; # By name (cfg2). + %(mkdir|c\+\+|ld) .+%{3} EOE - $* --all -d prj 2>>/EOE; # All configs (and packages). + $* --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 + %(mkdir|c\+\+|ld|info:) .+%{4} 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 + %(mkdir|c\+\+|ld|info:) .+%{4} 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/} + $clean -d prj/pkg1 2>>~%EOE%; # Default (cfg1). + %rm .+%{3} 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/} + $clean @cfg2 -d prj/pkg1 2>>~%EOE%; # By name (cfg2). + %rm .+%{3} EOE - $clean --all -d prj 2>>/EOE; # All configs (and packages). + $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 + %(rm|info:) .+%{4} 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 + %(rm|info:) .+%{4} EOE $deinit 2>>/"EOE" |