aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-07-05 12:53:38 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-07-05 13:54:46 +0300
commit30b4eda196e090aa820d312e6a9435a4ae84c303 (patch)
tree6f5be5384a3d371d21247dec053e44797bfdb991 /tests
parentee0456ed4a5f3f6686fbb0a433161d1f9d8535fe (diff)
Fix failing testscript cp builtin test
Diffstat (limited to 'tests')
-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
}
-#\
}
}