# HG changeset patch # User Jan Vrany # Date 1429525400 -3600 # Node ID fde2d5969fbb2da62512c538ed2532db4eb5add8 # Parent dd353f15b0efa51f89358aeaac29a5f89482deea PPCBenchmarkResource updated to work on Smalltalk/X ...as API of FileReference and Filename differ. diff -r dd353f15b0ef -r fde2d5969fbb compiler/benchmarks/PPCBenchmarkResources.st --- a/compiler/benchmarks/PPCBenchmarkResources.st Sun Apr 19 22:28:48 2015 +0100 +++ b/compiler/benchmarks/PPCBenchmarkResources.st Mon Apr 20 11:23:20 2015 +0100 @@ -9,6 +9,7 @@ category:'PetitCompiler-Benchmarks-Core' ! + !PPCBenchmarkResources methodsFor:'as yet unclassified'! changesSized: size @@ -24,14 +25,14 @@ files := self readDirectory: directory. files := self files: files withExtension: 'java'. - ^ files collect: [ :f | (FileStream fileNamed: f) contents ] + ^ files collect: [ :f | (FileStream fileNamed: f) contents asString ] ! javaLangClass ! javaLangMath - ^ (FileStream fileNamed: '../java-src/java/lang/Math.java') contents + ^ (FileStream fileNamed: '../java-src/java/lang/Math.java') contents asString ! javaSourcesBig @@ -3963,7 +3964,7 @@ files := self readDirectory: directory. files := self files: files withExtension: 'st'. - ^ files collect: [ :f | (FileStream fileNamed: f) contents ] + ^ files collect: [ :f | (FileStream fileNamed: f) contents asString ] ! smalltalkObjectMethods @@ -3997,15 +3998,42 @@ !PPCBenchmarkResources methodsFor:'private utilities'! files: files withExtension: extension - ^ files select: [ :f | f extension = extension ] + ( (Smalltalk respondsTo: #isSmalltalkX) and:[ Smalltalk isSmalltalkX ] ) ifTrue:[ + ^ files select: [ :f | f suffix = extension ] + ] ifFalse:[ + "Assuming Pharo..." + ^ files select: [ :f | f extension = extension ] + ] + + "Modified: / 20-04-2015 / 10:58:38 / Jan Vrany " ! readDirectory: directory - | file | - file := directory asFileReference. - file exists ifTrue: [ - ^ file allFiles - ]. - ^ #() + | file | + + ( (Smalltalk respondsTo: #isSmalltalkX) and:[ Smalltalk isSmalltalkX ] ) ifTrue:[ + file := directory asFilename. + file exists ifFalse:[ + self error: 'Directory does not exist'. + ]. + ^ file recursiveDirectoryContentsAsFilenames select:[:each | each isRegularFile ] + ] ifFalse:[ + "Assuming Pharo..." + + file := directory asFileReference. + file exists ifFalse: [ + self error: 'Directory does not exist'. + ]. + ^ file allFiles + ] + + "Modified: / 20-04-2015 / 11:12:33 / Jan Vrany " ! ! +!PPCBenchmarkResources class methodsFor:'documentation'! + +version_HG + + ^ '$Changeset: $' +! ! +