diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/common.test | 13 | ||||
-rw-r--r-- | tests/config.test | 30 | ||||
-rw-r--r-- | tests/init.test | 29 | ||||
-rw-r--r-- | tests/new.test | 10 | ||||
-rw-r--r-- | tests/publish.test | 15 | ||||
-rw-r--r-- | tests/status.test | 16 | ||||
-rw-r--r-- | tests/sync.test | 30 | ||||
-rw-r--r-- | tests/test.test | 8 |
8 files changed, 73 insertions, 78 deletions
diff --git a/tests/common.test b/tests/common.test index f532d76..80d37d3 100644 --- a/tests/common.test +++ b/tests/common.test @@ -30,13 +30,10 @@ end +echo "$git_version" | sed -e 's/(\d+).*/\1/' | set git_version_major +echo "$git_version" | sed -e 's/\d+\.(\d+).*/\1/' | set git_version_minor -# This flag must be used by testscripts to decide if they should skip git -# repository-related tests or adjust bdep commands. Note that specific command -# tests may still adjust this flag to express the higher requirements for the -# minimum supported git version. -# -git_supported = ($git_version_major > 2 || \ - $git_version_major == 2 && $git_version_minor >= 1) ++if! ($git_version_major > 2 || \ + $git_version_major == 2 && $git_version_minor >= 1) + exit "minimum supported git version is 2.1" +end # Helper commands that can be used by tests to prepare the testing environment # or validate an outcome of the command being tested. They are likely to get @@ -50,7 +47,7 @@ clean = $* clean deinit = $* deinit init = $* init fetch = $* fetch -new = $* new --no-checks --vcs ($git_supported ? git : none) +new = $* new --no-checks status = $* status sync = $* sync update = $* update diff --git a/tests/config.test b/tests/config.test index 7c03286..5beabcf 100644 --- a/tests/config.test +++ b/tests/config.test @@ -31,10 +31,10 @@ deinit += -d prj $init @cfg 2>>/~"%EOE%"; initializing in project $~/prj/ synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE - $status >~'%prj configured 0\.1\.0-a\.0\..+%'; + $status >'prj configured 0.1.0-a.0.19700101000000'; $* list @cfg >>/"EOO"; @cfg $~/cfg-dir/ 1 default,forwarded,auto-synchronized @@ -65,10 +65,10 @@ deinit += -d prj $init @cfg 2>>/~"%EOE%"; initializing in project $~/prj/ synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE - $status >~'%prj configured 0\.1\.0-a\.0\..+%'; + $status >'prj configured 0.1.0-a.0.19700101000000'; $* list >>/"EOO"; @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized @@ -99,10 +99,10 @@ deinit += -d prj $init -c cfg 2>>/~"%EOE%"; initializing in project $~/prj/ synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE - $status >~'%prj configured 0\.1\.0-a\.0\..+%'; + $status >'prj configured 0.1.0-a.0.19700101000000'; $* list >>/"EOO"; $~/cfg/ 1 default,forwarded,auto-synchronized @@ -162,19 +162,19 @@ deinit += -d prj initializing in project $~/prj/ in configuration @cfg1: synchronizing: - % new prj.+% + % new prj.+19700101000000% in configuration @cfg2: synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE - $status --all >>~%EOO%; + $status --all >>EOO; in configuration @cfg1: - %prj configured 0\.1\.0-a\.0\..+% + prj configured 0.1.0-a.0.19700101000000 in configuration @cfg2: - %prj configured 0\.1\.0-a\.0\..+% + prj configured 0.1.0-a.0.19700101000000 EOO $* list >>/"EOO"; @@ -218,7 +218,7 @@ deinit += -d prj $init @cfg 2>>/~"%EOE%"; initializing in project $~/prj/ synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE mv prj-cfg prj-cfg2; @@ -252,7 +252,7 @@ deinit += -d prj $init @cfg 2>>/~"%EOE%"; initializing in project $~/prj/ synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE $* rename @cfg cfg2 2>>/"EOE"; @@ -300,8 +300,8 @@ deinit += -d prj removed configuration @cfg1 $~/prj-cfg1/ 1 EOE - $status --all >>~%EOO%; - %prj configured 0\.1\.0-a\.0\..+% + $status --all >>EOO; + prj configured 0.1.0-a.0.19700101000000 EOO $* list >>/"EOO"; diff --git a/tests/init.test b/tests/init.test index 2fb3945..8915189 100644 --- a/tests/init.test +++ b/tests/init.test @@ -24,13 +24,13 @@ deinit += -d prj initializing in project $~/prj/ created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE sed -n -e 's/^config.cc.poptions = (.+)$/\1/p' prj-cfg/build/config.build \ >'-DTEST'; - $status >~'%prj configured 0\.1\.0-a\.0\..+%'; + $status >'prj configured 0.1.0-a.0.19700101000000'; $build prj/ 2>>/EOE; mkdir prj-cfg/prj/fsdir{prj/} @@ -72,22 +72,22 @@ deinit += -d prj initializing in project $~/prj/ added configuration @cfg1 $~/prj-cfg1/ 1 default,forwarded,auto-synchronized synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE $* -A prj-cfg2 @cfg2 2>>/~"%EOE%"; initializing in project $~/prj/ added configuration @cfg2 $~/prj-cfg2/ 2 auto-synchronized synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE - $status --all >>~%EOO%; + $status --all >>EOO; in configuration @cfg1: - %prj configured 0\.1\.0-a\.0\..+% + prj configured 0.1.0-a.0.19700101000000 in configuration @cfg2: - %prj configured 0\.1\.0-a\.0\..+% + prj configured 0.1.0-a.0.19700101000000 EOO $build prj-cfg1/ 2>>/~%EOE%; @@ -134,10 +134,10 @@ deinit += -d prj initializing in project $~/prj/ created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE - $status >~'%prj configured 0\.1\.0-a\.0\..+%'; + $status >'prj configured 0.1.0-a.0.19700101000000'; $build prj/ 2>>/EOE; mkdir prj-cfg/prj/fsdir{prj/} @@ -150,10 +150,7 @@ deinit += -d prj # mkdir --no-cleanup prj/prj.pkg; - mv prj/prj prj/build prj/buildfile prj/manifest prj/prj.pkg/; - if ($git_supported) - mv prj/.gitignore prj/prj.pkg/ - end; + mv prj/prj prj/build prj/buildfile prj/manifest prj/.gitignore prj/prj.pkg/; mv prj/prj.pkg prj/prj; cat <<EOI >=prj/packages.manifest; @@ -170,8 +167,8 @@ deinit += -d prj $init --all -d prj/libprj 2>>/~"%EOE%"; initializing in project $~/prj/ synchronizing: - % upgrade prj.+#1% - % new libprj.+% + % upgrade prj.+19700101000000#1% + % new libprj.+19700101000000% EOE # Factor out some of the executable package functionality into the library. @@ -204,7 +201,7 @@ deinit += -d prj $build prj-cfg/prj/ 2>>/~"%EOE%"; synchronizing $~/prj-cfg/: - % upgrade prj.+#2% + % upgrade prj.+19700101000000#2% %mkdir prj-cfg/.+%{2} %.{3} %ld prj-cfg/.+%{2} diff --git a/tests/new.test b/tests/new.test index 089be60..3a62df3 100644 --- a/tests/new.test +++ b/tests/new.test @@ -6,7 +6,7 @@ # Disable nesting checks in the created projects. # -test.arguments += --no-checks --vcs ($git_supported ? git : none) +test.arguments += --no-checks cxx = "config.cxx=$config.cxx" @@ -104,10 +104,10 @@ status += -d prj created new executable project prj in $~/prj/ created configuration @cfg $~/prj-config/ 1 default,forwarded,auto-synchronized synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE - $status >~'%prj configured 0\.1\.0-a\.0\..+%'; + $status >'prj configured 0.1.0-a.0.19700101000000'; $build prj/ 2>>/EOE mkdir prj-config/prj/fsdir{prj/} @@ -129,10 +129,10 @@ status += -d prj created new executable project prj in $~/prj/ created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized synchronizing: - % new prj.+% + % new prj.+19700101000000% EOE - $status >~'%prj configured 0\.1\.0-a\.0\..+%'; + $status >'prj configured 0.1.0-a.0.19700101000000'; $build prj/ 2>>/EOE mkdir prj-cfg/prj/fsdir{prj/} diff --git a/tests/publish.test b/tests/publish.test index 8541d9c..d8d86d8 100644 --- a/tests/publish.test +++ b/tests/publish.test @@ -4,6 +4,14 @@ .include common.test project.test +# bdep-publish requirements for the minimum supported git version are higher +# then the default 2.1 (see bdep/publish.cxx for details). +# ++if! ($git_version_major > 2 || \ + $git_version_major == 2 && $git_version_minor >= 12) + exit +end + # Repository to use for the package submissions simulation. # # Note: could use empty config.bdep.test.repository value to suppress @@ -24,12 +32,6 @@ init += $cxx -d prj 2>! &prj/**/bootstrap/*** windows = ($cxx.target.class == 'windows') -# bdep-publish requirements for the minimum supported git version are higher -# then the default 2.1 (see bdep/publish.cxx for details). -# -git_supported = ($git_version_major > 2 || \ - $git_version_major == 2 && $git_version_minor >= 12) - # Note that using the same package name and version for tests may result in # duplicate submissions. We will use unique version for each test, # incrementing the patch version for 1.0.X. @@ -230,7 +232,6 @@ git_supported = ($git_version_major > 2 || \ : control : -if ($git_supported) { # The control repository URL doesn't really matter for the submission # simulation. We specify it to enable the control branch-related diff --git a/tests/status.test b/tests/status.test index 12ccc34..676dac0 100644 --- a/tests/status.test +++ b/tests/status.test @@ -29,7 +29,7 @@ deinit += -d prj $init -C @cfg &prj-cfg/***; - $* >~'%prj configured 0\.1\.0-a\.0\..+%'; + $* >'prj configured 0.1.0-a.0.19700101000000'; $deinit 2>>/"EOE" deinitializing in project $~/prj/ @@ -46,14 +46,14 @@ deinit += -d prj $init -C @cfg1 &prj-cfg1/***; $init -C @cfg2 &prj-cfg2/***; - $* @cfg2 >~'%prj configured 0\.1\.0-a\.0\..+%'; + $* @cfg2 >'prj configured 0.1.0-a.0.19700101000000'; - $* --all >>~%EOO%; + $* --all >>EOO; in configuration @cfg1: - %prj configured 0\.1\.0-a\.0\..+% + prj configured 0.1.0-a.0.19700101000000 in configuration @cfg2: - %prj configured 0\.1\.0-a\.0\..+% + prj configured 0.1.0-a.0.19700101000000 EOO $deinit 2>>/"EOE" @@ -83,8 +83,8 @@ deinit += -d prj depends: libprj EOI - $* --recursive >>~%EOO% 2>>/"EOE"; # Note: implicitly fetches in cfg. - %prj configured 0\.1\.0-a\.0\..+ available 0\.1\.0-a\.0\..+#1% + $* --recursive >>EOO 2>>/"EOE"; # Note: implicitly fetches in cfg. + prj configured 0.1.0-a.0.19700101000000 available 0.1.0-a.0.19700101000000#1 EOO fetching dir:$~/libprj \(prerequisite of dir:$~/prj\) EOE @@ -92,7 +92,7 @@ deinit += -d prj $sync; $* --recursive >>~%EOO%; - %prj configured 0\.1\.0-a\.0\..+#1% + prj configured 0.1.0-a.0.19700101000000#1 % libprj configured 0.+% EOO diff --git a/tests/sync.test b/tests/sync.test index 842c2e1..c086a02 100644 --- a/tests/sync.test +++ b/tests/sync.test @@ -55,11 +55,11 @@ deinit += -d prj fetching dir:$~/libprj \(prerequisite of dir:$~/prj\) synchronizing: % new libprj.+ \\\(required by prj\\\)% - % upgrade prj.+#1% + % upgrade prj.+19700101000000#1% EOE - $status >>~"%EOO%"; - %prj configured 0\.1\.0-a\.0\..+#1% + $status >>~%EOO%; + prj configured 0.1.0-a.0.19700101000000#1 % libprj configured 0.+% EOO @@ -140,19 +140,19 @@ deinit += -d prj fetching dir:$~/libprj \(prerequisite of dir:$~/prj\) synchronizing: % new libprj.+ \\\(required by pkg1\\\)% - % upgrade pkg1.+#1% - % upgrade pkg2.+#1% + % upgrade pkg1.+19700101000000#1% + % upgrade pkg2.+19700101000000#1% EOE $status >>~%EOO% 2>>/~"%EOE%"; # Note: implicitly fetches into cfg2. in configuration @cfg1: - %pkg1 configured 0\.1\.0-a\.0\..+#1% + pkg1 configured 0.1.0-a.0.19700101000000#1 % libprj configured 0.+% - %pkg2 configured 0\.1\.0-a\.0\..+#1% + pkg2 configured 0.1.0-a.0.19700101000000#1 in configuration @cfg2: - %pkg1 configured 0\.1\.0-a\.0\..+ available 0\.1\.0-a\.0\..+#1% - %pkg2 configured 0\.1\.0-a\.0\..+ available 0\.1\.0-a\.0\..+#1% + pkg1 configured 0.1.0-a.0.19700101000000 available 0.1.0-a.0.19700101000000#1 + pkg2 configured 0.1.0-a.0.19700101000000 available 0.1.0-a.0.19700101000000#1 EOO fetching dir:$~/libprj \(prerequisite of dir:$~/prj\) EOE @@ -165,20 +165,20 @@ deinit += -d prj in configuration @cfg2: synchronizing: % new libprj.+ \(required by pkg1\)% - % upgrade pkg1/0\.1\.0-a\.0\..+#1% - % upgrade pkg2/0\.1\.0-a\.0\..+#1% + upgrade pkg1/0.1.0-a.0.19700101000000#1 + upgrade pkg2/0.1.0-a.0.19700101000000#1 EOE $status >>~%EOE%; in configuration @cfg1: - %pkg1 configured 0\.1\.0-a\.0\..+#1% + pkg1 configured 0.1.0-a.0.19700101000000#1 % libprj configured 0.+% - %pkg2 configured 0\.1\.0-a\.0\..+#1% + pkg2 configured 0.1.0-a.0.19700101000000#1 in configuration @cfg2: - %pkg1 configured 0\.1\.0-a\.0\..+#1% + pkg1 configured 0.1.0-a.0.19700101000000#1 % libprj configured 0.+% - %pkg2 configured 0\.1\.0-a\.0\..+#1% + pkg2 configured 0.1.0-a.0.19700101000000#1 EOE $build prj/pkg1/ 2>>/~%EOE%; diff --git a/tests/test.test b/tests/test.test index 713a25f..33952d5 100644 --- a/tests/test.test +++ b/tests/test.test @@ -85,8 +85,8 @@ deinit += -d prj fetching dir:$~/libprj \(prerequisite of dir:$~/prj\) synchronizing: % new libprj.+ \\\(required by pkg1\\\)% - % upgrade pkg1.+#1% - % upgrade pkg2.+#1% + % 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} @@ -97,8 +97,8 @@ deinit += -d prj fetching dir:$~/libprj \(prerequisite of dir:$~/prj\) synchronizing: % new libprj.+ \\\(required by pkg1\\\)% - % upgrade pkg1.+#1% - % upgrade pkg2.+#1% + % 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} |