File: test.py

package info (click to toggle)
alire 1.2.1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 13,124 kB
  • sloc: ada: 77,497; python: 6,605; sh: 477; ansic: 347; makefile: 258; javascript: 87; xml: 40
file content (32 lines) | stat: -rw-r--r-- 776 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Test "executable" only appears in --bin initializations
"""

import os.path

from drivers.alr import run_alr
from drivers.asserts import assert_match
from drivers.helpers import content_of

test_dir = os.getcwd()

# Binary crate
run_alr("init", "--bin", "xxx")
assert_match(".*executables = \[", content_of("xxx/alire.toml"))

# Check that it builds and runs
os.chdir("xxx")
run_alr("run")

# Library crate must not provide an executable
os.chdir("..")
run_alr("init", "--lib", "yyy")
assert ".*executables = [" not in content_of("xxx/alire.toml"), \
    "Unexpected contents in manifest"

# Check the default executable is not built/runnable
os.chdir("yyy")
p = run_alr("run", complain_on_error=False)
assert_match(".*Executable .* not found.*", p.out)

print('SUCCESS')