| {{>copyright comment="#"}} |
| |
| {{>generated comment="#"}} |
| |
| import("//build/bind/bind.gni") |
| import("//build/config/fuchsia/rules.gni") |
| import("//build/driver_package.gni") |
| import("//build/package.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| |
| group("{{PROJECT_NAME}}") { |
| testonly = true |
| deps = [ |
| ":pkg", |
| ":tests", |
| ] |
| } |
| |
| # TODO: Remember to link this to ../BUILD.gn tests group so that the tests are included. |
| # Then delete this comment. |
| group("tests") { |
| testonly = true |
| deps = [ ":{{PROJECT_NAME}}-tests" ] |
| } |
| |
| bind_rules("bind") { |
| rules = "{{snake_case PROJECT_NAME}}.bind" |
| output = "{{snake_case PROJECT_NAME}}-bind.h" |
| } |
| |
| driver_module("driver") { |
| sources = [ "{{snake_case PROJECT_NAME}}.cc" ] |
| deps = [ |
| ":bind", |
| "//src/devices/lib/driver", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/inspect", |
| ] |
| } |
| |
| driver_package("pkg") { |
| package_name = "{{PROJECT_NAME}}" |
| deps = [ ":driver" ] |
| drivers = [ |
| { |
| name = "driver.so" |
| dest = "{{PROJECT_NAME}}.so" |
| }, |
| ] |
| } |
| |
| test("unit-tests") { |
| sources = [ |
| "{{snake_case PROJECT_NAME}}.cc", |
| "{{snake_case PROJECT_NAME}}.h", |
| "unit-tests.cc", |
| ] |
| deps = [ |
| ":bind", |
| "//sdk/lib/inspect/testing/cpp:zxtest", |
| "//src/devices/lib/driver", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/inspect", |
| ] |
| } |
| |
| unittest_package("{{PROJECT_NAME}}-tests") { |
| deps = [ ":unit-tests" ] |
| tests = [ |
| { |
| name = "unit-tests" |
| environments = basic_envs |
| }, |
| ] |
| } |