-
-
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
8 changed files
with
124 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
with AAA.Enum_Tools; | ||
|
||
with Alire.Platforms; | ||
|
||
package body Alire.Config.Checks is | ||
|
||
function Is_Valid is | ||
new AAA.Enum_Tools.Is_Valid (Alire.Platforms.Known_Distributions); | ||
|
||
------------------ | ||
-- Valid_Distro -- | ||
------------------ | ||
|
||
function Valid_Distro (Key : CLIC.Config.Config_Key; | ||
Value : TOML.TOML_Value) | ||
return Boolean | ||
is (Value.Kind in TOML.TOML_String | ||
and then Is_Valid (Value.As_String)); | ||
|
||
end Alire.Config.Checks; |
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,9 @@ | ||
with TOML; | ||
|
||
package Alire.Config.Checks is | ||
|
||
function Valid_Distro (Key : CLIC.Config.Config_Key; | ||
Value : TOML.TOML_Value) | ||
return Boolean; | ||
|
||
end Alire.Config.Checks; |
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
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,23 @@ | ||
""" | ||
Verify that distro overridding works as intended | ||
""" | ||
|
||
from drivers.alr import run_alr, distro_is_known | ||
from drivers.asserts import assert_match | ||
|
||
# Overriding distro detection. We force Debian as our tests run in Ubuntu and | ||
# many other distros so it is only giving a false positive on Debian. | ||
run_alr("config", "--global", | ||
"--set", "distribution.override", "debian") | ||
|
||
assert_match(".*distribution:[^\n]*DEBIAN", | ||
run_alr("version").out) | ||
|
||
# Disabling distro detection takes precedence | ||
run_alr("config", "--global", | ||
"--set", "distribution.disable_detection", "true") | ||
|
||
assert_match(".*distribution:[^\n]*DISTRIBUTION_UNKNOWN", | ||
run_alr("version").out) | ||
|
||
print('SUCCESS') |
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,3 @@ | ||
driver: python-script | ||
indexes: | ||
basic_index: {} |