git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
To: git@vger.kernel.org
Cc: Matthieu.Moy@imag.fr, simon.cathebras@ensimag.imag.fr,
	charles.roussel@ensimag.imag.fr, Julien.Khayat@ensimag.imag.fr,
	Simon.Perrat@ensimag.imag.fr
Subject: [PATCH 2/2] FIX: Syntax of shell and perl scripts and posix compliant
Date: Thu, 31 May 2012 20:13:12 +0200	[thread overview]
Message-ID: <1338487992-305-2-git-send-email-guillaume.sasdy@ensimag.imag.fr> (raw)
In-Reply-To: <1338487992-305-1-git-send-email-guillaume.sasdy@ensimag.imag.fr>

From: Simon Cathebras <simon.cathebras@ensimag.imag.fr>

t/test-gitmw.pl: no more '\n' in the append of wiki_editpage
t/test-gitmw-lib.sh: grep is now Posix compliant
t/test-gitmw-lib.sh: some "  " were misplaced
---
 t/test-gitmw-lib.sh | 17 ++++++++---------
 t/test-gitmw.pl     |  4 ++--
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/t/test-gitmw-lib.sh b/t/test-gitmw-lib.sh
index b89b45a..d7c7459 100755
--- a/t/test-gitmw-lib.sh
+++ b/t/test-gitmw-lib.sh
@@ -31,14 +31,14 @@ WIKI_PASSW="AdminPass"
 # Fetch a page <page_name> from the wiki and copy its content
 # into directory <dest_path>.
 wiki_getpage () {
-	../test-gitmw.pl "get_page" -p "$1" "$2"
+	../test-gitmw.pl get_page -p "$1" "$2"
 }
 
 # wiki_delete_page <page_name>
 #
 # Delete the page <page_name> on the wiki.
 wiki_delete_page () {
-	../test-gitmw.pl "delete_page" -p "$1"
+	../test-gitmw.pl delete_page -p "$1"
 }
 
 # wiki_edit_page <page_name> <page_content> <page_append>
@@ -47,7 +47,7 @@ wiki_delete_page () {
 # If <wiki_append> == true the content will be appended
 # If the page doesn't exist, it is created.
 wiki_editpage () {
-	../test-gitmw.pl "edit_page" -p "$1" "$2" "$3"
+	../test-gitmw.pl edit_page -p "$1" "$2" "$3"
 }
 
 # git_content <dir_1> <dir_2>
@@ -56,7 +56,7 @@ wiki_editpage () {
 # and exits with error 1 if they do not match. The program will
 # not look into .git in the process.
 git_content () {
-	result=$(diff -r -B -w --exclude=".git" "$1" "$2")
+	result=$(diff -r -b --exclude=".git" "$1" "$2")
 
 	if echo $result | grep -q ">" ; then
 		echo "test failed: files $1 and $2 do not match"
@@ -77,11 +77,11 @@ git_exist () {
 	fi
 }
 
-# wiki_page_content <file_name> <page_name> 
+# wiki_check_content <file_name> <page_name> 
 #
 # Compares the contents of the file <file_name> and the wiki page
 # <page_name> and exits with error 1 if they do not match.
-wiki_page_content () {
+wiki_check_content () {
 	wiki_getpage "$2" .
 
 	if test -f "$2".mw ; then
@@ -120,16 +120,15 @@ wiki_getallpagename () {
 # <dest_dir>.
 wiki_getallpage () {
 	wiki_getallpagename
-	mkdir $1
+	mkdir -p "$1"
 	while read -r line; do
 		wiki_getpage "$line" $1;
 	done < all.txt
-	#rm all.txt
 }
 
 fail()
 {
-    echo $1
+    echo "$1"
     exit 1
 }
 
diff --git a/t/test-gitmw.pl b/t/test-gitmw.pl
index e9c50f9..bf71485 100755
--- a/t/test-gitmw.pl
+++ b/t/test-gitmw.pl
@@ -9,7 +9,7 @@
 # License: GPL v2 or later
 
 # Usage:
-#       ./test-gitmw.pl <function> [argument]*
+#       ./test-gitmw.pl <command> [argument]*
 # Execute in terminal using the name of the function to call as first
 # parameter, and the function's arguments as following parameters
 #
@@ -111,7 +111,7 @@ sub wiki_editpage {
 
 	my $text = $wiki_content;
 	if (defined($previous_text)) {
-		$text="$previous_text\n\n$text";
+		$text="$previous_text$text";
 	}
 	$mw->edit( { action => 'edit', title => $wiki_page, text => "$text"} );
 }
-- 
1.7.10.2.568.g4c26a3a

  reply	other threads:[~2012-05-31 18:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30 16:30 [PATCH/RFC]Test environment for Git-MediaWiki Simon.Cathebras
2012-05-30 17:04 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Simon Cathebras
2012-05-30 17:04   ` [PATCH 2/3] Test environment of git-remote-mw Simon Cathebras
2012-05-31  7:17     ` Matthieu Moy
2012-06-01  8:53       ` Simon.Cathebras
2012-06-01  9:02         ` Matthieu Moy
2012-06-01  9:21           ` Matthieu Moy
2012-05-30 17:04   ` [PATCH 3/3] Tests file for git-remote-mediawiki Simon Cathebras
2012-05-31  7:19   ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Matthieu Moy
2012-05-31 18:13 ` [PATCH 1/2] FIX: t9360. NEW test t9361 for git pull and git push Guillaume Sasdy
2012-05-31 18:13   ` Guillaume Sasdy [this message]
2012-05-31 18:16 ` [PATCH] FIX: Syntax of shell and perl scripts and posix compliant Guillaume Sasdy
2012-05-31 18:27 ` Guillaume Sasdy
2012-05-31 18:31 ` [PATCH 1/3] FIX: cmd_* moved to wiki_* in test-gitmw-lib.sh and other files Guillaume Sasdy
2012-06-01 10:41 ` [PATCH 1/3] Script to install, delete and clear a MediaWiki Guillaume Sasdy
2012-06-01 10:41   ` [PATCH 2/3] Test environment of git-remote-mw Guillaume Sasdy
2012-06-01 11:49     ` Matthieu Moy
2012-06-01 14:43       ` Simon.Cathebras
2012-06-02 10:47         ` Matthieu Moy
2012-06-04 14:13           ` Simon.Cathebras
2012-06-01 10:41   ` [PATCH 3/3] Tests file for git-remote-mediawiki Guillaume Sasdy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338487992-305-2-git-send-email-guillaume.sasdy@ensimag.imag.fr \
    --to=guillaume.sasdy@ensimag.imag.fr \
    --cc=Julien.Khayat@ensimag.imag.fr \
    --cc=Matthieu.Moy@imag.fr \
    --cc=Simon.Perrat@ensimag.imag.fr \
    --cc=charles.roussel@ensimag.imag.fr \
    --cc=git@vger.kernel.org \
    --cc=simon.cathebras@ensimag.imag.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).