diff options
Diffstat (limited to 'tests/rep-fetch.testscript')
-rw-r--r-- | tests/rep-fetch.testscript | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/tests/rep-fetch.testscript b/tests/rep-fetch.testscript index bc52f2e..b713c0c 100644 --- a/tests/rep-fetch.testscript +++ b/tests/rep-fetch.testscript @@ -1,5 +1,4 @@ # file : tests/rep-fetch.testscript -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file .include common.testscript \ @@ -67,9 +66,11 @@ # | # `-- git/* (see rep-fetch-git.testscript) +posix = ($cxx.target.class != 'windows') + # Prepare repositories used by tests if running in the local mode. # -+if ($remote != true) ++if! $remote rep_create += 2>! # Create the signed 'hello' repository. @@ -458,7 +459,7 @@ y' : For dir repository tests we will reuse local git repositories, that have the : same repository structure. : -if ($remote != true) +if! $remote { rep_add += --type dir @@ -475,14 +476,23 @@ if ($remote != true) +$clone_cfg && $rep_add $rep/libbar.git + d = $canonicalize($rep) + + # Note that on Windows the local repository canonical name path part is + # converted to lower case. + # + if! $posix + d = [dir_path] $string.lcase($d) + end + : prerequisites : { $clone_cfg; $* 2>>"EOE"; - fetching dir:($rep/libbar.git) - fetching dir:($rep/style-basic.git) \(prerequisite of dir:($rep/libbar.git)\) + fetching dir:($d/libbar.git) + fetching dir:($d/style-basic.git) \(prerequisite of dir:($d/libbar.git)\) 3 package\(s\) in 2 repository\(s\) EOE @@ -501,8 +511,8 @@ if ($remote != true) $clone_cfg; $* 2>!; - $* "dir:($rep/libbar.git)" 2>>"EOE"; - fetching dir:($rep/style-basic.git) \(prerequisite of dir:($rep/libbar.git)\) + $* "dir:($d/libbar.git)" 2>>"EOE"; + fetching dir:($d/style-basic.git) \(prerequisite of dir:($d/libbar.git)\) 3 package\(s\) in 2 repository\(s\) EOE @@ -523,7 +533,7 @@ if ($remote != true) $clone_cfg; $* 2>!; - $* --shallow "dir:($rep/libbar.git)" 2>>"EOE"; + $* --shallow "dir:($d/libbar.git)" 2>>"EOE"; 3 package\(s\) in 2 repository\(s\) EOE @@ -539,8 +549,8 @@ if ($remote != true) $clone_cfg; $* --shallow 2>>"EOE"; - fetching dir:($rep/libbar.git) - fetching dir:($rep/style-basic.git) \(prerequisite of dir:($rep/libbar.git)\) + fetching dir:($d/libbar.git) + fetching dir:($d/style-basic.git) \(prerequisite of dir:($d/libbar.git)\) 3 package\(s\) in 2 repository\(s\) EOE @@ -621,11 +631,15 @@ if ($remote != true) : unchanged-external : + : Test that iteration is still incremented when a non-external package + : from a pkg repository is switched to the same unedited external + : package. + : { $clone_cfg && $rep_add $src/libhello-1.0.0; $* 2>!; - $pkg_status libhello >'libhello unpacked 1.0.0' + $pkg_status libhello >'libhello unpacked 1.0.0 available 1.0.0#1' } : changed-external @@ -645,7 +659,10 @@ if ($remote != true) : git-rep : - if ($git_supported == true && $remote != true) + : Test that iteration is still incremented when a non-external package + : from a git repository is switched to the same unedited external package. + : + if ($git_supported && !$remote) { rep = $canonicalize([dir_path] $out_git/state0); @@ -658,7 +675,7 @@ if ($remote != true) $rep_add $rep/style.git; $* 2>!; - $pkg_status style >"style unpacked 1.0.0"; + $pkg_status style >"style unpacked 1.0.0 available 1.0.0#1"; $pkg_purge style 2>"purged style/1.0.0" } @@ -684,7 +701,7 @@ if ($remote != true) : git-rep : -if ($git_supported != true) +if! $git_supported { # Skip git repository tests. # @@ -693,7 +710,7 @@ else { : proto : - if ($remote != true) + if! $remote { git_protocol = 'local' .include rep-fetch-git.testscript @@ -737,7 +754,7 @@ else : ssh : - if ($git_ssh == true) + if $git_ssh { git_protocol = 'ssh' .include rep-fetch-git.testscript @@ -745,7 +762,7 @@ else : ssh-unadv : - if ($git_ssh == true) + if $git_ssh { git_protocol = 'ssh-unadv' .include rep-fetch-git.testscript @@ -758,14 +775,14 @@ else : extension does not exist but the one without the extension does, then : it is picked up by rep-fetch. : - if ($remote != true) + if! $remote { cp -r $out_git/state0/libbar.git libbar.git; cp -r $out_git/state0/style-basic.git style-basic; $clone_root_cfg; - rep = ($cxx.target.class != 'windows' \ + rep = ($posix \ ? "file:$~" \ : "file:/$regex.replace($~, '\\', '/')"); @@ -817,7 +834,7 @@ else : Test that repository is re-fetched on the location change. Here it happens : due to the scheme change. : - if ($remote == true) + if $remote { $clone_root_cfg && $rep_add "$rep_git_git/state0/libfoo.git#master"; $* 2>! &cfg/.bpkg/repos/*/***; |