Skip to content

Commit f7e7edd

Browse files
committed
Prevent tests from creating directories in "/", so they can run without root privileges.
Signed-off-by: Marcus Better <marcus@better.se>
1 parent 8421cb1 commit f7e7edd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/test/java/jenkins/plugins/clangscanbuild/commands/ScanBuildCommandTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ public class ScanBuildCommandTest{
1818
@Test
1919
public void onlyRequiredOptionsSet() throws Exception{
2020
ScanBuildCommand command = new ScanBuildCommand();
21-
command.setClangOutputFolder( new FilePath( new File( "/OutputFolder" ) ) );
21+
command.setClangOutputFolder( new FilePath( new File( "OutputFolder" ) ) );
2222
command.setClangScanBuildPath( "/ScanBuild" );
2323
command.setProjectDirectory( new FilePath( new File( "/ProjectDir" ) ) );
2424

2525
String actual = buildCommandAndReturn( command );
2626

27-
String expected = "/ScanBuild -k -v -v -o /OutputFolder xcodebuild -activetarget -configuration Debug clean build";
27+
String expected = "/ScanBuild -k -v -v -o OutputFolder xcodebuild -activetarget -configuration Debug clean build";
2828
Assert.assertEquals( expected, actual );
2929
}
3030

3131
@Test
3232
public void xcode4WorkspaceSet() throws Exception{
3333
// XCode 4 workspace/scheme should override unnecessary target
3434
ScanBuildCommand command = new ScanBuildCommand();
35-
command.setClangOutputFolder( new FilePath( new File( "/OutputFolder" ) ) );
35+
command.setClangOutputFolder( new FilePath( new File( "OutputFolder" ) ) );
3636
command.setClangScanBuildPath( "/ScanBuild" );
3737
command.setConfig( "myConfig" );
3838
command.setProjectDirectory( new FilePath( new File( "/ProjectDir" ) ) );
@@ -43,15 +43,15 @@ public void xcode4WorkspaceSet() throws Exception{
4343

4444
String actual = buildCommandAndReturn( command );
4545

46-
String expected = "/ScanBuild -k -v -v -o /OutputFolder xcodebuild -workspace myWorkspace -scheme myScheme -configuration myConfig -sdk myTargetSdk clean build";
46+
String expected = "/ScanBuild -k -v -v -o OutputFolder xcodebuild -workspace myWorkspace -scheme myScheme -configuration myConfig -sdk myTargetSdk clean build";
4747
Assert.assertEquals( expected, actual );
4848
}
4949

5050
@Test
5151
public void xcode3TargetSet() throws Exception{
5252
// XCode 4 workspace/scheme should override unnecessary target
5353
ScanBuildCommand command = new ScanBuildCommand();
54-
command.setClangOutputFolder( new FilePath( new File( "/OutputFolder" ) ) );
54+
command.setClangOutputFolder( new FilePath( new File( "OutputFolder" ) ) );
5555
command.setClangScanBuildPath( "/ScanBuild" );
5656
command.setConfig( "myConfig" );
5757
command.setProjectDirectory( new FilePath( new File( "/ProjectDir" ) ) );
@@ -60,7 +60,7 @@ public void xcode3TargetSet() throws Exception{
6060

6161
String actual = buildCommandAndReturn( command );
6262

63-
String expected = "/ScanBuild -k -v -v -o /OutputFolder xcodebuild -target myTarget -configuration myConfig -sdk myTargetSdk clean build";
63+
String expected = "/ScanBuild -k -v -v -o OutputFolder xcodebuild -target myTarget -configuration myConfig -sdk myTargetSdk clean build";
6464
Assert.assertEquals( expected, actual );
6565
}
6666

0 commit comments

Comments
 (0)