Skip to content

Commit 8cbe02c

Browse files
authored
Merge pull request #2137 from omajid/xmldoc-tests
Add a test to verify xml/intellisense docs are present
2 parents a8f1277 + 514bcb0 commit 8cbe02c

File tree

1 file changed

+222
-7
lines changed

1 file changed

+222
-7
lines changed

smoke-test.sh

Lines changed: 222 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ VERSION_PREFIX=5.0
77
# See https://github.com/dotnet/source-build/issues/579, this version
88
# needs to be compatible with the runtime produced from source-build
99
DEV_CERTS_VERSION_DEFAULT=5.0.0-preview.3
10-
__ROOT_REPO=$(cat "$SCRIPT_ROOT/artifacts/obj/rootrepo.txt" | sed 's/\r$//') # remove CR if mounted repo on Windows drive
10+
__ROOT_REPO=$(sed 's/\r$//' "$SCRIPT_ROOT/artifacts/obj/rootrepo.txt") # remove CR if mounted repo on Windows drive
1111
executingUserHome=${HOME:-}
1212

1313
echo "RID to test: ${targetRid?not specified. Use ./build.sh --run-smoke-test to detect RID, or specify manually.}"
@@ -91,9 +91,9 @@ while :; do
9191
break
9292
fi
9393

94-
lowerI="$(echo $1 | awk '{print tolower($0)}')"
94+
lowerI="$(echo "$1" | awk '{print tolower($0)}')"
9595
case $lowerI in
96-
-?|-h|--help)
96+
'-?'|-h|--help)
9797
usage
9898
exit 0
9999
;;
@@ -215,7 +215,7 @@ function doCommand() {
215215
elif [[ "$1" == "run" && "$proj" =~ ^(web|mvc|webapi|razor|blazorwasm|blazorserver)$ ]]; then
216216
# A separate log file that we will over-write all the time.
217217
exitLogFile="$testingDir/exitLogFile"
218-
echo > $exitLogFile
218+
echo > "$exitLogFile"
219219
# Run an application in the background and redirect its
220220
# stdout+stderr to a separate process (tee). The tee process
221221
# writes its input to 2 files:
@@ -245,7 +245,7 @@ function doCommand() {
245245
elif [ "$1" == "multi-rid-publish" ]; then
246246
runPublishScenarios() {
247247
"${dotnetCmd}" publish --self-contained false /bl:"${binlogPrefix}publish-fx-dep.binlog"
248-
"${dotnetCmd}" publish --self-contained true -r $targetRid /bl:"${binlogPrefix}publish-self-contained-${targetRid}.binlog"
248+
"${dotnetCmd}" publish --self-contained true -r "$targetRid" /bl:"${binlogPrefix}publish-self-contained-${targetRid}.binlog"
249249
"${dotnetCmd}" publish --self-contained true -r linux-x64 /bl:"${binlogPrefix}publish-self-contained-portable.binlog"
250250
}
251251
if [ "$projectOutput" == "true" ]; then
@@ -334,6 +334,219 @@ function runWebTests() {
334334
doCommand F# webapi "$@" new restore build run multi-rid-publish
335335
}
336336

337+
function runXmlDocTests() {
338+
targetingPacksDir="$dotnetDir/packs/"
339+
echo "Looking for xml docs in targeting packs in $targetingPacksDir"
340+
341+
netstandardIgnoreList=(
342+
Microsoft.Win32.Primitives.xml
343+
mscorlib.xml
344+
System.AppContext.xml
345+
System.Buffers.xml
346+
System.Collections.Concurrent.xml
347+
System.Collections.NonGeneric.xml
348+
System.Collections.Specialized.xml
349+
System.Collections.xml
350+
System.ComponentModel.Composition.xml
351+
System.ComponentModel.EventBasedAsync.xml
352+
System.ComponentModel.Primitives.xml
353+
System.ComponentModel.TypeConverter.xml
354+
System.ComponentModel.xml
355+
System.Console.xml
356+
System.Core.xml
357+
System.Data.Common.xml
358+
System.Data.xml
359+
System.Diagnostics.Contracts.xml
360+
System.Diagnostics.Debug.xml
361+
System.Diagnostics.FileVersionInfo.xml
362+
System.Diagnostics.Process.xml
363+
System.Diagnostics.StackTrace.xml
364+
System.Diagnostics.TextWriterTraceListener.xml
365+
System.Diagnostics.Tools.xml
366+
System.Diagnostics.TraceSource.xml
367+
System.Diagnostics.Tracing.xml
368+
System.Drawing.Primitives.xml
369+
System.Drawing.xml
370+
System.Dynamic.Runtime.xml
371+
System.Globalization.Calendars.xml
372+
System.Globalization.Extensions.xml
373+
System.Globalization.xml
374+
System.IO.Compression.FileSystem.xml
375+
System.IO.Compression.xml
376+
System.IO.Compression.ZipFile.xml
377+
System.IO.FileSystem.DriveInfo.xml
378+
System.IO.FileSystem.Primitives.xml
379+
System.IO.FileSystem.Watcher.xml
380+
System.IO.FileSystem.xml
381+
System.IO.IsolatedStorage.xml
382+
System.IO.MemoryMappedFiles.xml
383+
System.IO.Pipes.xml
384+
System.IO.UnmanagedMemoryStream.xml
385+
System.IO.xml
386+
System.Linq.Expressions.xml
387+
System.Linq.Parallel.xml
388+
System.Linq.Queryable.xml
389+
System.Linq.xml
390+
System.Memory.xml
391+
System.Net.Http.xml
392+
System.Net.NameResolution.xml
393+
System.Net.NetworkInformation.xml
394+
System.Net.Ping.xml
395+
System.Net.Primitives.xml
396+
System.Net.Requests.xml
397+
System.Net.Security.xml
398+
System.Net.Sockets.xml
399+
System.Net.WebHeaderCollection.xml
400+
System.Net.WebSockets.Client.xml
401+
System.Net.WebSockets.xml
402+
System.Net.xml
403+
System.Numerics.Vectors.xml
404+
System.Numerics.xml
405+
System.ObjectModel.xml
406+
System.Reflection.DispatchProxy.xml
407+
System.Reflection.Emit.ILGeneration.xml
408+
System.Reflection.Emit.Lightweight.xml
409+
System.Reflection.Emit.xml
410+
System.Reflection.Extensions.xml
411+
System.Reflection.Primitives.xml
412+
System.Reflection.xml
413+
System.Resources.Reader.xml
414+
System.Resources.ResourceManager.xml
415+
System.Resources.Writer.xml
416+
System.Runtime.CompilerServices.VisualC.xml
417+
System.Runtime.Extensions.xml
418+
System.Runtime.Handles.xml
419+
System.Runtime.InteropServices.RuntimeInformation.xml
420+
System.Runtime.InteropServices.xml
421+
System.Runtime.Numerics.xml
422+
System.Runtime.Serialization.Formatters.xml
423+
System.Runtime.Serialization.Json.xml
424+
System.Runtime.Serialization.Primitives.xml
425+
System.Runtime.Serialization.xml
426+
System.Runtime.Serialization.Xml.xml
427+
System.Runtime.xml
428+
System.Security.Claims.xml
429+
System.Security.Cryptography.Algorithms.xml
430+
System.Security.Cryptography.Csp.xml
431+
System.Security.Cryptography.Encoding.xml
432+
System.Security.Cryptography.Primitives.xml
433+
System.Security.Cryptography.X509Certificates.xml
434+
System.Security.Principal.xml
435+
System.Security.SecureString.xml
436+
System.ServiceModel.Web.xml
437+
System.Text.Encoding.Extensions.xml
438+
System.Text.Encoding.xml
439+
System.Text.RegularExpressions.xml
440+
System.Threading.Overlapped.xml
441+
System.Threading.Tasks.Extensions.xml
442+
System.Threading.Tasks.Parallel.xml
443+
System.Threading.Tasks.xml
444+
System.Threading.ThreadPool.xml
445+
System.Threading.Thread.xml
446+
System.Threading.Timer.xml
447+
System.Threading.xml
448+
System.Transactions.xml
449+
System.ValueTuple.xml
450+
System.Web.xml
451+
System.Windows.xml
452+
System.xml
453+
System.Xml.Linq.xml
454+
System.Xml.ReaderWriter.xml
455+
System.Xml.Serialization.xml
456+
System.Xml.XDocument.xml
457+
System.Xml.xml
458+
System.Xml.XmlDocument.xml
459+
System.Xml.XmlSerializer.xml
460+
System.Xml.XPath.XDocument.xml
461+
System.Xml.XPath.xml
462+
)
463+
464+
netcoreappIgnoreList=(
465+
Microsoft.VisualBasic.xml
466+
netstandard.xml
467+
System.AppContext.xml
468+
System.Buffers.xml
469+
System.ComponentModel.DataAnnotations.xml
470+
System.Configuration.xml
471+
System.Core.xml
472+
System.Data.DataSetExtensions.xml
473+
System.Data.xml
474+
System.Diagnostics.Debug.xml
475+
System.Diagnostics.Tools.xml
476+
System.Drawing.xml
477+
System.Dynamic.Runtime.xml
478+
System.Globalization.Calendars.xml
479+
System.Globalization.Extensions.xml
480+
System.Globalization.xml
481+
System.IO.Compression.FileSystem.xml
482+
System.IO.FileSystem.Primitives.xml
483+
System.IO.UnmanagedMemoryStream.xml
484+
System.IO.xml
485+
System.Net.xml
486+
System.Numerics.xml
487+
System.Reflection.Extensions.xml
488+
System.Reflection.xml
489+
System.Resources.Reader.xml
490+
System.Resources.ResourceManager.xml
491+
System.Runtime.Extensions.xml
492+
System.Runtime.Handles.xml
493+
System.Runtime.Serialization.xml
494+
System.Security.Principal.xml
495+
System.Security.SecureString.xml
496+
System.Security.xml
497+
System.ServiceModel.Web.xml
498+
System.ServiceProcess.xml
499+
System.Text.Encoding.xml
500+
System.Threading.Tasks.Extensions.xml
501+
System.Threading.Tasks.xml
502+
System.Threading.Timer.xml
503+
System.Transactions.xml
504+
System.ValueTuple.xml
505+
System.Web.xml
506+
System.Windows.xml
507+
System.xml
508+
System.Xml.Linq.xml
509+
System.Xml.Serialization.xml
510+
System.Xml.xml
511+
System.Xml.XmlDocument.xml
512+
)
513+
514+
error=0
515+
while IFS= read -r -d '' dllFile; do
516+
xmlDocFile=${dllFile%.*}.xml
517+
skip=0
518+
if [[ "$xmlDocFile" == *"/packs/Microsoft.NETCore.App.Ref"* ]]; then
519+
xmlFileBasename=$(basename "$xmlDocFile")
520+
for ignoreItem in "${netcoreappIgnoreList[@]}"; do
521+
if [[ "$ignoreItem" == "$xmlFileBasename" ]]; then
522+
skip=1;
523+
break
524+
fi
525+
done
526+
fi
527+
if [[ "$xmlDocFile" == *"/packs/NETStandard.Library.Ref"* ]]; then
528+
xmlFileBasename=$(basename "$xmlDocFile")
529+
for ignoreItem in "${netstandardIgnoreList[@]}"; do
530+
if [[ "$ignoreItem" == "$xmlFileBasename" ]]; then
531+
skip=1;
532+
break
533+
fi
534+
done
535+
fi
536+
if [[ $skip == 0 ]] && [[ ! -f "$xmlDocFile" ]]; then
537+
error=1
538+
echo "error: missing $xmlDocFile"
539+
fi
540+
done < <(find "$targetingPacksDir" -name '*.dll' -print0)
541+
542+
if [[ $error != 0 ]]; then
543+
echo "error: Missing xml documents"
544+
exit 1
545+
else
546+
echo "All expected xml docs are present"
547+
fi
548+
}
549+
337550
function resetCaches() {
338551
rm -rf "$testingHome"
339552
mkdir "$testingHome"
@@ -396,7 +609,7 @@ echo "<Project />" | tee Directory.Build.props > Directory.Build.targets
396609
# Unzip dotnet if the dotnetDir is not specified
397610
if [ "$dotnetDir" == "" ]; then
398611
OUTPUT_DIR="$SCRIPT_ROOT/artifacts/$buildArch/$configuration/"
399-
DOTNET_TARBALL="$(ls ${OUTPUT_DIR}dotnet-sdk-${VERSION_PREFIX}*)"
612+
DOTNET_TARBALL="$(ls "${OUTPUT_DIR}${TARBALL_PREFIX}${VERSION_PREFIX}"*)"
400613

401614
mkdir -p "$cliDir"
402615
tar xzf "$DOTNET_TARBALL" -C "$cliDir"
@@ -415,7 +628,7 @@ export NUGET_PACKAGES="$restoredPackagesDir"
415628
SOURCE_BUILT_PKGS_PATH="$SCRIPT_ROOT/artifacts/obj/$buildArch/$configuration/blob-feed/packages/"
416629
export DOTNET_ROOT="$dotnetDir"
417630
# OSX also requires DOTNET_ROOT to be on the PATH
418-
if [ `uname` == 'Darwin' ]; then
631+
if [ "$(uname)" == 'Darwin' ]; then
419632
export PATH="$dotnetDir:$PATH"
420633
fi
421634

@@ -456,4 +669,6 @@ if [ "$excludeOnlineTests" == "false" ]; then
456669
echo "ONLINE RESTORE SOURCE - ALL TESTS PASSED!"
457670
fi
458671

672+
runXmlDocTests
673+
459674
echo "ALL TESTS PASSED!"

0 commit comments

Comments
 (0)