Fix in BenchmarkRunnerAdapterStX: the adapter itself must expand --script/--arguments.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 24 Sep 2014 20:13:18 +0100
changeset 215 e77c83f18c83
parent 214 581bea1986f0
child 216 be26cc6e8795
Fix in BenchmarkRunnerAdapterStX: the adapter itself must expand --script/--arguments. Otherwise it won't be possible to use Smalltalk/X specific options in script file.
s/stx/BenchmarkRunnerAdapterStX.st
s/stx/Make.proto
s/stx/bc.mak
s/stx/stx.rc
--- a/s/stx/BenchmarkRunnerAdapterStX.st	Mon Aug 25 10:06:56 2014 +0100
+++ b/s/stx/BenchmarkRunnerAdapterStX.st	Wed Sep 24 20:13:18 2014 +0100
@@ -234,8 +234,9 @@
 !BenchmarkRunnerAdapterStX class methodsFor:'startup-to be redefined'!
 
 main:argv0
-    | argv i packages enableSmalltalkJIT enableJavaJIT |    
+    | runner argv i packages enableSmalltalkJIT enableJavaJIT |    
 
+    runner := BenchmarkRunner new.
     enableSmalltalkJIT := enableJavaJIT := true.
     [
         packages := OrderedCollection new.
@@ -256,13 +257,35 @@
             ].
             arg = '--disable-jit' ifTrue:[ 
                 enableSmalltalkJIT := enableJavaJIT := false.
+                argv removeIndex: i.
+                i := i - 1.
             ].
             arg = '--disable-jit-java' ifTrue:[ 
                 enableJavaJIT := false.
+                argv removeIndex: i.
+                i := i - 1.
             ]. 
             arg = '--disable-jit-smalltalk' ifTrue:[ 
                 enableJavaJIT := false.
+                argv removeIndex: i.
+                i := i - 1.
             ]. 
+            (arg = '--arguments' or:[arg = '--script']) ifTrue:[
+                | arguments argumentsF parsed |
+
+                i > argv size ifTrue:[
+                    self error: arg, ' requires a file parameter.'
+                ].                
+                argumentsF := (arguments := (argv at: i + 1)) asFilename.
+                argumentsF exists ifFalse:[
+                    self error:'no such file: ', arguments.
+                ].
+                parsed := OrderedCollection new.
+                argumentsF readingFileDo:[:f | runner parseArguments: f into: parsed ].
+                argv removeIndex: i; removeIndex: i.
+                i := i - 1.
+                argv addAll: parsed beforeIndex: i + 1.
+            ].      
             i := i + 1.
         ].
 
@@ -277,7 +300,7 @@
         self setupForPerformance.
         self setupJITSmalltalk: (enableSmalltalkJIT).  
         self setupJITJava: (enableJavaJIT).
-        BenchmarkRunner new main: argv
+        runner main: argv
 
     ] on: Error do:[:ex|
         debugging ifTrue:[
@@ -298,7 +321,7 @@
     Smalltalk exit: 0.
 
     "Created: / 06-06-2013 / 10:07:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 22-05-2014 / 12:19:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 24-09-2014 / 20:12:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !BenchmarkRunnerAdapterStX class methodsFor:'documentation'!
--- a/s/stx/Make.proto	Mon Aug 25 10:06:56 2014 +0100
+++ b/s/stx/Make.proto	Wed Sep 24 20:13:18 2014 +0100
@@ -34,7 +34,7 @@
 # add the path(es) here:,
 # ********** OPTIONAL: MODIFY the next lines ***
 # LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES= -I$(INCLUDE_TOP)/jv/calipel/s -I$(INCLUDE_TOP)/stx/libbasic
+LOCALINCLUDES= -I$(INCLUDE_TOP)/jv/calipel/s -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/libjava
 
 
 # if you need any additional defines for embedded C code,
--- a/s/stx/bc.mak	Mon Aug 25 10:06:56 2014 +0100
+++ b/s/stx/bc.mak	Wed Sep 24 20:13:18 2014 +0100
@@ -34,7 +34,7 @@
 
 
 
-LOCALINCLUDES= -I$(INCLUDE_TOP)\jv\calipel\s -I$(INCLUDE_TOP)\stx\libbasic
+LOCALINCLUDES= -I$(INCLUDE_TOP)\jv\calipel\s -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\libjava
 LOCALDEFINES=
 
 STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
--- a/s/stx/stx.rc	Mon Aug 25 10:06:56 2014 +0100
+++ b/s/stx/stx.rc	Wed Sep 24 20:13:18 2014 +0100
@@ -4,7 +4,7 @@
 //
 VS_VERSION_INFO VERSIONINFO
   FILEVERSION     6,2,32767,32767
-  PRODUCTVERSION  6,2,3,0
+  PRODUCTVERSION  6,2,4,0
 #if (__BORLANDC__)
   FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
   FILEFLAGS       VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
@@ -24,8 +24,8 @@
       VALUE "InternalName", "jv:calipel/s/stx\0"
       VALUE "LegalCopyright", "My CopyRight or CopyLeft\0"
       VALUE "ProductName", "ProductName\0"
-      VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Wed, 21 May 2014 12:08:42 GMT\0"
+      VALUE "ProductVersion", "6.2.4.0\0"
+      VALUE "ProductDate", "Wed, 24 Sep 2014 19:12:24 GMT\0"
     END
 
   END