summaryrefslogtreecommitdiff
path: root/dev-libs/libunique/files/run-tests
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/libunique/files/run-tests')
-rw-r--r--dev-libs/libunique/files/run-tests18
1 files changed, 18 insertions, 0 deletions
diff --git a/dev-libs/libunique/files/run-tests b/dev-libs/libunique/files/run-tests
new file mode 100644
index 000000000000..db9bcd4f0860
--- /dev/null
+++ b/dev-libs/libunique/files/run-tests
@@ -0,0 +1,18 @@
+BINARY = ./test-unique
+TESTS = --new --activate --open-uri=http://localhost --foo
+
+all:
+ for test in $(TESTS); do \
+ rm -f test_result; \
+ $(BINARY) > test_result & \
+ main_pid=$$!; \
+ sleep 5; \
+ $(BINARY) $$test & \
+ test_pid=$$!; \
+ sleep 5; \
+ while ! test -s test_result; do sleep 0.5; done; \
+ sleep 5; \
+ kill $${test_pid} || exit 1; \
+ kill $${main_pid} || exit 1; \
+ grep -q 'Message received from.*' test_result || { echo "Test failed at $$test"; exit 1; }; \
+ done