Files
Pierre-Marie de Rodat 3b2cc33db3 Project provider: introduce dedicated exception and clarify doc
This commit also switches custom exception to Langkit's new mechanism to
handle these automatically in all language bindings.

TN: U518-009
2021-06-23 17:09:59 +02:00

28 lines
591 B
Python

"""
Test that libadalang.UnitProvider.for_project can resolve the designated
project from its path.
"""
import libadalang
def try_load(*args, **kwargs):
try:
libadalang.UnitProvider.for_project(*args, **kwargs)
except Exception as exc:
print(' exception {}: {}'.format(type(exc).__name__, exc))
else:
print(' success')
print('Load without project scope')
try_load('agg.gpr')
print('Load with ambiguous scope')
try_load('agg.gpr', project='arch')
print('Load with a project scope')
try_load('agg.gpr', project='arch32/arch.gpr')
print('Done.')