first tests for ci (#16)

This commit is contained in:
irengrig 2018-08-13 12:44:53 +02:00 committed by GitHub
parent 37eb556e1f
commit 21391856d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 6 deletions

View File

@ -1,8 +1,11 @@
---
platforms:
ubuntu1804:
build_targets:
- "//examples:tests"
ubuntu1604:
build_targets:
- "//examples/..."
- "//examples:tests"
macos:
build_targets:
- "//examples/..."
- "//examples:tests"

7
examples/BUILD Normal file
View File

@ -0,0 +1,7 @@
test_suite(
name = "tests",
tests = [
"//examples/cmake:test_libpng",
"//examples/cmake:test_zlib",
],
)

View File

@ -15,10 +15,8 @@ cmake_external(
)
cc_binary(
name = "libpng_test",
srcs = ["libpng_test.cpp"],
args = ["$(location bazel-icon-transparent.png) out.png"],
data = ["bazel-icon-transparent.png"],
name = "libpng_usage_example",
srcs = ["libpng_usage_example.cpp"],
deps = [
":libpng",
":libz",
@ -30,3 +28,18 @@ cc_binary(
srcs = ["zlib-example.cpp"],
deps = [":libz"],
)
sh_test(
name = "test_zlib",
srcs = ["test_zlib.sh"],
data = [":zlib_usage_example"],
visibility = ["//:__pkg__"]
)
sh_test(
name = "test_libpng",
srcs = ["test_libpng.sh"],
data = [":libpng_usage_example", "bazel-icon-transparent.png",],
args = ["$(location bazel-icon-transparent.png) out.png"],
visibility = ["//:__pkg__"]
)

3
examples/cmake/test_libpng.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
${TEST_SRCDIR}/rules_foreign_cc/examples/cmake/libpng_usage_example $@

3
examples/cmake/test_zlib.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
${TEST_SRCDIR}/rules_foreign_cc/examples/cmake/zlib_usage_example