@@ -70,18 +70,25 @@ in pkgs.runCommand (name + "-coverage-report")
70
70
local -n tixFs=$2
71
71
local outFile="$3"
72
72
73
- local hpcSumCmd=("hpc" "sum" "--union" "--output=$outFile")
74
-
75
- for module in "'' ${includedModules[@]}"; do
76
- hpcSumCmd+=("--include=$module")
77
- done
78
-
79
- for tixFile in "'' ${tixFs[@]}"; do
80
- hpcSumCmd+=("$tixFile")
81
- done
82
-
83
- echo "'' ${hpcSumCmd[@]}"
84
- eval "'' ${hpcSumCmd[@]}"
73
+ if (( "'' ${#tixFs[@]}" > 0 )); then
74
+ local hpcSumCmd=("hpc" "sum" "--union" "--output=$outFile")
75
+
76
+ for module in "'' ${includedModules[@]}"; do
77
+ hpcSumCmd+=("--include=$module")
78
+ done
79
+
80
+ for tixFile in "'' ${tixFs[@]}"; do
81
+ hpcSumCmd+=("$tixFile")
82
+ done
83
+
84
+ echo "'' ${hpcSumCmd[@]}"
85
+ eval "'' ${hpcSumCmd[@]}"
86
+ else
87
+ # If there are no tix files we output an empty tix file so that we can
88
+ # markup an empty HTML coverage report. This is preferable to failing to
89
+ # output a HTML report.
90
+ echo 'Tix []' > $outFile
91
+ fi
85
92
}
86
93
87
94
function findModules() {
@@ -153,19 +160,17 @@ in pkgs.runCommand (name + "-coverage-report")
153
160
154
161
# Sum tix files to create a tix file with all relevant tix
155
162
# information and markup a HTML report from this info.
156
- if (( "'' ${#tixFiles[@]}" > 0 )); then
157
- local sumTixFile="$out/share/hpc/vanilla/tix/${ name } /${ name } .tix"
158
- local markupOutDir="$out/share/hpc/vanilla/html/${ name } "
163
+ local sumTixFile="$out/share/hpc/vanilla/tix/${ name } /${ name } .tix"
164
+ local markupOutDir="$out/share/hpc/vanilla/html/${ name } "
159
165
160
- # Sum all of our tix file, including modules from any local package
161
- sumTix allMixModules tixFiles "$sumTixFile"
166
+ # Sum all of our tix file, including modules from any local package
167
+ sumTix allMixModules tixFiles "$sumTixFile"
162
168
163
- # Markup a HTML report, included modules from only this package
164
- markup srcDirs mixDirs pkgMixModules "$markupOutDir" "$sumTixFile"
169
+ # Markup a HTML report, included modules from only this package
170
+ markup srcDirs mixDirs pkgMixModules "$markupOutDir" "$sumTixFile"
165
171
166
- # Provide a HTML zipfile and Hydra links
167
- ( cd "$markupOutDir" ; zip -r $out/share/hpc/vanilla/${ name } -html.zip . )
168
- echo "report coverage $markupOutDir/hpc_index.html" >> $out/nix-support/hydra-build-products
169
- echo "file zip $out/share/hpc/vanilla/${ name } -html.zip" >> $out/nix-support/hydra-build-products
170
- fi
172
+ # Provide a HTML zipfile and Hydra links
173
+ ( cd "$markupOutDir" ; zip -r $out/share/hpc/vanilla/${ name } -html.zip . )
174
+ echo "report coverage $markupOutDir/hpc_index.html" >> $out/nix-support/hydra-build-products
175
+ echo "file zip $out/share/hpc/vanilla/${ name } -html.zip" >> $out/nix-support/hydra-build-products
171
176
''
0 commit comments