aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-06-25 06:35:00 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-06-25 06:35:00 +0200
commitf0281cf028618b734dadc911c3e2a2307c711328 (patch)
treea44acd77993f588028650deb2d8a05c75673fda7
parentda5dd4eb91fe3770a40f7df7c8ade3dcb0ddda3c (diff)
downloadxK-f0281cf028618b734dadc911c3e2a2307c711328.tar.gz
xK-f0281cf028618b734dadc911c3e2a2307c711328.tar.xz
xK-f0281cf028618b734dadc911c3e2a2307c711328.zip
test-nick-colors: fix and streamline
A recent addition of an N_ELEMENTS macro invocation broke it.
-rwxr-xr-xtest2
-rwxr-xr-xtest-nick-colors9
2 files changed, 7 insertions, 4 deletions
diff --git a/test b/test
index bfe6444..bf4d697 100755
--- a/test
+++ b/test
@@ -1,5 +1,5 @@
#!/usr/bin/expect -f
-# Very basic end-to-end testing for Travis CI
+# Very basic end-to-end testing for CI
# Run the daemon to test against
system ./kike --write-default-cfg
diff --git a/test-nick-colors b/test-nick-colors
index a09f74a..dcc112f 100755
--- a/test-nick-colors
+++ b/test-nick-colors
@@ -1,12 +1,15 @@
#!/bin/sh
# Check whether the terminal colours filtered by our algorithm are legible
export example=$(
- tcc "-run -lm" - <<-EOF
+ tcc "-run -lm" - <<-END
#include <stddef.h>
#include <stdio.h>
#include <math.h>
- $(perl -0777 -ne 'print $& if /^.*?\nfilter_color(?s:.*?)^}$/m' degesch.c)
+ #define N_ELEMENTS(a) (sizeof (a) / sizeof ((a)[0]))
+
+ $(perl -0777 -ne 'print $& if /^.*?\nfilter_color(?s:.*?)^}$/m' \
+ "$(dirname "$0")"/degesch.c)
void main () {
size_t len = 0;
@@ -14,7 +17,7 @@ export example=$(
for (size_t i = 0; i < len; i++)
printf ("<@\\x1b[38;5;%dmIRCuser\\x1b[m> I'm typing!\n", table[i]);
}
- EOF
+ END
)
# Both should give acceptable results,