Skip to content

Commit

Permalink
New test
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Jan 9, 2025
1 parent 766e0e9 commit 1fd6d28
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
33 changes: 33 additions & 0 deletions testsuite/tests/test/verbose-propagation/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
Check that when running `alr test` with the verbose flag, the spawned command
of the default test action inherits the verbosity flag.
"""

import os
from drivers.alr import init_local_crate, run_alr
from drivers.asserts import assert_not_substring, assert_substring
from drivers.helpers import content_of

# Run `alr test` in a local crate for this test with increasing verbosity
# levels; we check the existence of expected output in the test log. The
# selected messages are representative of the log level at play.

LOGFILE = os.path.join("alire", "alr_test_local.log")

init_local_crate()

# Default log level
run_alr("test", quiet=False)
assert_not_substring("alr build done", content_of(LOGFILE))

# Verbose
run_alr("-v", "test", quiet=False)
assert_substring("alr build done", content_of(LOGFILE))
assert_not_substring("Setenv ALIRE=True", content_of(LOGFILE))

# More verbose
run_alr("-vv", "test", quiet=False)
assert_substring("alr build done", content_of(LOGFILE))
assert_substring("Setenv ALIRE=True", content_of(LOGFILE))

print("SUCCESS")
4 changes: 4 additions & 0 deletions testsuite/tests/test/verbose-propagation/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 1fd6d28

Please sign in to comment.