test-case (start) - surf-adblock - Surf adblock web extension
(HTM) git clone git://git.codemadness.org/surf-adblock
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 55fbb08b97fe45d1d104f99ec1fe43261f322865
(DIR) parent 08e747efa80a44603f80db0fdacb3f63ad210b8e
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 4 Jun 2017 14:22:18 +0200
test-case (start)
Diffstat:
A .gitignore | 6 ++++++
A adblock.h | 5 +++++
D tests/debug.sh | 18 ------------------
A tests/run.sh | 4 ++++
M tests/tests.c | 2 ++
5 files changed, 17 insertions(+), 18 deletions(-)
---
(DIR) diff --git a/.gitignore b/.gitignore
@@ -0,0 +1,6 @@
+*.o
+*.core
+*.lo
+*.la
+tests/tests
+surf-adblock
(DIR) diff --git a/adblock.h b/adblock.h
@@ -0,0 +1,5 @@
+int checkrequest(const char *, const char *);
+void cleanup(void);
+char *getdocumentcss(const char *);
+char *getglobalcss(void);
+void init(void);
(DIR) diff --git a/tests/debug.sh b/tests/debug.sh
@@ -1,18 +0,0 @@
-#!/bin/sh
-# ugly debug script: compile as standalone program for testing.
-
-cc -std=c99 -pedantic -Wall -Os -I. -I/usr/include -I/usr/X11R6/include \
- `pkg-config --cflags gtk+-3.0 webkit2gtk-4.0 webkit2gtk-web-extension-4.0` \
- -DVERSION=\"0.1\" -DWEBEXTDIR=\"/usr/local/lib/surf\" -D_DEFAULT_SOURCE \
- -DWEBEXTDIR=\"/usr/local/lib/surf\" \
- `pkg-config --cflags gtk+-3.0 webkit2gtk-4.0 webkit2gtk-web-extension-4.0` \
- -DDEBUG \
- -c surf-adblock.c
-cc -s -L/usr/lib -lc -L/usr/X11R6/lib -lX11 \
- `pkg-config --libs gtk+-3.0 webkit2gtk-4.0 webkit2gtk-web-extension-4.0` -lgthread-2.0 -module -avoid-version -o surf-adblock \
- surf-adblock.o
-
-chmod +x surf-adblock
-# NOTE: need to copy because of W^X.
-cp surf-adblock /usr/local/bin
-time /usr/local/bin/surf-adblock
(DIR) diff --git a/tests/run.sh b/tests/run.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+rm -f *.o tests
+cc tests.c -o tests -Wall
+SURF_ADBLOCK_FILE=`pwd`/rules ./tests
(DIR) diff --git a/tests/tests.c b/tests/tests.c
@@ -1,3 +1,5 @@
+#include "../adblock.c"
+
int
main(void)
{