Fixed 'make install' errors by using a bash script.
authorMarkus Kauppila <markus.kauppila@gmail.com>
Fri, 01 Jul 2011 18:21:11 +0300
changeset 5735 9c13e2cef98d
parent 5734 5f1c8cce197a
child 5736 1008297b86e1
Fixed 'make install' errors by using a bash script.
test/test-automation/Makefile.am
test/test-automation/install-tests.sh
--- a/test/test-automation/Makefile.am	Fri Jul 01 17:11:20 2011 +0300
+++ b/test/test-automation/Makefile.am	Fri Jul 01 18:21:11 2011 +0300
@@ -9,13 +9,7 @@
 
 install: install-tests
 install-tests:
-	-mkdir tests
-	-cp -f testdummy/.libs/*.dylib tests/ 2> /dev/null
-	-cp -f testdummy/.libs/*.so tests/ 2> /dev/null
-	-cp -f testrect/.libs/*.dylib tests/ 2> /dev/null
-	-cp -f testrect/.libs/*.so tests/ 2> /dev/null
-	-cp -f testplatform/.libs/*.dylib tests/ 2> /dev/null
-	-cp -f testplatform/.libs/*.so tests/ 2> /dev/null
+	$(SHELL) install-tests.sh
 
 distclean-local:
 	-rm -Rf tests/ docs/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/test-automation/install-tests.sh	Fri Jul 01 18:21:11 2011 +0300
@@ -0,0 +1,24 @@
+#! /bin/bash
+
+DIRECTORY="tests"
+EXT="error"
+
+echo "Installing test suites to $DIRECTORY" 
+
+rm -Rfv $DIRECTORY 2&>1 /dev/null
+mkdir $DIRECTORY 2&>1 /dev/null
+
+PLATFORM="$(uname)"
+if [[ $PLATFORM ==  "Linux" ]]; then
+	EXT="so"
+elif [[ $PLATFORM ==  "Darwin" ]]; then
+	EXT="dylib"
+fi
+
+# TODO: put the test in an array
+for suite in "testdummy" "testplatform" "testrect"
+do
+	cp -f "$suite/.libs/lib$suite.$EXT" $DIRECTORY
+done
+
+echo "Test suited installed."