aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test/script/builtin/cp.testscript25
1 files changed, 10 insertions, 15 deletions
diff --git a/tests/test/script/builtin/cp.testscript b/tests/test/script/builtin/cp.testscript
index aa16465..0d465e4 100644
--- a/tests/test/script/builtin/cp.testscript
+++ b/tests/test/script/builtin/cp.testscript
@@ -358,32 +358,27 @@ if ($cxx.target.class != 'windows')
EOE
}
- # @@ Temporary disable the test as it may fail if the package is fetched
- # from the git repository location. Note that the used `ls -l` command
- # displays the filesystem entry modification time with the minute
- # resolution and the build2 dist meta-operation doesn't preserve the
- # directory modification time. That's why the test command may
- # unexpectedly succeed.
- #
- # One way to fix it is to instruct ls to show time with at least the
- # second resolution. There is no portable way for that across different
- # OSes but all of them seems to provide some option to achieve that.
- #
-#\
: dir
:
+ : Note that the `ls -l` command by default displays the filesystem entry
+ : modification time with the minute resolution and the build2 dist
+ : meta-operation (involved when we fetch from the git repository
+ : location) doesn't preserve the directory modification time. That's why
+ : we also pass --full-time and enable the test for only platforms where ls
+ : supports this option.
+ :
+ if ($cxx.target.class == 'linux')
{
$c <<"EOI" && $b 2>>~%EOE% != 0
- ls -l $src_base | sed -n -e '$ds' | \
+ ls -l --full-time $src_base | sed -n -e '$ds' | \
set t;
cp -r $src_base/cp-dir ./;
- ls -l | sed -n -e '$ds' >"\$t"
+ ls -l --full-time | sed -n -e '$ds' >"\$t"
EOI
%.+ error: sed stdout doesn't match expected%
%.+
EOE
}
-#\
}
}