Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macOS-x64 testing #1177

Merged
merged 7 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
which gdb
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
# TODO: Try to make core dumps work
# Related CoreDump Tests: https://github.com/microsoft/MIEngine/issues/1170
# echo 1 | sudo tee /proc/sys/kernel/core_uses_pid
# ulimit -S -c unlimited
# sudo sysctl -w kernel.core_pattern=${{ github.workspace }}/core.%e
Expand Down Expand Up @@ -150,4 +151,19 @@ jobs:
run: dotnet build ${{ github.workspace }}/src/MIDebugEngine-Unix.sln

- run: |
${{ github.workspace }}/PublishOpenDebugAD7.sh -c Debug -o ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters
${{ github.workspace }}/PublishOpenDebugAD7.sh -c Debug -o ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters
cp ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/TestConfigurations/config_lldb.xml ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/config.xml

- name: Download LLDB-MI
run: |
${{ github.workspace }}/tools/DownloadLldbMI.sh ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters

- run: |
dotnet test ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/CppTests.dll

- name: 'Upload Test Results'
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: osx_x64_results
path: ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/results.trx
22 changes: 22 additions & 0 deletions test/CppTests/TestConfigurations/config_lldb.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<TestMachineConfiguration>
<TestConfigurations>
<TestConfiguration
Compiler="Clang"
DebuggeeArchitecture="x64"
Debugger="Lldb" />
</TestConfigurations>
<Compilers>
<Compiler
Name="Clang"
Type="ClangPlusPlus"
Path="/usr/bin/clang++" />
</Compilers>
<Debuggers>
<!-- By not specifying the Path, LLDB that ships with the extension will be used. -->
<Debugger
Name="Lldb"
Type="Lldb"
MIMode="lldb" />
</Debuggers>
</TestMachineConfiguration>
6 changes: 4 additions & 2 deletions test/CppTests/Tests/BreakpointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ public void FunctionBreakpointsBasic(ITestSettings settings)
[Theory]
[DependsOnTest(nameof(CompileKitchenSinkForBreakpointTests))]
[RequiresTestSettings]
// TODO: Re-enable for Gdb_Gnu
[UnsupportedDebugger(SupportedDebugger.Gdb_Gnu | SupportedDebugger.Gdb_Cygwin | SupportedDebugger.Gdb_MinGW, SupportedArchitecture.x64 | SupportedArchitecture.x86)]
// TODO: https://github.com/microsoft/MIEngine/issues/1170
// - gdb_gnu
// - lldb
[UnsupportedDebugger(SupportedDebugger.Lldb | SupportedDebugger.Gdb_Gnu | SupportedDebugger.Gdb_Cygwin | SupportedDebugger.Gdb_MinGW, SupportedArchitecture.x64 | SupportedArchitecture.x86)]
public void RunModeBreakpoints(ITestSettings settings)
{
this.TestPurpose("Tests setting breakpoints while in run mode");
Expand Down
9 changes: 6 additions & 3 deletions test/CppTests/Tests/CoreDumpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public CoreDumpTests(ITestOutputHelper outputHelper) : base(outputHelper)
[Theory]
[RequiresTestSettings]
[SupportedPlatform(SupportedPlatform.Linux, SupportedArchitecture.x64 | SupportedArchitecture.x86)]
// TODO: Re-enable for Gdb_Gnu
// TODO: https://github.com/microsoft/MIEngine/issues/1170
// - gdb_gnu
[UnsupportedDebugger(SupportedDebugger.Gdb_Gnu, SupportedArchitecture.x64 | SupportedArchitecture.x86)]
public void CoreDumpBasic(ITestSettings settings)
{
Expand All @@ -68,7 +69,8 @@ public void CoreDumpBasic(ITestSettings settings)
[Theory]
[RequiresTestSettings]
[SupportedPlatform(SupportedPlatform.Linux, SupportedArchitecture.x64 | SupportedArchitecture.x86)]
// TODO: Re-enable for Gdb_Gnu
// TODO: https://github.com/microsoft/MIEngine/issues/1170
// - gdb_gnu
[UnsupportedDebugger(SupportedDebugger.Gdb_Gnu, SupportedArchitecture.x64 | SupportedArchitecture.x86)]
public void CoreDumpBasicMismatchedSourceAndSymbols(ITestSettings settings)
{
Expand All @@ -88,7 +90,8 @@ public void CoreDumpBasicMismatchedSourceAndSymbols(ITestSettings settings)
[Theory]
[RequiresTestSettings]
[SupportedPlatform(SupportedPlatform.Linux, SupportedArchitecture.x64 | SupportedArchitecture.x86)]
// TODO: Re-enable for Gdb_Gnu
// TODO: https://github.com/microsoft/MIEngine/issues/1170
// - gdb_gnu
[UnsupportedDebugger(SupportedDebugger.Gdb_Gnu, SupportedArchitecture.x64 | SupportedArchitecture.x86)]
public void CoreDumpVerifyActions(ITestSettings settings)
{
Expand Down
6 changes: 6 additions & 0 deletions test/CppTests/Tests/ExpressionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ public void DataTipBasic(ITestSettings settings)

[Theory]
[DependsOnTest(nameof(CompileKitchenSinkForExpressionTests))]
// TODO: https://github.com/microsoft/MIEngine/issues/1170
// - lldb
[UnsupportedDebugger(SupportedDebugger.Lldb, SupportedArchitecture.x64 | SupportedArchitecture.x86)]
[RequiresTestSettings]
public void CallStackBasic(ITestSettings settings)
{
Expand Down Expand Up @@ -328,6 +331,9 @@ public void EvaluateOnFrames(ITestSettings settings)

[Theory]
[DependsOnTest(nameof(CompileKitchenSinkForExpressionTests))]
// TODO: https://github.com/microsoft/MIEngine/issues/1170
// - lldb
[UnsupportedDebugger(SupportedDebugger.Lldb, SupportedArchitecture.x64 | SupportedArchitecture.x86)]
[RequiresTestSettings]
public void EvaluateInvalidExpression(ITestSettings settings)
{
Expand Down
8 changes: 6 additions & 2 deletions test/CppTests/Tests/SharedLibTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public void CompileSharedLibDebuggee(ITestSettings settings)

[Theory]
[DependsOnTest(nameof(CompileSharedLibDebuggee))]
[UnsupportedDebugger(SupportedDebugger.VsDbg, SupportedArchitecture.x86 | SupportedArchitecture.x64)]
// TODO: https://github.com/microsoft/MIEngine/issues/1170
// - lldb
[UnsupportedDebugger(SupportedDebugger.VsDbg | SupportedDebugger.Lldb, SupportedArchitecture.x86 | SupportedArchitecture.x64)]
[RequiresTestSettings]
public void SharedLibBasic(ITestSettings settings)
{
Expand All @@ -66,7 +68,9 @@ public void SharedLibBasic(ITestSettings settings)
}

[Theory]
[UnsupportedDebugger(SupportedDebugger.VsDbg, SupportedArchitecture.x86 | SupportedArchitecture.x64)]
// TODO: https://github.com/microsoft/MIEngine/issues/1170
// - lldb
[UnsupportedDebugger(SupportedDebugger.VsDbg | SupportedDebugger.Lldb, SupportedArchitecture.x86 | SupportedArchitecture.x64)]
[RequiresTestSettings]
public void SharedLibMismatchSourceAndSymbols(ITestSettings settings)
{
Expand Down
41 changes: 41 additions & 0 deletions tools/DownloadLldbMI.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#! /bin/bash
lldbMIDownloadLink="https://download.visualstudio.microsoft.com/download/pr/173e6ced-0717-401d-87fc-169ca3424c72/f1228fd847c140b7f9839612f497bb7a/lldb-mi-10.0.0.zip"
toolsDirectory=$(dirname "$0")

# Go to root project folder
pushd "$toolsDirectory/.." > /dev/null 2>&1 || exit 1

if [ -z "$1" ] || [ "$1" == "-h" ]; then
echo "Please pass in output folder of publish"
echo "Example: $0 $(pwd)/bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters"
exit 1
fi

if [ ! -f "./bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters/OpenDebugAD7" ]; then
echo "Please build MIDebugEngine-Unix.sln and run PublishOpenDebugAD7.sh before running DownloadLldbMI.sh"
popd || exit
exit 1
fi

# Download the latest version of lldb-ui that vscode-cpptools uses.
if ! `curl $lldbMIDownloadLink --output ./lldb-mi-10.0.0.zip > /dev/null 2>&1` ; then
echo "Failed to download lldb-mi."
exit 1
fi

unzip -o ./lldb-mi-10.0.0.zip > /dev/null 2>&1
WardenGnaw marked this conversation as resolved.
Show resolved Hide resolved

if [ ! -f ./debugAdapters/lldb-mi/bin/lldb-mi ]; then
echo "Failed to unzip."
fi

# Ensure we can run it or we will get permission denied.
if ! `sudo chmod 755 ./debugAdapters/lldb-mi/bin/lldb-mi` ; then
echo "Failed to change permissions for lldb-mi."
exit 1
fi

# Clean up unused zip
rm ./lldb-mi-10.0.0.zip

popd > /dev/null 2>&1 || exit