Skip to content

Commit

Permalink
New test
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Nov 12, 2023
1 parent 3c21b12 commit 0461026
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description = "Fake gprbuild external"
name = "gprbuild"

maintainers = ["[email protected]"]
maintainers-logins = ["mosteo"]

[[external]]
kind = "version-output"
# We look for make instead, that should be always installed.
version-command = ["make", "--version"]
version-regexp = ".*Make ([\\d\\.]+).*"
25 changes: 25 additions & 0 deletions testsuite/tests/solver/unsatisfying-external/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""
When an external compiler is explicitly configured, no other compiler will be
attempted to be added to the solution. This may be counterintuitive, so we emit
an special warning in this case.
"""

from drivers.alr import run_alr, init_local_crate
from drivers.asserts import assert_match


init_local_crate()

# Select the external compiler
run_alr("toolchain", "--select", "gnat_external", "gprbuild")

# Add a different version to the solution
p = run_alr("with", "gnat^9999", force=True, quiet=False)

# Check that the warning is emitted
assert_match(".*The explicitly configured external compiler gnat_external=.*"
"cannot satisfy dependency in solution gnat\^9999",
p.out)


print("SUCCESS")
4 changes: 4 additions & 0 deletions testsuite/tests/solver/unsatisfying-external/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
driver: python-script
build_mode: both
indexes:
compiler_only_index: {}

0 comments on commit 0461026

Please sign in to comment.