| 1 |
""" |
| 2 |
Test basic crate configuration |
| 3 |
""" |
| 4 |
|
| 5 |
from drivers.alr import run_alr |
| 6 |
from drivers.asserts import assert_eq |
| 7 |
from drivers.helpers import contents |
| 8 |
|
| 9 |
import os |
| 10 |
|
| 11 |
# Get and check post fetch action |
| 12 |
run_alr('get', 'hello_world', quiet=False, debug=True) |
| 13 |
os.chdir("hello_world_0.1.0_filesystem/") |
| 14 |
|
| 15 |
run_alr('build', quiet=False, debug=True) |
| 16 |
p = run_alr('run') |
| 17 |
assert_eq("Ada -> Var_Bool: TRUE\n" |
| 18 |
"Ada -> Var_String: 'Test string.'\n" |
| 19 |
"Ada -> Var_Int: -1\n" |
| 20 |
"Ada -> Var_Real: -1.000000000E+00\n" |
| 21 |
"Ada -> Var_Enum: B\n", |
| 22 |
p.out) |
| 23 |
|
| 24 |
assert not os.path.isdir('config'), "config should not be created for root project" |
| 25 |
|
| 26 |
for top, dirs, files in os.walk('./'): |
| 27 |
for nm in files: |
| 28 |
path = os.path.join(top, nm) |
| 29 |
if 'plop_config' in path: |
| 30 |
assert not path.endswith('.h'), "C header should not be generated" |
| 31 |
assert not path.endswith('.gpr'), "GPR should not be generated" |
| 32 |
|
| 33 |
print(p.out) |
| 34 |
|
| 35 |
print('SUCCESS') |