-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: testing of indexed crates with
alr test --full
(#1786)
* fix: testing of remote crates with `alr test` * Expand test to ensure all invocations work * Improve command description
- Loading branch information
Showing
5 changed files
with
198 additions
and
82 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
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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
""" | ||
Check that the default "get & build" test for remote crates in `alr test` works | ||
""" | ||
|
||
import re | ||
import os | ||
|
||
from drivers.alr import run_alr | ||
from drivers.asserts import assert_match, assert_in_file | ||
from drivers.helpers import content_of | ||
from e3.fs import rm | ||
from glob import glob | ||
|
||
test_args = [ | ||
["--full"], # No arguments (all crates) | ||
["hello"], # Subset of crates | ||
["--search", "hell"], # Subset given as substring | ||
] | ||
|
||
for args in test_args: | ||
|
||
# Enter an empty folder | ||
|
||
if os.path.exists("t"): | ||
rm("t", recursive=True) | ||
os.mkdir("t") | ||
os.chdir("t") | ||
|
||
run_alr("test", *args) # Should not err | ||
|
||
# Check test outcome | ||
assert_match(".*" + | ||
re.escape("pass:hello=1.0.0") + ".*" + | ||
re.escape("pass:hello=1.0.1") + ".*", | ||
content_of(glob("*.txt")[0])) | ||
|
||
# Check the build is performed in release mode | ||
assert_in_file(os.path.join(glob("hello_1.0.1_*")[0], "config", "hello_config.gpr"), | ||
'Build_Profile : Build_Profile_Kind := "release";') | ||
|
||
os.chdir("..") | ||
|
||
print('SUCCESS') |
File renamed without changes.
This file was deleted.
Oops, something went wrong.