]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/abs_workdir.py
1 # Niklaus Giger, 2005-03-15
2 # Testing whether we may run a test in absolute directories. There are no tests
3 # for temporary directories as this is implictly tested in a lot of other cases.
5 # TODO: Move to a separate testing-system test group.
11 # Python 2.7 does not implement os.path.samefile on Windows
13 if not hasattr(ntpath
, "samefile"):
16 from os
.path
.nt
import _getfinalpathname
17 return os
.path
._getfinalpathname
(f1
) == os
.path
._getfinalpathname
(f2
)
18 except (NotImplementedError, ImportError):
19 return os
.path
.abspath(f1
) == os
.path
.abspath(f2
)
21 ntpath
.samefile
= samefile
23 t
= BoostBuild
.Tester(["-ffile.jam"], workdir
=os
.getcwd(), pass_d0
=False,
26 t
.write("file.jam", "EXIT [ PWD ] : 0 ;")
29 t
.fail_test(not os
.path
.samefile(t
.stdout().rstrip("\n"), os
.getcwd()))
32 t
.run_build_system(status
=123, subdir
="/must/fail/with/absolute/path",
34 except ValueError as e
:
35 assert "subdir" in str(e
), e
37 raise ValueError("exception expected")