diff --git a/.bazelci/config.yaml b/.bazelci/config.yaml index d43877a7..6b559388 100644 --- a/.bazelci/config.yaml +++ b/.bazelci/config.yaml @@ -1,8 +1,11 @@ --- platforms: + ubuntu1804: + build_targets: + - "//examples:tests" ubuntu1604: build_targets: - - "//examples/..." + - "//examples:tests" macos: build_targets: - - "//examples/..." + - "//examples:tests" diff --git a/examples/BUILD b/examples/BUILD new file mode 100644 index 00000000..088142b2 --- /dev/null +++ b/examples/BUILD @@ -0,0 +1,7 @@ +test_suite( + name = "tests", + tests = [ + "//examples/cmake:test_libpng", + "//examples/cmake:test_zlib", + ], +) diff --git a/examples/cmake/BUILD b/examples/cmake/BUILD index 3edfff6c..74714a1a 100644 --- a/examples/cmake/BUILD +++ b/examples/cmake/BUILD @@ -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__"] +) \ No newline at end of file diff --git a/examples/cmake/libpng_test.cpp b/examples/cmake/libpng_usage_example.cpp similarity index 100% rename from examples/cmake/libpng_test.cpp rename to examples/cmake/libpng_usage_example.cpp diff --git a/examples/cmake/test_libpng.sh b/examples/cmake/test_libpng.sh new file mode 100755 index 00000000..85283b06 --- /dev/null +++ b/examples/cmake/test_libpng.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +${TEST_SRCDIR}/rules_foreign_cc/examples/cmake/libpng_usage_example $@ \ No newline at end of file diff --git a/examples/cmake/test_zlib.sh b/examples/cmake/test_zlib.sh new file mode 100755 index 00000000..0feb89f5 --- /dev/null +++ b/examples/cmake/test_zlib.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +${TEST_SRCDIR}/rules_foreign_cc/examples/cmake/zlib_usage_example \ No newline at end of file