-
Notifications
You must be signed in to change notification settings - Fork 393
end to end test with bash script #327
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "hi" | ||
get_completion_function_name_from_complete_output() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @omajid THANKS!!!!! IT WORKS!!!!!!!!!!! |
||
{ | ||
local output=("$@") | ||
local i | ||
for ((i = 0; i < "${#output[@]}"; i++)); do | ||
if [[ "${output[i]}" == "-F" ]]; then | ||
echo "${output[((i+1))]}" | ||
return 0 | ||
fi | ||
done | ||
return 1 | ||
} | ||
|
||
get_completions() | ||
{ | ||
COMP_WORDS=("$@") # completion to test | ||
COMP_LINE="$(local IFS=" "; echo "${COMP_WORDS[@]}")" | ||
COMP_CWORD=$((${#COMP_WORDS[@]} - 1)) # index into COMP_WORDS | ||
COMP_POINT="${#COMP_LINE}" # index of cursor position | ||
|
||
source dotnet-suggest-shim.bash | ||
|
||
local cmd=${COMP_WORDS[0]} | ||
|
||
local output=($(complete -p "$cmd")) | ||
local func=$(get_completion_function_name_from_complete_output "${output[@]}") | ||
|
||
#_dotnet_bash_complete | ||
"$func" | ||
|
||
echo "${COMPREPLY[@]}" > get_completions_result.txt | ||
} | ||
|
||
get_completions "$@" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'"> | ||
<Rid>win-x64</Rid> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'"> | ||
<Rid>osx-x64</Rid> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'"> | ||
<Rid>linux-x64</Rid> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.1</TargetFramework> | ||
|
@@ -9,12 +19,17 @@ | |
<ToolCommandName>dotnet-suggest</ToolCommandName> | ||
<PackAsToolShimRuntimeIdentifiers>win-x64;win-x86;osx-x64</PackAsToolShimRuntimeIdentifiers> | ||
<PackagedShimOutputRootDirectory>$(OutputPath)</PackagedShimOutputRootDirectory> | ||
<RuntimeIdentifier>$(Rid)</RuntimeIdentifier> | ||
<SelfContained>false</SelfContained> | ||
|
||
<!--warning about carried complete script. They are not used during nuget package--> | ||
<NoWarn>NU5111</NoWarn> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition=" $(Build_BuildId) != '' " > | ||
<PropertyGroup Condition=" $(Build_BuildId) != '' "> | ||
<Version>1.0.2.$(Build_BuildId)</Version> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
@@ -23,4 +38,13 @@ | |
<ProjectReference Include="..\System.CommandLine\System.CommandLine.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="dotnet-suggest-shim.bash"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We want to add auto copy-paste to bashrc in the future. So I let dotnet suggest carry them now to make it easier to test |
||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="dotnet-suggest-shim.ps1"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Help need. If
get-completions.sh
simply do an echo. stdOut cannot capture that. But testrunner output has it. I cannot make it work so I end up write to a file.