Skip to content
Snippets Groups Projects
Commit baf82ac6 authored by Phillip Smyth's avatar Phillip Smyth
Browse files

tests/frontend/show.py: bst show default element

Added supporting folders
parent 302e358d
No related branches found
No related tags found
No related merge requests found
Pipeline #39851921 passed
kind: stack
description: |
Main stack target for the bst build test
kind: stack
description: |
Main stack target for the bst build test
# Project config for frontend build test
name: test
element-path: elements
fatal-warnings:
- bad-element-suffix
defaults:
target-element: target2.bst
kind: compose
depends:
- fileNAME: import-dev.bst
type: build
config:
# Dont try running the sandbox, we dont have a
# runtime to run anything in this context.
integrate: False
kind: import
sources:
- kind: local
path: files/dev-files
kind: stack
description: |
Main stack target for the bst build test
depends:
- compose-all.bst
#ifndef __PONY_H__
#define __PONY_H__
#define PONY_BEGIN "Once upon a time, there was a pony."
#define PONY_END "And they lived happily ever after, the end."
#define MAKE_PONY(story) \
PONY_BEGIN \
story \
PONY_END
#endif /* __PONY_H__ */
# Project config for frontend build test
name: test
element-path: elements
......@@ -46,6 +46,33 @@ def test_show_invalid_element_path(cli, datafiles):
'show',
"foo.bst"])
@pytest.mark.datafiles(DATA_DIR + "_default")
def test_show_default(cli, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
prev_dir = os.getcwd()
os.chdir(project)
result = cli.run(project=project, silent=True, args=[
'show'])
os.chdir(prev_dir)
result.assert_success()
results = result.output.strip().splitlines()
expected = 'buildable ca4321107f0f529170d345af19372c57a6672f62afdcbdd36ca067b67124ef60 target2.bst'
if result.output.strip() != expected:
raise AssertionError("Expected output:\n{}\nInstead received output:\n{}"
.format(expected, result.output))
@pytest.mark.datafiles(DATA_DIR + "_fail")
def test_show_fail(cli, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
prev_dir = os.getcwd()
os.chdir(project)
result = cli.run(project=project, silent=True, args=[
'show'])
os.chdir(prev_dir)
result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment