gnu-arch-users
[Top][All Lists]
Advanced

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

[Gnu-arch-users] [BUG][FTBFS][PATCH] More bashisms in tests


From: Jan Hudec
Subject: [Gnu-arch-users] [BUG][FTBFS][PATCH] More bashisms in tests
Date: Wed, 2 Mar 2005 10:43:31 +0100
User-agent: Mutt/1.5.6i

Hello All,

I have made more progress with latest daily build of tla and found few
more bashisms in the test suite. I have generated a patch this time,
including problems I reported in previous mail.

There are 3 kinds of problems:
1) $(< file) needs replacing with $(cat file)
2) echo behaves differently in each shell. Usualy including special
   characters literally in single-quoted string is an option (instead of
   echo -e 'foo\nbar' do just 'foo
   bar'). (In fact, echo is the most incompatible shell command...)
3) test uses = for equality, NOT ==.

Note: These problems really don't exist in 1.3. They only exist in
address@hidden/tla--devo--1.4. Please apply the patch, so
the daily debian package is buildable again.

--------------------------------------------------------------------------------
                                                - Jan Hudec `Bulb' 
<address@hidden>

Patch follows:

diff -ur tla-20050301.orig/src/tla/tests/test-add.sh 
tla-20050301/src/tla/tests/test-add.sh
--- tla-20050301.orig/src/tla/tests/test-add.sh 2005-03-01 01:32:53.000000000 
+0100
+++ tla-20050301/src/tla/tests/test-add.sh      2005-03-01 16:42:31.000000000 
+0100
@@ -27,14 +27,14 @@
 setup_add
 echo "a file" > new-file.c
 tla add new-file.c
-id=$(< .arch-ids/new-file.c.id)
+id=$(cat .arch-ids/new-file.c.id)
 end_test

 begin_test "add single random id with id chosen"
 setup_add
 echo "a file" > new-file.c
 tla add -i foobar new-file.c
-id=$(< .arch-ids/new-file.c.id)
+id=$(cat .arch-ids/new-file.c.id)
 [ "foobar" = $id  ]
 end_test

@@ -56,14 +56,14 @@
 setup_add
 mkdir newdir
 tla add newdir
-id=$(< newdir/.arch-ids/\=id)
+id=$(cat newdir/.arch-ids/\=id)
 end_test

 begin_test "add a chosen id for a directory works"
 setup_add
 mkdir newdir
 tla add -i super_duper newdir
-id=$(< newdir/.arch-ids/\=id)
+id=$(cat newdir/.arch-ids/\=id)
 [ "super_duper" = $id  ]
 end_test

diff -ur tla-20050301.orig/src/tla/tests/test-archive-creation.sh 
tla-20050301/src/tla/tests/test-archive-creation.sh
--- tla-20050301.orig/src/tla/tests/test-archive-creation.sh    2005-03-01 
01:32:53.000000000 +0100
+++ tla-20050301/src/tla/tests/test-archive-creation.sh 2005-03-01 
16:43:18.000000000 +0100
@@ -21,7 +21,7 @@
 tla make-archive address@hidden $(pwd)/test-archive
 test "$(tla whereis-archive address@hidden)" = $(pwd)/test-archive
 test -d test-archive/=meta-info
-test "Bazaar archive format 1 0" = "$(< test-archive/.archive-version )"
+test "Bazaar archive format 1 0" = "$(cat test-archive/.archive-version )"
 end_test

 begin_test "Archive creation 2 (with listing)"
@@ -29,14 +29,14 @@
 test "$(tla whereis-archive address@hidden)" = $(pwd)/test-archive2
 test -d test-archive2/=meta-info
 test -f test-archive2/.listing
-test "Bazaar archive format 1 0" = "$(< test-archive2/.archive-version )"
+test "Bazaar archive format 1 0" = "$(cat test-archive2/.archive-version )"
 end_test

 begin_test "TLA Archive creation 1"
 tla make-archive --old address@hidden $(pwd)/test-archive3
 test "$(tla whereis-archive address@hidden)" = $(pwd)/test-archive3
 test -d test-archive3/=meta-info
-test "Hackerlab arch archive directory, format version 2." = "$(< 
test-archive3/.archive-version )"
+test "Hackerlab arch archive directory, format version 2." = "$(cat 
test-archive3/.archive-version )"
 end_test

 begin_test "TLA Archive creation 2 (with listing)"
@@ -44,7 +44,7 @@
 test "$(tla whereis-archive address@hidden)" = $(pwd)/test-archive4
 test -d test-archive4/=meta-info
 test -f test-archive4/.listing
-test "Hackerlab arch archive directory, format version 2." = "$(< 
test-archive4/.archive-version )"
+test "Hackerlab arch archive directory, format version 2." = "$(cat 
test-archive4/.archive-version )"
 end_test

 begin_test "Archive creation 3 (email contains an underscore before @)"
diff -ur tla-20050301.orig/src/tla/tests/test-import.sh 
tla-20050301/src/tla/tests/test-import.sh
--- tla-20050301.orig/src/tla/tests/test-import.sh      2005-03-01 
01:32:53.000000000 +0100
+++ tla-20050301/src/tla/tests/test-import.sh   2005-03-02 09:52:39.000000000 
+0100
@@ -24,7 +24,9 @@
 tla id-tagging-method explicit
 tla add hello-world.c README
 tla import -L 'initial import'
-test "$(tla categories -A address@hidden)" = "$(echo -e 
cat\\ncow\\nhello-world)"
+test "$(tla categories -A address@hidden)" = 'cat
+cow
+hello-world'
 test "$(tla branches address@hidden/hello-world)" = "hello-world--mainline"
 test "$(tla versions address@hidden/hello-world--mainline)" = 
"hello-world--mainline--1.0"
 test -d $(tla whereis-archive 
address@hidden)/hello-world/hello-world--mainline/hello-world--mainline--1.0/base-0
diff -ur tla-20050301.orig/src/tla/tests/test-switch.sh 
tla-20050301/src/tla/tests/test-switch.sh
--- tla-20050301.orig/src/tla/tests/test-switch.sh      2005-03-01 
01:32:53.000000000 +0100
+++ tla-20050301/src/tla/tests/test-switch.sh   2005-03-02 10:16:27.000000000 
+0100
@@ -29,13 +29,13 @@
 begin_test "switch changes tree version"
 setup_switch
 tla switch address@hidden/hello-world--devo--1.3
-[ "address@hidden/hello-world--devo--1.3" == $(tla tree-version) ]
+[ "address@hidden/hello-world--devo--1.3" = $(tla tree-version) ]
 end_test

 begin_test "switch changes tree for a revision"
 setup_switch
 tla switch address@hidden/hello-world--devo--1.3--base-0
-[ "address@hidden/hello-world--devo--1.3" == $(tla tree-version) ]
+[ "address@hidden/hello-world--devo--1.3" = $(tla tree-version) ]
 end_test

 begin_test "switch with no changes has no changes in the new version"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]