From bae2e2e4c2be10a12b52f897f5d4bec3f9186db5 Mon Sep 17 00:00:00 2001 From: gardners Date: Mon, 27 Aug 2012 17:03:50 +0930 Subject: [PATCH 1/2] Updated non-Android build process to work again (sqlite3 include path fixed, also improved so that sqlite3.c doesn't need to exist as a symlink to the real file). --- Makefile.in | 8 ++++---- sqlite3.c | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) mode change 100644 => 100755 Makefile.in delete mode 120000 sqlite3.c diff --git a/Makefile.in b/Makefile.in old mode 100644 new mode 100755 index 6dd46103..9e8f3129 --- a/Makefile.in +++ b/Makefile.in @@ -51,7 +51,7 @@ SRCS= \ sha2.c \ sighandlers.c \ simulate.c \ - sqlite3.c \ + sqlite-amalgamation-3070900/sqlite3.c \ srandomdev.c \ str.c \ strbuf.c \ @@ -96,7 +96,7 @@ HDRS= fifo.h \ LDFLAGS=@LDFLAGS@ @PORTAUDIO_LIBS@ @SRC_LIBS@ @SPANDSP_LIBS@ @CODEC2_LIBS@ @PTHREAD_LIBS@ -CFLAGS= @CPPFLAGS@ @CFLAGS@ @PORTAUDIO_CFLAGS@ @SRC_CFLAGS@ @SPANDSP_CFLAGS@ @PTHREAD_CFLAGS@ $(VOIPTEST_CFLAGS) +CFLAGS= -Isqlite-amalgamation-3070900 @CPPFLAGS@ @CFLAGS@ @PORTAUDIO_CFLAGS@ @SRC_CFLAGS@ @SPANDSP_CFLAGS@ @PTHREAD_CFLAGS@ $(VOIPTEST_CFLAGS) CFLAGS+=-fPIC CFLAGS+=-Wall -Wno-unused-value -include Makefile.dbg @@ -105,9 +105,9 @@ DEFS= @DEFS@ all: servald libmonitorclient.so libmonitorclient.a -sqlite3.o: sqlite3.c +sqlite-amalgamation-3070900/sqlite3.o: sqlite-amalgamation-3070900/sqlite3.c @echo CC $< - @$(CC) $(CFLAGS) $(DEFS) -c $< + @$(CC) $(CFLAGS) $(DEFS) -c $< -o sqlite-amalgamation-3070900/sqlite3.o %.o: %.c $(HDRS) @echo CC $< diff --git a/sqlite3.c b/sqlite3.c deleted file mode 120000 index dfac0759..00000000 --- a/sqlite3.c +++ /dev/null @@ -1 +0,0 @@ -sqlite-amalgamation-3070900/sqlite3.c \ No newline at end of file From 9149c80297ee94224636a0f86b0a5c221d582ba3 Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Mon, 27 Aug 2012 15:56:55 +0930 Subject: [PATCH 2/2] Improve test framework: assert '!' command... The assert command now supports leading '!' args in its command, each negating the sense of the following command. --- testframework.sh | 8 +++++++- tests/config | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/testframework.sh b/testframework.sh index 0247a9c7..a2731a05 100644 --- a/testframework.sh +++ b/testframework.sh @@ -844,7 +844,13 @@ _tfw_parse_times_to_milliseconds() { } _tfw_assert() { - if ! "$@"; then + local sense= + while [ "$1" = '!' ]; do + sense="$sense !" + shift + done + "$@" + if [ $sense $? -ne 0 ]; then _tfw_failmsg "assertion failed: ${_tfw_message:-$*}" _tfw_backtrace return 1 diff --git a/tests/config b/tests/config index 15363cf1..e59f126b 100755 --- a/tests/config +++ b/tests/config @@ -28,7 +28,7 @@ setup() { doc_GetCreateInstanceDir="Get creates instance directory" setup_GetCreateInstanceDir() { setup - assert [ ! -d "$SERVALINSTANCE_PATH" ] + assert ! [ -d "$SERVALINSTANCE_PATH" ] } test_GetCreateInstanceDir() { executeOk_servald config get @@ -38,7 +38,7 @@ test_GetCreateInstanceDir() { doc_SetCreateInstanceDir="Set creates instance directory" setup_SetCreateInstanceDir() { setup - assert [ ! -d "$SERVALINSTANCE_PATH" ] + assert ! [ -d "$SERVALINSTANCE_PATH" ] } test_SetCreateInstanceDir() { executeOk_servald config set foo bar