Skip to content

Commit eb63b23

Browse files
jack-pappasKevinRansom
authored andcommitted
Follow-up to #2497. (#2536)
Fix FSharpSource.targets so ILComparer builds on mono. In build.sh, preface invocations of nunit-console.exe with `mono`, so it runs as expected. Move the net40-fsharpqa tests last, unit tests (when they work) are faster than the tests in fsharpqa so we'll fail faster when there's an obvious breaking change.
1 parent c063ab3 commit eb63b23

3 files changed

Lines changed: 81 additions & 66 deletions

File tree

build.sh

Lines changed: 79 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ if [ "${RestorePackages:-true}" = 'true' ]; then
402402
fi
403403

404404
if [ "$BUILD_VS" = '1' ]; then
405-
eval "$nugetexe restore vsintegration/packages.config -PackagesDirectory packages -ConfigFile $_nugetconfig"
405+
eval "$_nugetexe restore vsintegration/packages.config -PackagesDirectory packages -ConfigFile $_nugetconfig"
406406
if [ $? -ne 0 ]; then
407407
failwith "Nuget restore failed"
408408
fi
@@ -447,16 +447,12 @@ if [ "$BUILD_PROTO" = '1' ]; then
447447
{ pushd ./lkg/fsc && eval "$_dotnetexe restore" && popd; } || failwith "dotnet restore failed"
448448
{ pushd ./lkg/fsi && eval "$_dotnetexe restore" && popd; } || failwith "dotnet restore failed"
449449

450-
#pushd ./lkg/fsc && $_dotnetexe publish project.json --no-build -o ${_scriptdir}Tools/lkg -r $_architecture && popd && if ERRORLEVEL 1 echo Error: dotnet publish failed && goto :failure
451-
#pushd ./lkg/fsi && $_dotnetexe publish project.json --no-build -o ${_scriptdir}Tools/lkg -r $_architecture && popd && if ERRORLEVEL 1 echo Error: dotnet publish failed && goto :failure
450+
{ pushd ./lkg/fsc && eval "$_dotnetexe publish project.json --no-build -o ${_scriptdir}Tools/lkg -r $_architecture" && popd; } || failwith "dotnet publish failed"
451+
{ pushd ./lkg/fsi && eval "$_dotnetexe publish project.json --no-build -o ${_scriptdir}Tools/lkg -r $_architecture" && popd; } || failwith "dotnet publish failed"
452452

453-
#echo $_msbuildexe $msbuildflags src/fsharp-proto-build.proj
454-
# $_msbuildexe $msbuildflags src/fsharp-proto-build.proj
455-
#@if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure
453+
{ printeval "$_msbuildexe $msbuildflags src/fsharp-proto-build.proj"; } || failwith "compiler proto build failed"
456454

457-
#echo $_ngenexe install Proto/net40/bin/fsc-proto.exe /nologo
458-
# $_ngenexe install Proto/net40/bin/fsc-proto.exe /nologo
459-
#@if ERRORLEVEL 1 echo Error: NGen of proto failed && goto :failure
455+
# { printeval "$_ngenexe install Proto/net40/bin/fsc-proto.exe /nologo"; } || failwith "NGen of proto failed"
460456
else
461457
# Build proto-compiler and libs
462458
{ printeval "$_msbuildexe $msbuildflags src/fsharp-proto-build.proj /p:UseMonoPackaging=true"; } || failwith "compiler proto build failed"
@@ -512,7 +508,7 @@ fi
512508
printf "WHERE_ARG_NUNIT=%s\n" "$WHERE_ARG_NUNIT"
513509

514510
export NUNITPATH="tests/fsharpqa/testenv/bin/nunit/"
515-
export NUNIT3_CONSOLE="packages/NUnit.Console.3.0.0/tools/nunit3-console.exe"
511+
export NUNIT3_CONSOLE="${NUNITPATH}nunit3-console.exe"
516512
export link_exe="${_scriptdir}packages/VisualCppTools.14.0.24519-Pre/lib/native/bin/link.exe"
517513
if [ ! -f "$link_exe" ]; then
518514
failwith "failed to find '$link_exe' use nuget to restore the VisualCppTools package"
@@ -547,52 +543,18 @@ if [ "$TEST_NET40_FSHARP_SUITE" = '1' ]; then
547543
ERRORARG="--err:\"$ERRORFILE\""
548544
fi
549545

550-
if ! printeval "$NUNIT3_CONSOLE --verbose \"$FSCBINPATH/FSharp.Tests.FSharpSuite.dll\" --framework:V4.0 --work:\"$FSCBINPATH\" $OUTPUTARG $ERRORARG --result:\"$XMLFILE;format=nunit3\" $WHERE_ARG_NUNIT"; then
551-
# TODO: Don't need to use 'cat' here -- can just use stream redirection to write the file directly to stdout/stderr
552-
cat "$ERRORFILE"
546+
if ! printeval "mono $NUNIT3_CONSOLE --verbose \"$FSCBINPATH/FSharp.Tests.FSharpSuite.dll\" --framework:V4.0 --work:\"$FSCBINPATH\" $OUTPUTARG $ERRORARG --result:\"$XMLFILE;format=nunit3\" $WHERE_ARG_NUNIT"; then
547+
if [ -f "$ERRORFILE" ]; then
548+
echo -----------------------------------------------------------------
549+
cat "$ERRORFILE"
550+
fi
553551
echo -----------------------------------------------------------------
554552
echo Error: Running tests net40-fsharp failed, see log above -- FAILED
555553
echo -----------------------------------------------------------------
556554
exit 1
557555
fi
558556
fi
559557

560-
# ---------------- net40-fsharpqa -----------------------
561-
562-
OSARCH="${PROCESSOR_ARCHITECTURE:-x64}"
563-
564-
# Set this to 1 in order to use an external compiler host process
565-
# This only has an effect when running the FSHARPQA tests, but can
566-
# greatly speed up execution since fsc.exe does not need to be spawned thousands of times
567-
HOSTED_COMPILER=1
568-
569-
if [ "$TEST_NET40_FSHARPQA_SUITE" = '1' ]; then
570-
571-
export FSC="$FSCBINPATH/fsc.exe"
572-
export FSCOREDLLPATH="$FSCBINPATH/FSharp.Core.dll"
573-
export PATH="$FSCBINPATH;$PATH"
574-
575-
if ! command -v perl > /dev/null; then
576-
failwith "perl is not in the PATH, it is required for the net40-fsharpqa test suite"
577-
fi
578-
579-
OUTPUTFILE=test-net40-fsharpqa-results.log
580-
ERRORFILE=test-net40-fsharpqa-errors.log
581-
FAILENV=test-net40-fsharpqa-errors
582-
583-
{ pushd "${_scriptdir}tests/fsharpqa/source" && \
584-
printeval "perl tests/fsharpqa/testenv/bin/runall.pl -resultsroot $RESULTSDIR -results $OUTPUTFILE -log $ERRORFILE -fail $FAILENV -cleanup:no $TTAGS_ARG_RUNALL $PARALLEL_ARG" && \
585-
popd; } || {
586-
cat "$RESULTSDIR/$OUTPUTFILE"
587-
echo -----------------------------------------------------------------
588-
cat "$RESULTSDIR/$ERRORFILE"
589-
echo -----------------------------------------------------------------
590-
echo Error: Running tests net40-fsharpqa failed, see logs above -- FAILED
591-
echo -----------------------------------------------------------------
592-
exit 1
593-
}
594-
fi
595-
596558
# ---------------- net40-compilerunit -----------------------
597559

598560
if [ "$TEST_NET40_COMPILERUNIT_SUITE" = '1' ]; then
@@ -608,11 +570,15 @@ if [ "$TEST_NET40_COMPILERUNIT_SUITE" = '1' ]; then
608570
OUTPUTARG="--output:\"$OUTPUTFILE\""
609571
fi
610572

611-
if ! printeval "$NUNIT3_CONSOLE --verbose --framework:V4.0 --result:\"$XMLFILE;format=nunit3\" $OUTPUTARG $ERRORARG --work:\"$FSCBINPATH\" \"$FSCBINPATH/../../net40/bin/FSharp.Compiler.Unittests.dll\" $WHERE_ARG_NUNIT"; then
612-
echo -----------------------------------------------------------------
613-
cat "$OUTPUTFILE"
614-
echo -----------------------------------------------------------------
615-
cat "$ERRORFILE"
573+
if ! printeval "mono $NUNIT3_CONSOLE --verbose --framework:V4.0 --result:\"$XMLFILE;format=nunit3\" $OUTPUTARG $ERRORARG --work:\"$FSCBINPATH\" \"$FSCBINPATH/../../net40/bin/FSharp.Compiler.Unittests.dll\" $WHERE_ARG_NUNIT"; then
574+
if [ -f "$OUTPUTFILE" ]; then
575+
echo -----------------------------------------------------------------
576+
cat "$OUTPUTFILE"
577+
fi
578+
if [ -f "$ERRORFILE" ]; then
579+
echo -----------------------------------------------------------------
580+
cat "$ERRORFILE"
581+
fi
616582
echo -----------------------------------------------------------------
617583
echo Error: Running tests net40-compilerunit failed, see logs above -- FAILED
618584
echo -----------------------------------------------------------------
@@ -636,11 +602,15 @@ if [ "$TEST_NET40_COREUNIT_SUITE" = '1' ]; then
636602
OUTPUTARG="--output:\"$OUTPUTFILE\""
637603
fi
638604

639-
if ! printeval "$NUNIT3_CONSOLE --verbose --framework:V4.0 --result:\"$XMLFILE;format=nunit3\" $OUTPUTARG $ERRORARG --work:\"$FSCBINPATH\" \"$FSCBINPATH/FSharp.Core.Unittests.dll\" $WHERE_ARG_NUNIT"; then
640-
echo -----------------------------------------------------------------
641-
cat "$OUTPUTFILE"
642-
echo -----------------------------------------------------------------
643-
cat "$ERRORFILE"
605+
if ! printeval "mono $NUNIT3_CONSOLE --verbose --framework:V4.0 --result:\"$XMLFILE;format=nunit3\" $OUTPUTARG $ERRORARG --work:\"$FSCBINPATH\" \"$FSCBINPATH/FSharp.Core.Unittests.dll\" $WHERE_ARG_NUNIT"; then
606+
if [ -f "$OUTPUTFILE" ]; then
607+
echo -----------------------------------------------------------------
608+
cat "$OUTPUTFILE"
609+
fi
610+
if [ -f "$ERRORFILE" ]; then
611+
echo -----------------------------------------------------------------
612+
cat "$ERRORFILE"
613+
fi
644614
echo -----------------------------------------------------------------
645615
echo Error: Running tests net40-coreunit failed, see logs above -- FAILED
646616
echo -----------------------------------------------------------------
@@ -665,11 +635,15 @@ if [ "$TEST_PORTABLE_COREUNIT_SUITE" = '1' ]; then
665635
OUTPUTARG="--output:\"$OUTPUTFILE\""
666636
fi
667637

668-
if ! printeval "$NUNIT3_CONSOLE /framework:V4.0 /result=\"$XMLFILE;format=nunit3\" $OUTPUTARG $ERRORARG /work=\"$FSCBINPATH\" \"$FSCBINPATH/../../portable7/bin/FSharp.Core.Unittests.dll\" \"$FSCBINPATH/../../portable47/bin/FSharp.Core.Unittests.dll\" \"$FSCBINPATH/../../portable78/bin/FSharp.Core.Unittests.dll\" \"$FSCBINPATH/../../portable259/bin/FSharp.Core.Unittests.dll\" $WHERE_ARG_NUNIT"; then
669-
echo -----------------------------------------------------------------
670-
cat "$OUTPUTFILE"
671-
echo -----------------------------------------------------------------
672-
cat "$ERRORFILE"
638+
if ! printeval "mono $NUNIT3_CONSOLE /framework:V4.0 /result=\"$XMLFILE;format=nunit3\" $OUTPUTARG $ERRORARG /work=\"$FSCBINPATH\" \"$FSCBINPATH/../../portable7/bin/FSharp.Core.Unittests.dll\" \"$FSCBINPATH/../../portable47/bin/FSharp.Core.Unittests.dll\" \"$FSCBINPATH/../../portable78/bin/FSharp.Core.Unittests.dll\" \"$FSCBINPATH/../../portable259/bin/FSharp.Core.Unittests.dll\" $WHERE_ARG_NUNIT"; then
639+
if [ -f "$OUTPUTFILE" ]; then
640+
echo -----------------------------------------------------------------
641+
cat "$OUTPUTFILE"
642+
fi
643+
if [ -f "$ERRORFILE" ]; then
644+
echo -----------------------------------------------------------------
645+
cat "$ERRORFILE"
646+
fi
673647
echo -----------------------------------------------------------------
674648
echo Error: Running tests portable-coreunit failed, see logs above -- FAILED
675649
echo -----------------------------------------------------------------
@@ -712,3 +686,44 @@ if [ "$TEST_CORECLR_FSHARP_SUITE" = '1' ]; then
712686
exit 1
713687
fi
714688
fi
689+
690+
# ---------------- net40-fsharpqa -----------------------
691+
692+
OSARCH="${PROCESSOR_ARCHITECTURE:-x64}"
693+
694+
# Set this to 1 in order to use an external compiler host process
695+
# This only has an effect when running the FSHARPQA tests, but can
696+
# greatly speed up execution since fsc.exe does not need to be spawned thousands of times
697+
HOSTED_COMPILER=1
698+
699+
if [ "$TEST_NET40_FSHARPQA_SUITE" = '1' ]; then
700+
701+
export FSC="$FSCBINPATH/fsc.exe"
702+
export FSCOREDLLPATH="$FSCBINPATH/FSharp.Core.dll"
703+
export PATH="$FSCBINPATH;$PATH"
704+
705+
if ! command -v perl > /dev/null; then
706+
failwith "perl is not in the PATH, it is required for the net40-fsharpqa test suite"
707+
fi
708+
709+
OUTPUTFILE=test-net40-fsharpqa-results.log
710+
ERRORFILE=test-net40-fsharpqa-errors.log
711+
FAILENV=test-net40-fsharpqa-errors
712+
713+
{ pushd "${_scriptdir}tests/fsharpqa/source" && \
714+
printeval "perl tests/fsharpqa/testenv/bin/runall.pl -resultsroot $RESULTSDIR -results $OUTPUTFILE -log $ERRORFILE -fail $FAILENV -cleanup:no $TTAGS_ARG_RUNALL $PARALLEL_ARG" && \
715+
popd; } || {
716+
if [ -f "$RESULTSDIR/$OUTPUTFILE" ]; then
717+
echo -----------------------------------------------------------------
718+
cat "$RESULTSDIR/$OUTPUTFILE"
719+
fi
720+
if [ -f "$RESULTSDIR/$ERRORFILE" ]; then
721+
echo -----------------------------------------------------------------
722+
cat "$RESULTSDIR/$ERRORFILE"
723+
fi
724+
echo -----------------------------------------------------------------
725+
echo Error: Running tests net40-fsharpqa failed, see logs above -- FAILED
726+
echo -----------------------------------------------------------------
727+
exit 1
728+
}
729+
fi

src/FSharpSource.Settings.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
<RoslynVSPackagesVersion>14.3.25407</RoslynVSPackagesVersion>
128128

129129
<!-- The version of MSBuild assumed byt the F# compiler in the Mono packaging of F# -->
130-
<MonoPackagingMSBuildVersionSuffix>v12.0"</MonoPackagingMSBuildVersionSuffix>
130+
<MonoPackagingMSBuildVersionSuffix>v12.0</MonoPackagingMSBuildVersionSuffix>
131131
<MonoPackagingMSBuildVersionFull>12.0.0.0</MonoPackagingMSBuildVersionFull>
132132

133133
<!-- FSharp.Compiler.Tools is currently only used to get a working FSI.EXE to execute some scripts during the build -->

src/FSharpSource.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<MicroBuildAssemblyFileLanguage>fs</MicroBuildAssemblyFileLanguage>
3030
</PropertyGroup>
3131
</When>
32-
<When Condition="'$(AssemblyName)' == 'FSharp.Core' or '$(AssemblyName)' == 'FSharp.Build' or '$(AssemblyName)' == 'FSharp.Compiler' or '$(AssemblyName)' == 'FSharp.Compiler.Interactive.Settings' or '$(AssemblyName)' == 'FSharp.Compiler.Server.Shared' or '$(AssemblyName)' == 'fsc' or '$(AssemblyName)' == 'fsi' or '$(AssemblyName)' == 'fsiAnyCpu' or '$(AssemblyName)' == 'FSharp.Compiler.Unittests' or '$(AssemblyName)' == 'HostedCompilerServer'" >
32+
<When Condition="'$(AssemblyName)' == 'FSharp.Core' or '$(AssemblyName)' == 'FSharp.Build' or '$(AssemblyName)' == 'FSharp.Compiler' or '$(AssemblyName)' == 'FSharp.Compiler.Interactive.Settings' or '$(AssemblyName)' == 'FSharp.Compiler.Server.Shared' or '$(AssemblyName)' == 'fsc' or '$(AssemblyName)' == 'fsi' or '$(AssemblyName)' == 'fsiAnyCpu' or '$(AssemblyName)' == 'FSharp.Compiler.Unittests' or '$(AssemblyName)' == 'HostedCompilerServer' or '$(AssemblyName)' == 'ILComparer'" >
3333
<PropertyGroup Condition="'$(AssemblyName)' == 'FSharp.Core' and ('$(TargetFramework)' == 'portable47' or '$(TargetFramework)' == 'portable7' or '$(TargetFramework)' == 'portable78' or '$(TargetFramework)' == 'portable259' or '$(TargetFramework)' == 'coreclr')">
3434
<IsPortableProfile>true</IsPortableProfile>
3535
</PropertyGroup>

0 commit comments

Comments
 (0)