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

frontend/buildcheckout.py: Add build --world test

Added test files to be built using build --world
parent ea56cba7
No related branches found
No related tags found
Loading
Pipeline #37514533 failed
Showing
with 132 additions and 0 deletions
......@@ -60,6 +60,47 @@ def test_build_checkout(datafiles, cli, strict, hardlinks):
assert os.path.exists(filename)
@pytest.mark.datafiles(os.path.join(os.path.dirname(
os.path.realpath(__file__)),
"project_world",
))
@pytest.mark.parametrize("strict,hardlinks", [
("strict", "copies"),
("strict", "hardlinks"),
("non-strict", "copies"),
("non-strict", "hardlinks"),
])
def test_build_world_checkout(datafiles, cli, strict, hardlinks):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
# First build it
result = cli.run(project=project, args=strict_args(['build', '--world'], strict))
result.assert_success()
# Assert that after a successful build, the builddir is empty
builddir = os.path.join(cli.directory, 'build')
assert os.path.isdir(builddir)
assert not os.listdir(builddir)
# Prepare checkout args
checkout_args = strict_args(['checkout'], strict)
if hardlinks == "hardlinks":
checkout_args += ['--hardlinks']
checkout_args += ['target.bst', checkout]
# Now check it out
result = cli.run(project=project, args=checkout_args)
result.assert_success()
# Check that the executable hello file is found in the checkout
filename = os.path.join(checkout, 'usr', 'bin', 'hello')
assert os.path.exists(filename)
filename = os.path.join(checkout, 'usr', 'include', 'pony.h')
assert os.path.exists(filename)
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("deps", [("run"), ("none")])
def test_build_checkout_deps(datafiles, cli, deps):
......
kind: compose
depends:
- filename: import-bin.bst
type: build
- 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: compose
depends:
- filename: import-bin.bst
type: build
- 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
# Exclude the dev domain
exclude:
- devel
kind: compose
depends:
- filename: import-bin.bst
type: build
- 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
# Only include the runtim
include:
- runtime
kind: import
sources:
- kind: local
path: files/bin-files
kind: import
sources:
- kind: local
path: files/dev-files
kind: compose
build-depends:
- target.bst
kind: import
description: the kind of this element must implement generate_script() method
sources:
- kind: local
path: files/source-bundle
kind: stack
description: |
Main stack target for the bst build test
depends:
- import-bin.bst
- compose-all.bst
#!/bin/bash
echo "Hello !"
test
#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__ */
llamas
# Project config for frontend build test
name: test
element-path: elements
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