-
-
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
11 changed files
with
135 additions
and
22 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
12 changes: 12 additions & 0 deletions
12
testsuite/fixtures/build_hash_index/li/libhello/libhello-0.9.0.toml
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,12 @@ | ||
description = "\"Hello, world!\" demonstration project support library" | ||
name = "libhello" | ||
version = "0.9.0" | ||
maintainers = ["[email protected]"] | ||
maintainers-logins = ["mylogin"] | ||
tags = ["libhello-tag1"] | ||
|
||
[configuration.variables] | ||
Var1={type="Boolean"} # Without default on purpose | ||
|
||
[origin] | ||
url = "file:../../../crates/libhello_1.0.0" |
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,30 @@ | ||
""" | ||
Check the different config types in the hash inputs | ||
""" | ||
|
||
from drivers.alr import alr_with, external_compiler_version, init_local_crate, run_alr | ||
from drivers.builds import hash_input | ||
from drivers.asserts import assert_eq | ||
from drivers import builds | ||
|
||
run_alr("config", "--set", "--global", "dependencies.shared", "true") | ||
|
||
init_local_crate() | ||
alr_with("hello=1.0.1") | ||
builds.sync() | ||
|
||
# Chech that the hash inputs contains exactly what we expect it to contain | ||
|
||
assert_eq( | ||
'config:hello.var1=true\n' | ||
'config:hello.var2=str\n' | ||
'config:hello.var3=A\n' | ||
'config:hello.var4=0\n' | ||
'config:hello.var5=0\n' | ||
'config:hello.var6=0.00000000000000E+00\n' | ||
'config:hello.var7=0.00000000000000E+00\n' | ||
'profile:hello=RELEASE\n' | ||
f'version:gnat_external={external_compiler_version()}\n', | ||
hash_input("hello")) | ||
|
||
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: | ||
build_hash_index: {} |
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,28 @@ | ||
""" | ||
Test that a crate with incomplete config (values without defaults) cannot be | ||
built/hashed | ||
""" | ||
|
||
import shutil | ||
from drivers.alr import alr_with, external_compiler_version, init_local_crate, run_alr | ||
from drivers.builds import find_hash, hash_input | ||
from drivers.asserts import assert_eq, assert_match | ||
from drivers import builds | ||
|
||
run_alr("config", "--set", "--global", "dependencies.shared", "true") | ||
|
||
init_local_crate() | ||
alr_with("libhello=0.9") | ||
|
||
run_alr("build", complain_on_error=False) | ||
# This must fail as there are unset config varibles, but what really we are | ||
# interested in is in checking that no build folder with an incorrect hash has | ||
# been generated | ||
|
||
try: | ||
hash = hash_input("libhello") # Must fail because no build folder exists | ||
assert False, "Build folder with incomplete config should not be hashed" | ||
except AssertionError: | ||
pass | ||
|
||
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: | ||
build_hash_index: {} |
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