]> git.sur5r.net Git - i3/i3status/commitdiff
Add unit tests for threshold format 179/head
authorMihai Coman <mihai.cmn@gmail.com>
Tue, 15 Nov 2016 11:34:06 +0000 (13:34 +0200)
committerMihai Coman <mihai.cmn@gmail.com>
Tue, 15 Nov 2016 11:34:06 +0000 (13:34 +0200)
testcases/004-disk-low-threshold-format/expected_output.txt [new file with mode: 0644]
testcases/004-disk-low-threshold-format/i3status.conf [new file with mode: 0644]
testcases/005-cpu-temp-max-threshold-format/expected_output.txt [new file with mode: 0644]
testcases/005-cpu-temp-max-threshold-format/i3status.conf [new file with mode: 0644]
testcases/005-cpu-temp-max-threshold-format/temp1_input [new file with mode: 0644]
testcases/006-cpu-usage-max-threshold-format/expected_output.txt [new file with mode: 0644]
testcases/006-cpu-usage-max-threshold-format/i3status.conf [new file with mode: 0644]
testcases/007-cpu-usage-degraded-threshold-format/expected_output.txt [new file with mode: 0644]
testcases/007-cpu-usage-degraded-threshold-format/i3status.conf [new file with mode: 0644]
testcases/008-load-max-threshold-format/expected_output.txt [new file with mode: 0644]
testcases/008-load-max-threshold-format/i3status.conf [new file with mode: 0644]

diff --git a/testcases/004-disk-low-threshold-format/expected_output.txt b/testcases/004-disk-low-threshold-format/expected_output.txt
new file mode 100644 (file)
index 0000000..6c5f96c
--- /dev/null
@@ -0,0 +1 @@
+BELOW_THRESHOLD
diff --git a/testcases/004-disk-low-threshold-format/i3status.conf b/testcases/004-disk-low-threshold-format/i3status.conf
new file mode 100644 (file)
index 0000000..ef1e96f
--- /dev/null
@@ -0,0 +1,12 @@
+general {
+        output_format = "none"
+}
+
+order += "disk /"
+
+disk "/" {
+        format = "%used"
+        format_below_threshold = "BELOW_THRESHOLD"
+        low_threshold = 100
+        threshold_type = "percentage_free"
+}
diff --git a/testcases/005-cpu-temp-max-threshold-format/expected_output.txt b/testcases/005-cpu-temp-max-threshold-format/expected_output.txt
new file mode 100644 (file)
index 0000000..5ba90c9
--- /dev/null
@@ -0,0 +1 @@
+ABOVE_THRESHOLD: 50 °C
diff --git a/testcases/005-cpu-temp-max-threshold-format/i3status.conf b/testcases/005-cpu-temp-max-threshold-format/i3status.conf
new file mode 100644 (file)
index 0000000..10c6b3c
--- /dev/null
@@ -0,0 +1,11 @@
+general {
+        output_format = "none"
+}
+
+order += "cpu_temperature 0"
+
+cpu_temperature 0 {
+        format_above_threshold = "ABOVE_THRESHOLD: %degrees °C"
+        max_threshold = 45
+        path = "testcases/005-cpu-temp-max-threshold-format/temp1_input"
+}
diff --git a/testcases/005-cpu-temp-max-threshold-format/temp1_input b/testcases/005-cpu-temp-max-threshold-format/temp1_input
new file mode 100644 (file)
index 0000000..ccfc37a
--- /dev/null
@@ -0,0 +1 @@
+50000
diff --git a/testcases/006-cpu-usage-max-threshold-format/expected_output.txt b/testcases/006-cpu-usage-max-threshold-format/expected_output.txt
new file mode 100644 (file)
index 0000000..97fca6d
--- /dev/null
@@ -0,0 +1 @@
+ABOVE_THRESHOLD
diff --git a/testcases/006-cpu-usage-max-threshold-format/i3status.conf b/testcases/006-cpu-usage-max-threshold-format/i3status.conf
new file mode 100644 (file)
index 0000000..06aeb14
--- /dev/null
@@ -0,0 +1,10 @@
+general {
+        output_format = "none"
+}
+
+order += "cpu_usage"
+
+cpu_usage {
+        format_above_threshold = "ABOVE_THRESHOLD"
+        max_threshold = -1
+}
diff --git a/testcases/007-cpu-usage-degraded-threshold-format/expected_output.txt b/testcases/007-cpu-usage-degraded-threshold-format/expected_output.txt
new file mode 100644 (file)
index 0000000..97fca6d
--- /dev/null
@@ -0,0 +1 @@
+ABOVE_THRESHOLD
diff --git a/testcases/007-cpu-usage-degraded-threshold-format/i3status.conf b/testcases/007-cpu-usage-degraded-threshold-format/i3status.conf
new file mode 100644 (file)
index 0000000..06aeb14
--- /dev/null
@@ -0,0 +1,10 @@
+general {
+        output_format = "none"
+}
+
+order += "cpu_usage"
+
+cpu_usage {
+        format_above_threshold = "ABOVE_THRESHOLD"
+        max_threshold = -1
+}
diff --git a/testcases/008-load-max-threshold-format/expected_output.txt b/testcases/008-load-max-threshold-format/expected_output.txt
new file mode 100644 (file)
index 0000000..97fca6d
--- /dev/null
@@ -0,0 +1 @@
+ABOVE_THRESHOLD
diff --git a/testcases/008-load-max-threshold-format/i3status.conf b/testcases/008-load-max-threshold-format/i3status.conf
new file mode 100644 (file)
index 0000000..0a23983
--- /dev/null
@@ -0,0 +1,10 @@
+general {
+        output_format = "none"
+}
+
+order += "load"
+
+load {
+        format_above_threshold = "ABOVE_THRESHOLD"
+        max_threshold = -1
+}