Skip to content

Commit ac37126

Browse files
committed
Merge pull request Azure#260 from Azure/clu
Clu
2 parents a930689 + 9df825c commit ac37126

File tree

14 files changed

+81
-59
lines changed

14 files changed

+81
-59
lines changed

src/CLU/CLUCoreCLR.sln

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.23107.0
4+
VisualStudioVersion = 14.0.24720.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Commands.Common", "Commands.Common\Commands.Common.xproj", "{5F567ACA-595E-436D-83DB-A21E08F82DF6}"
77
EndProject
@@ -37,7 +37,13 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.CLU.Run", "Micros
3737
EndProject
3838
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.CLU", "Microsoft.CLU\Microsoft.CLU.xproj", "{D0A59671-088D-463B-B060-2ADAFFB9C3F6}"
3939
EndProject
40-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.CLU.Test", "Microsoft.CLU.Test\Microsoft.CLU.Test.xproj", "{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}"
40+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Compute", "Microsoft.Azure.Commands.Compute\Microsoft.Azure.Commands.Compute.xproj", "{04F9968A-5662-4508-BEE2-31F56848FCBA}"
41+
ProjectSection(ProjectDependencies) = postProject
42+
{99B1290D-A073-4907-8018-51C714431778} = {99B1290D-A073-4907-8018-51C714431778}
43+
{3910613E-4ED2-49E2-8CCF-966D586665AC} = {3910613E-4ED2-49E2-8CCF-966D586665AC}
44+
{81A48E48-89A7-4B93-8207-4F8FA6DC251B} = {81A48E48-89A7-4B93-8207-4F8FA6DC251B}
45+
{45B05B68-516F-4D74-897F-56D12894946C} = {45B05B68-516F-4D74-897F-56D12894946C}
46+
EndProjectSection
4147
EndProject
4248
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Commands.Common.ScenarioTest", "Commands.Common.ScenarioTest\Commands.Common.ScenarioTest.xproj", "{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}"
4349
EndProject
@@ -49,7 +55,7 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Co
4955
{04F9968A-5662-4508-BEE2-31F56848FCBA} = {04F9968A-5662-4508-BEE2-31F56848FCBA}
5056
EndProjectSection
5157
EndProject
52-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Compute", "Microsoft.Azure.Commands.Compute\Microsoft.Azure.Commands.Compute.xproj", "{04F9968A-5662-4508-BEE2-31F56848FCBA}"
58+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.ScenarioTest.CLU", "Microsoft.ScenarioTests.CLU\Microsoft.ScenarioTest.CLU.xproj", "{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}"
5359
EndProject
5460
Global
5561
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -125,10 +131,10 @@ Global
125131
{D0A59671-088D-463B-B060-2ADAFFB9C3F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
126132
{D0A59671-088D-463B-B060-2ADAFFB9C3F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
127133
{D0A59671-088D-463B-B060-2ADAFFB9C3F6}.Release|Any CPU.Build.0 = Release|Any CPU
128-
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
129-
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
130-
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
131-
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.Build.0 = Release|Any CPU
134+
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
135+
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
136+
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
137+
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Release|Any CPU.Build.0 = Release|Any CPU
132138
{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
133139
{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}.Debug|Any CPU.Build.0 = Debug|Any CPU
134140
{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -137,10 +143,10 @@ Global
137143
{13C34370-51A4-4726-81B8-BE0996FC9CFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
138144
{13C34370-51A4-4726-81B8-BE0996FC9CFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
139145
{13C34370-51A4-4726-81B8-BE0996FC9CFF}.Release|Any CPU.Build.0 = Release|Any CPU
140-
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
141-
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
142-
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
143-
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Release|Any CPU.Build.0 = Release|Any CPU
146+
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
147+
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
148+
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
149+
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.Build.0 = Release|Any CPU
144150
EndGlobalSection
145151
GlobalSection(SolutionProperties) = preSolution
146152
HideSolutionNode = FALSE

src/CLU/Microsoft.CLU.Run/PackageManagementMode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ private static void GenerateScript(string cfgPath)
548548
" export CmdletSessionID=$PPID",
549549
"fi",
550550
"SCRIPTPATH=$(dirname \"$0\")",
551-
$"$SCRIPTPATH/clurun -s {scriptName} -r $SCRIPTPATH/{Path.GetFileName(cfgPath)} $*"
551+
$"$SCRIPTPATH/clurun -s {scriptName} -r $SCRIPTPATH/{Path.GetFileName(cfgPath)} \"$@\""
552552
});
553553
System.Diagnostics.Process.Start("chmod", $"777 {scriptPath}");
554554
}

src/CLU/Microsoft.CLU.Test/Content/package.cfg

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/CLU/Microsoft.CLU.Test/TestCLU.bat

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Name: Microsoft.ScenarioTests.CLU
2+
CommandAssemblies: Microsoft.ScenarioTests.CLU.dll
3+
NounPrefix: Test
4+
NounFirst: true
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
RtPackage: Microsoft.CLU.Commands
22
RtEntry: Microsoft.CLU.CommandModel.CmdletCommandModel.Run
33
RtAssembly: Microsoft.CLU.dll
4-
Modules: Microsoft.CLU.Test
5-
NounPrefix: AzureRm
4+
Modules: Microsoft.ScenarioTests.CLU

src/CLU/Microsoft.CLU.Test/Microsoft.CLU.Test.nuspec.template renamed to src/CLU/Microsoft.ScenarioTests.CLU/Microsoft.ScenarioTest.CLU.nuspec.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0"?>
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata minClientVersion="2.5">
4-
<id>Microsoft.CLU.Test</id>
4+
<id>Microsoft.ScenarioTests.CLU</id>
55
<title>Microsoft CLU CommandLine test command packge</title>
66
<version>%PackageVersion%</version>
77
<authors>Microsoft</authors>

src/CLU/Microsoft.CLU.Test/PipelineAliasTest.cs renamed to src/CLU/Microsoft.ScenarioTests.CLU/PipelineAliasTest.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,18 @@ protected override void ProcessRecord()
9696
WriteObject(new TestRecord() { Name = $"Matched {RecordName}", Value = $"Matched {Value}", SomethingElse = $"Matched {SomethingElse}" });
9797
}
9898
}
99+
100+
[Cmdlet(VerbsCommon.Show, "TestRecordFromParameter")]
101+
public class ShowTestRecordFromParameter : PSCmdlet
102+
{
103+
104+
[Parameter(Mandatory = true, ValueFromPipeline = true)]
105+
[Alias("Rec")]
106+
public TestRecord Record { get; set; }
107+
108+
protected override void ProcessRecord()
109+
{
110+
WriteObject(Record);
111+
}
112+
}
99113
}

src/CLU/Microsoft.CLU.Test/Properties/AssemblyInfo.cs renamed to src/CLU/Microsoft.ScenarioTests.CLU/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// General Information about an assembly is controlled through the following
1919
// set of attributes. Change these attribute values to modify the information
2020
// associated with an assembly.
21-
[assembly: AssemblyTitle("Microsoft.CLU.Test")]
21+
[assembly: AssemblyTitle("Microsoft.ScenarioTests.CLU")]
2222
[assembly: AssemblyDescription("")]
2323
[assembly: AssemblyConfiguration("")]
2424
[assembly: AssemblyCompany("")]
25-
[assembly: AssemblyProduct("Microsoft.CLU.Test")]
25+
[assembly: AssemblyProduct("Microsoft.ScenarioTests.CLU")]
2626
[assembly: AssemblyCopyright("Copyright © Microsoft")]
2727
[assembly: AssemblyTrademark("")]
2828
[assembly: AssemblyCulture("")]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
SETLOCAL EnableExtensions
2+
3+
ECHO Test return code success case
4+
call testclu success show 2> out.error
5+
REM We expect that the commands above succeed (return 0)
6+
IF %ERRORLEVEL% NEQ 0 (
7+
ECHO "Expected error level 0 for success, got " %ERRORLEVEL%
8+
EXIT /B 1
9+
)
10+
11+
ECHO Test return codes non terminating error case
12+
call testclu success show --generatenonterminatingerror true 2> out.error
13+
IF %ERRORLEVEL% NEQ 1 (
14+
ECHO "Expected error level 1 for non-terminating error, got " %ERRORLEVEL%
15+
EXIT /B 1
16+
)
17+
18+
ECHO Test return codes terminating error case
19+
call testclu success show --generateterminatingerror true 2> out.error
20+
IF %ERRORLEVEL% NEQ 2 (
21+
ECHO "Expected error level 2 for terminating error, got " %ERRORLEVEL%
22+
EXIT /B 1
23+
)
24+
25+
ECHO Test pipeline aliasing
26+
call testclu record new | testclu record show > out.txt
27+
IF %ERRORLEVEL% NEQ 0 (
28+
ECHO "Expected error level 0 for success, got " %ERRORLEVEL%
29+
EXIT /B 1
30+
)
31+
32+
33+
ECHO ALL TESTS ARE HAPPY

tools/CLU/BuildPackage.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
if (!(Test-Path $cmdletsDir))
44
{
5-
throw "cmdletsDir: '$cmdletsDir' must be an existing directory containing cmdlet code"
5+
throw "cmdletsDir: '$cmdletsDir' must be an existing directory containing cmdlet code"
66
}
77
if (!(Test-Path $outputDir))
88
{
9-
throw "outputDir: '$outputDir' must be an existing directory"
9+
throw "outputDir: '$outputDir' must be an existing directory"
1010
}
1111

1212
if ([string]::IsNullOrWhiteSpace($env:WORKSPACE) -or !(Test-Path $env:WORKSPACE))
1313
{
14-
throw "env:WORKSPACE: '$env:WORKSPACE' must be an existing directory"
14+
throw "env:WORKSPACE: '$env:WORKSPACE' must be an existing directory"
1515
}
1616

1717
$packageSource = $packageSource.TrimEnd('\\')
@@ -34,19 +34,19 @@ $contentFileText = ""
3434
$contentFiles | %{ $contentFileText += (" <file src=""" + $_.Name + """ target=""content""/>`r`n")}
3535
if ($packageId -ne "Microsoft.CLU.Commands")
3636
{
37-
$contentFileText += " <file src=""content\azure.lx"" target=""content""/>`r`n"
37+
$contentFileText += " <file src=""content\*.lx"" target=""content""/>`r`n"
3838
}
3939
if ($renameFileExists)
4040
{
41-
$contentFileText += " <file src=""content\rename.cfg"" target=""content""/>`r`n"
41+
$contentFileText += " <file src=""content\rename.cfg"" target=""content""/>`r`n"
4242
}
4343
$contentFileText += " <file src=""content\package.cfg"" target=""content""/>`r`n"
4444
$sourceFileText = ""
4545
$refFiles | %{$sourceFileText += (" <file src=""" + $_.Name + """ target=""lib\dnxcore50""/>`r`n")}
4646
$outputContent = $fileContent -replace "%PackageVersion%", $packageVersion
4747
$outputContent = $outputContent -replace "%ReferenceFiles%", $refFileText
48-
$outputContent = $outputContent -replace "%SourceFiles%", $sourceFileText
49-
$outputContent = $outputContent -replace "%ContentFiles%", $contentFileText
48+
$outputContent = $outputContent -replace "%SourceFiles%", $sourceFileText
49+
$outputContent = $outputContent -replace "%ContentFiles%", $contentFileText
5050
Set-Content -Value $outputContent -Path $nuspecOutput
5151

5252
Write-Host "Creating nuget package..."

0 commit comments

Comments
 (0)