[workstation_session] add a unit test target.
Adds a unit test target for the workstation session.
This target does not have any real tests at this time.
Change-Id: Id33e9d94b98492d69a9f09e97ddcbee37044dc9f
diff --git a/BUILD.gn b/BUILD.gn
index c14d212..84f80a8 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -21,15 +21,14 @@
":dart_target_tests",
":dart_unittests",
"bin/terminal_settings_agent:tests",
+ "session_shells/ermine/session:tests",
]
}
# Dart tests which can run on target
group("dart_target_tests") {
testonly = true
- public_deps = [
- "bin:dart_target_tests",
- ]
+ public_deps = [ "bin:dart_target_tests" ]
}
# Dart unit tests which can run on the host or target
diff --git a/session_shells/ermine/session/BUILD.gn b/session_shells/ermine/session/BUILD.gn
index 7ed67ea..099429c 100644
--- a/session_shells/ermine/session/BUILD.gn
+++ b/session_shells/ermine/session/BUILD.gn
@@ -6,8 +6,14 @@
import("//build/rust/rustc_binary.gni")
import("//src/session/build/session_config.gni")
+group("tests") {
+ testonly = true
+ deps = [ ":workstation_session_tests" ]
+}
+
rustc_binary("bin") {
name = "workstation_session"
+ with_unit_tests = true
edition = "2018"
deps = [
@@ -33,22 +39,56 @@
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
]
+
+ test_deps = []
}
package("workstation_session") {
deps = [ ":bin" ]
+ binaries = [
+ {
+ name = "workstation_session"
+ },
+ ]
+
meta = [
{
path = rebase_path("meta/workstation_session.cml")
dest = "workstation_session.cm"
},
]
+}
+
+package("workstation_session_tests") {
+ testonly = true
+
+ deps = [
+ ":bin",
+ ":bin_test",
+ "//src/sys/test_adapters/rust",
+ ]
binaries = [
{
name = "workstation_session"
},
+ {
+ name = "rust_test_adapter"
+ },
+ ]
+
+ meta = [
+ {
+ path = "meta/workstation_session_bin_test.cml"
+ dest = "workstation_session_bin_test.cm"
+ },
+ ]
+
+ tests = [
+ {
+ name = "workstation_session_bin_test"
+ },
]
}
diff --git a/session_shells/ermine/session/meta/workstation_session_bin_test.cml b/session_shells/ermine/session/meta/workstation_session_bin_test.cml
new file mode 100644
index 0000000..51059a1
--- /dev/null
+++ b/session_shells/ermine/session/meta/workstation_session_bin_test.cml
@@ -0,0 +1,23 @@
+{
+ "program": {
+ "binary": "bin/rust_test_adapter",
+ "args": [
+ "/pkg/test/workstation_session_bin_test",
+ ]
+ },
+ "expose": [
+ {
+ "protocol": "/svc/fuchsia.test.Suite",
+ "from": "self",
+ },
+ ],
+ "use": [
+ { "runner": "elf" },
+ {
+ "protocol": "/svc/fuchsia.process.Launcher",
+ },
+ {
+ "protocol": "/svc/fuchsia.logger.LogSink",
+ },
+ ],
+}
diff --git a/session_shells/ermine/session/src/main.rs b/session_shells/ermine/session/src/main.rs
index e7c522b..3e701b1 100644
--- a/session_shells/ermine/session/src/main.rs
+++ b/session_shells/ermine/session/src/main.rs
@@ -58,3 +58,11 @@
loop {}
}
+
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn dummy_test() {
+ assert_eq!(true, true);
+ }
+}