Browse code

some fixes for tests and bugs found by tests

Nat! authored on 22-08-2017 19:31:04
Showing 4 changed files
... ...
@@ -745,7 +745,7 @@ required_action_for_clone()
745 745
       ;;
746 746
    esac
747 747
 
748
-   have_upgrade="`git_scm_function "${scm}" "upgrade"`"
748
+   have_upgrade="`get_scm_function "${scm}" "upgrade"`"
749 749
    if [ "${branch}" != "${newbranch}" ]
750 750
    then
751 751
       log_fluff "Branch has changed from \"${branch}\" to \"${newbranch}\", need to fetch"
... ...
@@ -758,7 +758,7 @@ required_action_for_clone()
758 758
       fi
759 759
    fi
760 760
 
761
-   have_checkout="`git_scm_function "${scm}" "checkout"`"
761
+   have_checkout="`get_scm_function "${scm}" "checkout"`"
762 762
    if [ "${tag}" != "${newtag}" ]
763 763
    then
764 764
       log_fluff "Tag has changed from \"${tag}\" to \"${newtag}\", need to check-out"
... ...
@@ -771,7 +771,7 @@ required_action_for_clone()
771 771
       fi
772 772
    fi
773 773
 
774
-   have_set_url="`git_scm_function "${scm}" "set_url"`"
774
+   have_set_url="`get_scm_function "${scm}" "set_url"`"
775 775
    if [ "${url}" != "${newurl}" ]
776 776
    then
777 777
       log_fluff "URL has changed from \"${url}\" to \"${newurl}\", need to set remote url and fetch"
... ...
@@ -45,10 +45,10 @@ setup_test_case()
45 45
    mkdir -p b
46 46
 
47 47
    (
48
-      cd b ;
49
-      git init ;
50
-      echo "# VfL Bochum 1848" > README.md ;
51
-      git add README.md ;
48
+      cd b && 
49
+      git init && 
50
+      echo "# VfL Bochum 1848" > README.md && 
51
+      git add README.md && 
52 52
       git commit -m "bla bla"
53 53
    ) || exit 1
54 54
 
... ...
@@ -104,7 +104,7 @@ _test_a_2()
104 104
 test_a()
105 105
 {
106 106
    (
107
-      cd a ;
107
+      cd a && 
108 108
       _test_a_1 "$@"
109 109
    ) || exit 1
110 110
 
... ...
@@ -114,7 +114,7 @@ test_a()
114 114
    move_test_case
115 115
 
116 116
    (
117
-      cd a ;
117
+      cd a && 
118 118
       _test_a_2 "$@"
119 119
    ) || exit 1
120 120
 }
... ...
@@ -128,9 +128,8 @@ echo "mulle-bootstrap: `mulle-bootstrap version`(`mulle-bootstrap library-path`)
128 128
 MULLE_BOOTSTRAP_LOCAL_PATH="`pwd -P`"
129 129
 export MULLE_BOOTSTRAP_LOCAL_PATH
130 130
 
131
-setup_test_case
132
-test_a "$@"
133
-clear_test_dirs a b
134
-
131
+setup_test_case &&
132
+test_a "$@" &&
133
+clear_test_dirs a b &&
135 134
 echo "succeeded" >&2
136 135
 
... ...
@@ -85,29 +85,29 @@ setup_test_case()
85 85
 {
86 86
    clear_test_dirs Master Boobie Foobie
87 87
 
88
-   mkdir -p Master/Minion/.bootstrap
88
+   mkdir -p Master/Minion && ( cd Master/Minion ; mulle-bootstrap -s init -n )
89 89
    mkdir -p Foobie
90 90
    mkdir -p Boobie
91 91
 
92 92
    (
93
-      cd Master/Minion/.bootstrap ;
94
-      echo "Boobie" > embedded_repositories
93
+      cd Master/Minion/.bootstrap && 
94
+      echo "Boobie" > embedded_repositories &&
95 95
       echo "Foobie" > repositories
96 96
    ) || exit 1
97 97
 
98 98
    (
99
-      cd Foobie ;
100
-      git init ;
101
-      echo "Foobie" > i_am_foobie.txt ;
102
-      git add i_am_foobie.txt ;
99
+      cd Foobie && 
100
+      git init && 
101
+      echo "Foobie" > i_am_foobie.txt && 
102
+      git add i_am_foobie.txt && 
103 103
       git commit -m "bla bla"
104 104
    ) || exit 1
105 105
 
106 106
    (
107
-      cd Boobie ;
108
-      git init ;
109
-      echo "Boobie" > i_am_boobie.txt ;
110
-      git add i_am_boobie.txt ;
107
+      cd Boobie && 
108
+      git init && 
109
+      echo "Boobie" > i_am_boobie.txt && 
110
+      git add i_am_boobie.txt && 
111 111
       git commit -m "bla bla"
112 112
    ) || exit 1
113 113
 }
... ...
@@ -119,7 +119,7 @@ test_defer()
119 119
    (
120 120
       cd Master/Minion
121 121
 
122
-      run_mulle_bootstrap "$@" defer || exit 1
122
+      run_mulle_bootstrap "$@" defer
123 123
    ) || fail "defer"
124 124
 
125 125
    expect_file "Master/.bootstrap.local/is_master"
... ...
@@ -129,9 +129,8 @@ test_defer()
129 129
    (
130 130
       cd Master/Minion
131 131
 
132
-      run_mulle_bootstrap "$@" emancipate || exit 1
133
-
134
-   )
132
+      run_mulle_bootstrap "$@" emancipate 
133
+   ) || exit 1
135 134
 
136 135
    expect_missing_file "Master/.bootstrap.local/is_master"
137 136
    expect_missing_file "Master/.bootstrap.local/minions"
... ...
@@ -162,11 +161,11 @@ test_fetch()
162 161
 
163 162
    expect_contents "Master/.bootstrap.auto/build_order" "Foobie"
164 163
    expect_contents "Master/.bootstrap.auto/minions" "Minion"
165
-   expect_contents "Master/.bootstrap.auto/repositories" "Foobie;stashes/Foobie;master;git"
164
+   expect_contents "Master/.bootstrap.auto/repositories" "Foobie;stashes/Foobie;master;;git"
166 165
 
167 166
    # abuse space cutting feature of bash here
168
-   expect_contents "Master/.bootstrap.repos/.deep/Minion.d/Boobie" "Boobie;Minion/Boobie;master;git"
169
-   expect_contents "Master/.bootstrap.repos/Foobie" "Foobie;stashes/Foobie;master;symlink"
167
+   expect_contents "Master/.bootstrap.repos/.deep/Minion.d/Boobie" "Boobie;Minion/Boobie;master;;git"
168
+   expect_contents "Master/.bootstrap.repos/Foobie" "Foobie;stashes/Foobie;master;;symlink"
170 169
 
171 170
    expect_contents "Master/stashes/Foobie/i_am_foobie.txt" "Foobie"
172 171
    expect_contents "Master/Minion/Boobie/i_am_boobie.txt" "Boobie"
... ...
@@ -175,7 +174,7 @@ test_fetch()
175 174
    (
176 175
       cd Master
177 176
       run_mulle_bootstrap clean --minion Minion
178
-   )
177
+   ) || exit 1
179 178
 
180 179
    expect_missing_file "Master/Minion/Boobie/i_am_boobie.txt"
181 180
 }
... ...
@@ -186,9 +185,8 @@ test_fetch()
186 185
 #
187 186
 echo "mulle-bootstrap: `mulle-bootstrap version`(`mulle-bootstrap library-path`)" >&2
188 187
 
189
-setup_test_case
190
-test_defer "$@"
191
-test_fetch "$@"
192
-
188
+setup_test_case &&
189
+test_defer "$@" &&
190
+test_fetch "$@" &&
193 191
 echo "succeeded" >&2
194 192
 
... ...
@@ -40,7 +40,7 @@ setup_test_case()
40 40
 {
41 41
    clear_test_dirs a b
42 42
 
43
-   mkdir -p a/.bootstrap
43
+   mkdir -p a && ( cd a ; mulle-bootstrap -s init -n )
44 44
    mkdir -p b
45 45
 
46 46
    (
... ...
@@ -86,9 +86,8 @@ echo "mulle-bootstrap: `mulle-bootstrap version`(`mulle-bootstrap library-path`)
86 86
 MULLE_BOOTSTRAP_LOCAL_PATH="`pwd -P`"
87 87
 export MULLE_BOOTSTRAP_LOCAL_PATH
88 88
 
89
-setup_test_case
90
-test_a "$@"
91
-clear_test_dirs a b
92
-
89
+setup_test_case &&
90
+test_a "$@" &&
91
+clear_test_dirs a b &&
93 92
 echo "succeeded" >&2
94 93