Skip to content

Commit

Permalink
Only set buildtesting when flag is set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 committed Oct 11, 2018
1 parent c1d1893 commit 1cea9f6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cget/prefix.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def build(self, pb, test=False, target=None, generator=None):
# Install any dependencies first
self.install_deps(pb, src_dir, generator=generator, test=test)
# Configure and build
if not builder.exists: builder.configure(src_dir, defines=pb.define, generator=generator, variant=pb.variant)
if not builder.exists: builder.configure(src_dir, defines=pb.define, generator=generator, test=test, variant=pb.variant)
builder.build(variant=pb.variant, target=target)
# Run tests if enabled
if test: builder.test(variant=pb.variant)
Expand Down
10 changes: 10 additions & 0 deletions test/buildtesting/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 2.8)
project(buildtesting)

if(BUILD_TESTING)
message(FATAL_ERROR "BUILD_TESTING is set. Aborting.")
endif()

add_custom_target(check)

install(CODE "")
13 changes: 13 additions & 0 deletions test/test_cget.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,19 @@ def test_unlink_update(d):
def test_build_dir(d):
d.cmds(build_cmds(get_exists_path('libsimple')))

@appveyor_skip
def test_build_dir_notest(d):
d.cmds([
cget_cmd('build', '--verbose', get_exists_path('buildtesting')),
])

@appveyor_skip
@pytest.mark.xfail(strict=True)
def test_build_dir_with_test(d):
d.cmds([
cget_cmd('build', '--verbose --test', get_exists_path('buildtesting')),
])

@appveyor_skip
def test_build_dir_dev(d):
d.cmds(build_cmds(get_exists_path('basicapp-dev'), size=1))
Expand Down

0 comments on commit 1cea9f6

Please sign in to comment.