mirror of
https://github.com/YosysHQ/sby.git
synced 2025-08-16 09:55:30 +00:00
Add test for copying directories
As per https://stackoverflow.com/a/54950959, `os.path.basename()` returns an empty string if the string ends with a trailing slash. This means that the target implied by `dir/` differs from an explicit target of `dir/`, and changes the behaviour to copy files to the root `src` directory instead.
This commit is contained in:
parent
32f6ac2a5a
commit
a906714c95
2 changed files with 6 additions and 2 deletions
|
@ -1,4 +1,3 @@
|
||||||
import os
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -13,6 +12,7 @@ def main():
|
||||||
assert(local_contents.strip() == 'log foo')
|
assert(local_contents.strip() == 'log foo')
|
||||||
else:
|
else:
|
||||||
assert(srcfile.is_symlink() == (task == "link"))
|
assert(srcfile.is_symlink() == (task == "link"))
|
||||||
|
assert(srcfile.name != "script.ys")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
[tasks]
|
[tasks]
|
||||||
link
|
link
|
||||||
copy
|
copy
|
||||||
|
dir_implicit: dir
|
||||||
|
dir_explicit: dir
|
||||||
|
|
||||||
[options]
|
[options]
|
||||||
mode prep
|
mode prep
|
||||||
|
@ -15,7 +17,9 @@ script dir/script.ys
|
||||||
[files]
|
[files]
|
||||||
../../docs/examples/demos/picorv32.v
|
../../docs/examples/demos/picorv32.v
|
||||||
prv32fmcmp.v
|
prv32fmcmp.v
|
||||||
dir
|
~dir: dir
|
||||||
|
dir_implicit: dir/
|
||||||
|
dir_explicit: dir/ dir/
|
||||||
|
|
||||||
[file heredoc]
|
[file heredoc]
|
||||||
log foo
|
log foo
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue