File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/test/kotlin/com/tomwyr Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -46,14 +46,24 @@ const val basePath = "src/test/resources/"
4646
4747fun setUpTestCommand (testCase : String , packageName : String ): GenerateTreeCommand {
4848 return GenerateTreeCommand (
49- libPath = " libGodotNodeTreeCore.dylib " ,
49+ libPath = " libGodotNodeTreeCore" + getLibExtension() ,
5050 projectPath = " $basePath /$testCase /scenes" ,
5151 validateProjectPath = false ,
5252 outputPath = " $basePath /$testCase /Actual" ,
5353 packageName = packageName,
5454 )
5555}
5656
57+ fun getLibExtension (): String {
58+ val osName = System .getProperty(" os.name" )
59+ return when {
60+ osName.contains(" Mac" , ignoreCase = true ) -> " .dylib"
61+ osName.contains(" Linux" , ignoreCase = true ) -> " .so"
62+ osName.contains(" Windows" , ignoreCase = true ) -> " .dll"
63+ else -> throw UnsupportedOperationException (" Unsupported OS" )
64+ }
65+ }
66+
5767fun assertOutputsEqual (testCase : String ) {
5868 val expected = File (" $basePath /$testCase /Expected" ).readText(Charsets .UTF_8 )
5969 val actual = File (" $basePath /$testCase /Actual" ).readText(Charsets .UTF_8 )
You can’t perform that action at this time.
0 commit comments