[gnome-keyring] Allow space between test definition macro and name.



commit 77f3e46aaffa11b5f3e31590269600766510a9a7
Author: Stef Walter <stef memberwebs com>
Date:   Tue Jun 8 14:58:27 2010 +0000

    Allow space between test definition macro and name.

 ...est-create-credential.c => test-prompt-login.c} |    0
 tests/prep-gtest.sh                                |   12 ++++++------
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/pkcs11/wrap-layer/tests/test-create-credential.c b/pkcs11/wrap-layer/tests/test-prompt-login.c
similarity index 100%
rename from pkcs11/wrap-layer/tests/test-create-credential.c
rename to pkcs11/wrap-layer/tests/test-prompt-login.c
diff --git a/tests/prep-gtest.sh b/tests/prep-gtest.sh
index 87f6c64..f8d0ed8 100755
--- a/tests/prep-gtest.sh
+++ b/tests/prep-gtest.sh
@@ -50,7 +50,7 @@ build_source()
 	# Startup function
 	echo "static void start_tests (void) {"
 		for _file in $@; do
-			sed -ne "s/.*DEFINE_START(\([^)]\+\)).*/	start_\1 ();/p" $_file
+			sed -ne "s/.*DEFINE_START[ 	]*(\([^)]\+\)).*/	start_\1 ();/p" $_file
 		done
 	echo "}"
 	echo
@@ -58,7 +58,7 @@ build_source()
 	# Shutdown function
 	echo "static void stop_tests (void) {"
 		for _file in $@; do
-			sed -ne "s/.*DEFINE_STOP(\([^)]\+\)).*/	stop_\1 ();/p" $_file
+			sed -ne "s/.*DEFINE_STOP[ 	]*(\([^)]\+\)).*/	stop_\1 ();/p" $_file
 		done
 	echo "}"
 	echo
@@ -70,18 +70,18 @@ build_source()
 		_name=`file_to_name $_file`  
 		
 		# Calculate what our setup and teardowns are. 
-		_setup=`sed -ne 's/.*DEFINE_SETUP(\([^)]\+\)).*/setup_\1/p' $_file || echo "NULL"`
+		_setup=`sed -ne 's/.*DEFINE_SETUP[ 	]*(\([^)]\+\)).*/setup_\1/p' $_file || echo "NULL"`
 		if [ -z "$_setup" ]; then
 			_setup="NULL"
 		fi
 
-		_teardown=`sed -ne 's/.*DEFINE_TEARDOWN(\([^)]\+\)).*/teardown_\1/p' $_file`
+		_teardown=`sed -ne 's/.*DEFINE_TEARDOWN[ 	]*(\([^)]\+\)).*/teardown_\1/p' $_file`
 		if [ -z "$_teardown" ]; then
 			_teardown="NULL"
 		fi
 		
 		# Add all tests to the test case 
-		sed -ne "s/.*DEFINE_TEST(\([^)]\+\)).*/	g_test_add(\"\/$_name\/\1\", int, NULL, $_setup, test_\1, $_teardown);/p" $_file
+		sed -ne "s/.*DEFINE_TEST[ 	]*(\([^)]\+\)).*/	g_test_add(\"\/$_name\/\1\", int, NULL, $_setup, test_\1, $_teardown);/p" $_file
 		
 	done
 	echo "}"
@@ -90,7 +90,7 @@ build_source()
 	# External function
 	echo "static void run_externals (void) {"
 	for _file in $@; do
-		sed -ne "s/.*DEFINE_EXTERNAL(\([^)]\+\)).*/	test_external_run (\"\1\", external_\1);/p" $_file
+		sed -ne "s/.*DEFINE_EXTERNAL[ 	]*(\([^)]\+\)).*/	test_external_run (\"\1\", external_\1);/p" $_file
 	done
 	echo "}"
 	echo



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