diff tests/ordinary.rs @ 1:ef8bf41097ac

Added integration tests
author Martin Habovstiak <martin.habovstiak@gmail.com>
date Fri, 27 Nov 2020 10:07:35 +0100
parents
children 66c0e10c89fc
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/ordinary.rs	Fri Nov 27 10:07:35 2020 +0100
@@ -0,0 +1,22 @@
+use std::io;
+use std::ffi::OsStr;
+use std::process::{Command, Child};
+
+mod comm;
+
+enum Test {}
+
+impl comm::Test for Test {
+    const SOCKET_ADDR: &'static str = "127.0.0.1:4242";
+
+    fn spawn_slave(program_name: &OsStr) -> io::Result<Child> {
+        Command::new(program_name)
+            .env("SYSTEMD_SOCKET_INTEGRATION_TEST", "slave")
+            .spawn()
+    }
+}
+
+#[test]
+fn main() {
+    comm::main::<Test>();
+}