[tracker] Functional tests: use autotools to choose locations



commit a39e001f011071b987100c7c707efb08112ba373
Author: Ivan Frade <ivan frade nokia com>
Date:   Wed May 12 14:40:47 2010 +0300

    Functional tests: use autotools to choose locations

 tests/functional-tests/Makefile.am                 |   19 ++++++++++++++++++-
 ...d-batch.sh => force-sqlite-misused-batch.sh.in} |    2 +-
 ...qlite-misused.sh => force-sqlite-misused.sh.in} |    2 +-
 ...{helper-test-data.sh => helper-test-data.sh.in} |    6 +++---
 4 files changed, 23 insertions(+), 6 deletions(-)
---
diff --git a/tests/functional-tests/Makefile.am b/tests/functional-tests/Makefile.am
index 374eb93..533f20a 100644
--- a/tests/functional-tests/Makefile.am
+++ b/tests/functional-tests/Makefile.am
@@ -24,4 +24,21 @@ config_SCRIPTS =			\
 	virtual-files-tc.py		\
 	writeback-tc.py
 
-EXTRA_DIST = $(config_SCRIPTS)
+bashscriptsdir = $(datadir)/tracker-tests
+
+bashscripts_in_files =				\
+	force-sqlite-misused.sh.in		\
+	force-sqlite-misused-batch.sh.in	\
+	helper-test-data.sh.in		
+
+bashscripts_SCRIPTS = 				\
+	$(bashscripts_in_files:.sh.in=.sh)
+
+%.sh: %.sh.in
+	@sed -e "s|@topsrcdir[ ]|${top_srcdir}|" \
+	     -e "s|@libexecdir[ ]|${libexecdir}|" $< > $@	
+
+EXTRA_DIST = $(config_SCRIPTS) \
+	$(bashscripts_SCRIPTS)	
+
+CLEANFILES = $(bashscripts_SCRIPTS)
diff --git a/tests/functional-tests/force-sqlite-misused-batch.sh b/tests/functional-tests/force-sqlite-misused-batch.sh.in
similarity index 78%
rename from tests/functional-tests/force-sqlite-misused-batch.sh
rename to tests/functional-tests/force-sqlite-misused-batch.sh.in
index 2eab373..bf9fe25 100755
--- a/tests/functional-tests/force-sqlite-misused-batch.sh
+++ b/tests/functional-tests/force-sqlite-misused-batch.sh.in
@@ -3,7 +3,7 @@
 source helper-test-data.sh
 
 echo "Ready, now running the test (" $XDG_DATA_HOME ")"
-/usr/local/libexec/tracker-store -v 0 &
+ libexecdir@/tracker-store -v 0 &
 /usr/bin/env python 11-sqlite-batch-misused.py
 
 
diff --git a/tests/functional-tests/force-sqlite-misused.sh b/tests/functional-tests/force-sqlite-misused.sh.in
similarity index 77%
rename from tests/functional-tests/force-sqlite-misused.sh
rename to tests/functional-tests/force-sqlite-misused.sh.in
index 9d0de40..9f4bc76 100755
--- a/tests/functional-tests/force-sqlite-misused.sh
+++ b/tests/functional-tests/force-sqlite-misused.sh.in
@@ -3,7 +3,7 @@
 source helper-test-data.sh
 
 echo "Ready, now running the test (" $XDG_DATA_HOME ")"
-/usr/local/libexec/tracker-store -v 0 &
+ libexecdir@/tracker-store -v 0 &
 /usr/bin/env python 10-sqlite-misused.py
 
 
diff --git a/tests/functional-tests/helper-test-data.sh b/tests/functional-tests/helper-test-data.sh.in
similarity index 82%
rename from tests/functional-tests/helper-test-data.sh
rename to tests/functional-tests/helper-test-data.sh.in
index 8b4eb3e..0b4d290 100644
--- a/tests/functional-tests/helper-test-data.sh
+++ b/tests/functional-tests/helper-test-data.sh.in
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-if [[ ! -e ../../utils/data-generators/cc/generate ]]; then
+if [[ ! -e @topsrcdir@/utils/data-generators/cc/generate ]]; then
     echo "Run this from test/functional-tests/"
     exit 2
 fi
@@ -8,7 +8,7 @@ fi
 # If we don't have ttl files, bring them from the data-generators
 if [[ ! -d ttl ]]; then
    CURRENT=`pwd`
-   cd ../../utils/data-generators/cc
+   cd @topsrcdir@/utils/data-generators/cc
    # Generation takes time. Don't ask if they are already generated.
    #  Checking just one random .ttl file... not good
    if [[ ! -e ttl/032-nmo_Email.ttl ]]; then
@@ -18,7 +18,7 @@ if [[ ! -d ttl ]]; then
    fi
    cd $CURRENT
    echo "Moving ttl generated files to functional-tests folder"
-   cp -R ../../utils/data-generators/cc/ttl . || (echo "Error generating ttl files" && exit 3)
+   cp -R @topsrcdir@/utils/data-generators/cc/ttl . || (echo "Error generating ttl files" && exit 3)
 else
    echo "TTL files already in place"
 fi



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]