# HG changeset patch # User Ziv Scully # Date 1438565204 25200 # Node ID 4769b27aa43669b41d7e9e268b55659314dfadd4 # Parent 27899da8780b811c97a810533314b2cc48f3be80# Parent 728aaeea12fdcc5d7849ba61c5cc27978df86fa7 Merge. diff -r 27899da8780b -r 4769b27aa436 Makefile.am --- a/Makefile.am Sun Aug 02 18:25:42 2015 -0700 +++ b/Makefile.am Sun Aug 02 18:26:44 2015 -0700 @@ -15,7 +15,7 @@ SUBDIRS = src/c -.PHONY: smlnj mlton package reauto +.PHONY: smlnj mlton package reauto test smlnj: src/urweb.cm xml/entities.sml mlton: bin/urweb @@ -114,3 +114,17 @@ EXTRA_DIST = demo doc lib/js lib/ur xml \ src/coq src/*.sig src/*.sml src/*.mlb src/config.sml.in src/elisp src/*.cm src/sources src/*.grm src/*.lex \ CHANGELOG LICENSE urweb.ebuild include/urweb/*.h bin + +TESTDB = /tmp/urweb.db +TESTPID = /tmp/urweb.pid + +test: + urweb -dbms sqlite -db $(TESTDB) -demo /Demo demo + rm -f $(TESTDB) + sqlite3 $(TESTDB) < demo/demo.sql + demo/demo.exe & echo $$! > $(TESTPID) + sleep 1 + (curl -s 'http://localhost:8080/Demo/Hello/main' | diff tests/hello.html -) || (kill `cat $(TESTPID)`; echo "Test 'Hello' failed"; /bin/false) + (curl -s 'http://localhost:8080/Demo/Crud1/create?A=1&B=2&C=3&D=4' | diff tests/crud1.html -) || (kill `cat $(TESTPID)`; echo "Test 'Crud1' failed"; /bin/false) + kill `cat $(TESTPID)` + echo Tests succeeded. diff -r 27899da8780b -r 4769b27aa436 tests/crud1.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/crud1.html Sun Aug 02 18:26:44 2015 -0700 @@ -0,0 +1,38 @@ + + + +

Inserted with ID 1.

+ + + + + + + + + + + + + + + + + + + +
IDABCD
1123True +[Update] +[Delete] +
+


+ +
+
  • A:
  • +
  • B:
  • +
  • C:
  • +
  • D:
  • + +
    + + \ No newline at end of file diff -r 27899da8780b -r 4769b27aa436 tests/hello.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/hello.html Sun Aug 02 18:26:44 2015 -0700 @@ -0,0 +1,10 @@ + + + + +Hello world! + + +

    Hello world!

    + + \ No newline at end of file