Commit Diff


commit - d760973a5b59906e46def02f8e5aaaf7be601eba
commit + 31a4993a9478d17776d45ab9041001a4ced37c17
blob - b2626f532aead29639a199670ca7ff58c1653f25
blob + b2f7bb9f66b217541b523e32e3f3d472daf7fad7
--- Makefile
+++ Makefile
@@ -32,13 +32,13 @@ TAGS: ${SRCS}
 	-etags ${SRCS} || true
 
 clean:
-	rm -f *.o lex.yy.c y.tab.c y.tab.h y.output gmid
+	rm -f *.o lex.yy.c y.tab.c y.tab.h y.output gmid gg
 	make -C regress clean
 
 iri_test: iri_test.o iri.o utf8.o
 	${CC} iri_test.o iri.o utf8.o -o iri_test ${LDFLAGS}
 
-regress: gmid
+regress: gmid gg
 	make -C regress all
 
 test: gmid iri_test
blob - 55c4229a5bb807bc27dc914093af56c4264e6375
blob + 6825fce66f80d7f845b7aee04f256414167d8ed9
--- README.md
+++ README.md
@@ -80,7 +80,7 @@ then you can build `gmid` with
 
 ### Testing
 
-The regression suite requires python3 at the moment.  Execute
+Execute
 
     make regress
 
blob - edfcf74c04aced1bf69cdf176f9a600807db00a7
blob + 53a016c5c6bb111898291687c699e57ca04c377d
--- regress/runtime
+++ regress/runtime
@@ -26,19 +26,28 @@ checkconf() {
 # usage: get <path>
 # return the body of the request on stdout
 get() {
-	(./gg.py "$1" 10965 | sed 1d) || true
+	./../gg -b "gemini://localhost:10965/$1"
 }
 
 # usage: head <path>
 # return the meta response line on stdout
 head() {
-	(./gg.py "$1" 10965 | sed 1q) || true
+	./../gg -h "gemini://localhost:10965/$1"
 }
 
+# usage: raw <path>
+# return both header and body
+raw() {
+	./../gg "gemini://localhost:10965/$1"
+}
+
 run() {
 	# filter out logs for GET requests
 	(./../gmid -c reg.conf 2>&1 | grep -v GET) >&2 &
 	pid=$!
+	# give gmid time to bind the port, otherwise we end up
+	# executing gg when gmid isn't ready yet.
+	sleep 1
 }
 
 # usage: check [exit-message]
@@ -159,8 +168,7 @@ eq "$(head /err)"	""		"Unexpected head for /err"
 eq "$(get  /err)"	""		"Unexpected body for /err"
 echo OK GET /err with cgi
 
-eq "$(head /invalid | wc -c | xargs)" 2049		"Unexpected body for /invalid"
-eq "$(get /invalid)"		""			"Unexpected body for /invalid"
+eq "$(raw /invalid | wc -c | xargs)" 2049		"Unexpected body for /invalid"
 echo OK GET /invalid with cgi
 
 check "should be running"