|author||Karen Arutyunov <firstname.lastname@example.org>||2019-07-05 12:53:38 +0300|
|committer||Karen Arutyunov <email@example.com>||2019-07-05 13:54:46 +0300|
Fix failing testscript cp builtin test
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
@@ -358,32 +358,27 @@ if ($cxx.target.class != 'windows')
- # @@ 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.
+ : 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' | \
cp -r $src_base/cp-dir ./;
- ls -l | sed -n -e '$ds' >"\$t"
+ ls -l --full-time | sed -n -e '$ds' >"\$t"
%.+ error: sed stdout doesn't match expected%