From 69d3b7af920cb2a02a692abca7402b59a1ea162c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 10 Mar 2020 14:47:02 +0300 Subject: Fix directory symlink tests failing on Windows in Developer Mode --- tests/path-entry/testscript | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'tests/path-entry/testscript') diff --git a/tests/path-entry/testscript b/tests/path-entry/testscript index 76316bf..0424dff 100644 --- a/tests/path-entry/testscript +++ b/tests/path-entry/testscript @@ -54,11 +54,13 @@ if ($test.target == $build.host) { +if ($cxx.target.class != 'windows') - lns = ln -s t l &l + lnf = ln -s t l &l + lnd = $lnf else echo 'yes' >=t if cmd /C 'mklink l t' >- 2>- &?l && cat l >'yes' - lns = cmd /C 'mklink l t' &l >- + lnf = cmd /C 'mklink l t' &l >- + lnd = cmd /C 'mklink /D l t' &l >- end jnc = cmd /C 'mklink /J l t' &l >- @@ -66,7 +68,7 @@ : symlink : - if! $empty($lns) + if! $empty($lnf) { : file : @@ -78,7 +80,7 @@ : { cat <:'abc' >=t; - $lns; + $lnf; $* -p 400 -m '2020-03-05 00:00:00' -a '2020-03-05 00:00:01' t | set ti; $* -l l >"$ti" } @@ -89,7 +91,7 @@ : { cat <:'abc' >=t; - $lns; + $lnf; $* -p 400 -m '2020-03-05 00:00:00' -a '2020-03-05 00:00:01' l | set ti; sed -n -e 's/permissions: (.+)/\1/p' <"$ti" >~/'4.{2}'/; sed -n -e 's/mtime: (.+)/\1/p' <"$ti" >'2020-03-05 00:00:00'; @@ -102,7 +104,7 @@ : { cat <:'abc' >=t; - $lns; + $lnf; $* t | set ti; sleep 2; $* -t l | set li; @@ -114,10 +116,6 @@ : dir : - : Note that the following tests may fail on Windows (see symlinks known - : issues in libbutl/filesystem.mxx). - : - if ($cxx.target.class != 'windows') { : get-info : @@ -126,10 +124,9 @@ : { mkdir t; - $lns; + $lnd; $* -p 400 -m '2020-03-05 00:00:00' -a '2020-03-05 00:00:01' t | set ti; - $* -l l >"$ti"; - $* -p 600 t >- # @@ TMP; until build2 is staged. + $* -l l >"$ti" } : set-info @@ -138,12 +135,11 @@ : { mkdir t; - $lns; + $lnd; $* -p 400 -m '2020-03-05 00:00:00' -a '2020-03-05 00:00:01' l | set ti; sed -n -e 's/permissions: (.+)/\1/p' <"$ti" >~/'4.{2}'/; sed -n -e 's/mtime: (.+)/\1/p' <"$ti" >'2020-03-05 00:00:00'; - sed -n -e 's/atime: (.+)/\1/p' <"$ti" >'2020-03-05 00:00:01'; - $* -p 600 t >- # @@ TMP; until build2 is staged. + sed -n -e 's/atime: (.+)/\1/p' <"$ti" >'2020-03-05 00:00:01' } } } @@ -161,8 +157,7 @@ mkdir t; $jnc; $* -p 400 -m '2020-03-05 00:00:00' -a '2020-03-05 00:00:01' t | set ti; - $* -l l >"$ti"; - $* -p 600 t >- # @@ TMP; until build2 is staged. + $* -l l >"$ti" } : set-info @@ -175,8 +170,7 @@ $* -p 400 -m '2020-03-05 00:00:00' -a '2020-03-05 00:00:01' l | set ti; sed -n -e 's/permissions: (.+)/\1/p' <"$ti" >~/'4.{2}'/; sed -n -e 's/mtime: (.+)/\1/p' <"$ti" >'2020-03-05 00:00:00'; - sed -n -e 's/atime: (.+)/\1/p' <"$ti" >'2020-03-05 00:00:01'; - $* -p 600 t >- # @@ TMP; until build2 is staged. + sed -n -e 's/atime: (.+)/\1/p' <"$ti" >'2020-03-05 00:00:01' } } } -- cgit v1.1