-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
""" | ||
Test "executable" only appears in --bin initializations | ||
Test --chdir switch. | ||
""" | ||
|
||
import os.path | ||
import os | ||
|
||
from drivers.alr import run_alr | ||
from drivers.asserts import assert_match | ||
from drivers.helpers import content_of | ||
|
||
test_dir = os.getcwd() | ||
|
||
# Binary crate | ||
# Make a binary crate in test that it runs without cd'ing. | ||
run_alr("init", "--bin", "xxx") | ||
assert_match(".*executables = \[", content_of("xxx/alire.toml")) | ||
|
||
# Check that it builds and runs | ||
run_alr("--chdir=xxx", "run") | ||
|
||
# Test that changing to a non-existent directory fails. Technically, | ||
# /dev/null/cantexist can exist, but it's more than reasonable to assume a | ||
# system with this directory has bigger issues. | ||
bad_chdir = run_alr("-C", "/dev/null/cantexist", "run", complain_on_error=False) | ||
assert_match(".*directory \"/dev/null/cantexist\" does not exist.*", bad_chdir.out) | ||
|
||
print('SUCCESS') |