From 00fbb3b2a6301e9694386480e44eaad4f59ee83c Mon Sep 17 00:00:00 2001 From: uranther Date: Wed, 24 Jun 2009 16:33:30 -0400 Subject: Preliminary uzbl testing framework - props to bct for the help --- tests/Makefile | 14 ++++++++++++++ tests/test-1.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 tests/Makefile create mode 100644 tests/test-1.c (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..43a878b --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,14 @@ +CFLAGS:=-std=c99 -I$(shell pwd)/../ -L$(shell pwd) -luzbl $(shell pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4) -ggdb -Wall -W -DARCH="\"$(shell uname -m)\"" -DG_ERRORCHECK_MUTEXES -DCOMMIT="\"$(shell git log | head -n1 | sed "s/.* //")\"" $(CPPFLAGS) +LDFLAGS:=$(shell pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4) -pthread $(LDFLAGS) + +GTESTER:=gtester +GTESTER_REPORT:=gtester-report + +TEST_PROGS:=test-1 + +all: $(TEST_PROGS) + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:." $(GTESTER) --verbose $(TEST_PROGS) + +clean: + rm -f $(TEST_PROGS) + rm -f libuzbl.so diff --git a/tests/test-1.c b/tests/test-1.c new file mode 100644 index 0000000..0fb86b6 --- /dev/null +++ b/tests/test-1.c @@ -0,0 +1,47 @@ +/* -*- c-basic-offset: 4; -*- */ +#define _POSIX_SOURCE + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +Uzbl uzbl; + +static void +test_URI (void) { + setup_scanner(); + uzbl.state.uri = g_strdup("http://www.uzbl.org"); + g_assert_cmpstr(expand_template("URI", FALSE), ==, uzbl.state.uri); + g_free(uzbl.state.uri); +} + +int +main (int argc, char *argv[]) { + g_type_init(); + g_test_init(&argc, &argv, NULL); + + g_test_add_func("/test-1/URI", test_URI); + + return g_test_run(); +} + +/* vi: set et ts=4: */ -- cgit v1.2.3 From 9f96d51d3f1220fb3a87b65d7fda4bffa126399e Mon Sep 17 00:00:00 2001 From: uranther Date: Mon, 29 Jun 2009 12:12:40 -0400 Subject: fixed test-1 headers --- tests/test-1.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/test-1.c b/tests/test-1.c index 0fb86b6..3a94c9b 100644 --- a/tests/test-1.c +++ b/tests/test-1.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From 9b4b0e2129e38cc985b3cec6143f4a8265d60e71 Mon Sep 17 00:00:00 2001 From: uranther Date: Tue, 14 Jul 2009 17:03:48 -0400 Subject: Updated CFLAGS and LDFLAGS in tests/Makefile. TODO: Find a way for those variables to be inherited or passed to the tests/Makefile. --- tests/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile index 43a878b..869490d 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,5 +1,8 @@ -CFLAGS:=-std=c99 -I$(shell pwd)/../ -L$(shell pwd) -luzbl $(shell pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4) -ggdb -Wall -W -DARCH="\"$(shell uname -m)\"" -DG_ERRORCHECK_MUTEXES -DCOMMIT="\"$(shell git log | head -n1 | sed "s/.* //")\"" $(CPPFLAGS) -LDFLAGS:=$(shell pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4) -pthread $(LDFLAGS) +CFLAGS:=-std=c99 -I$(shell pwd)/../ -L$(shell pwd) -luzbl $(shell pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0) -ggdb -Wall -W -DARCH="\"$(shell uname -m)\"" -lgthread-2.0 -DG_ERRORCHECK_MUTEXES -DCOMMIT="\"$(shell git log | head -n1 | sed "s/.* //")\"" $(CPPFLAGS) +CFLAGS!=echo -std=c99 `pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0` -ggdb -Wall -W -DARCH='"\""'`uname -m`'"\""' -lgthread-2.0 -DG_ERRORCHECK_MUTEXES -DCOMMIT='"\""'`git log | head -n1 | sed "s/.* //"`'"\""' $(CPPFLAGS) + +LDFLAGS:=$(shell pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0) -pthread $(LDFLAGS) +LDFLAGS!=echo `pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0` -pthread $(LDFLAGS) GTESTER:=gtester GTESTER_REPORT:=gtester-report -- cgit v1.2.3