RegressionTests__Helper.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 18:53:03 +0200
changeset 2327 bf482d49aeaf
parent 1995 bb6692faf0a6
permissions -rw-r--r--
#QUALITY by exept class: RegressionTests::StringTests added: #test82c_expanding

"{ Encoding: utf8 }"

"{ Package: 'stx:goodies/regression' }"

"{ NameSpace: RegressionTests }"

Object subclass:#Helper
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'tests-Regression-Helper'
!

!Helper class methodsFor:'documentation'!

documentation
"
    documentation to be added.

    [author:]
        sr

    [instance variables:]

    [class variables:]

    [see also:]

"
! !

!Helper class methodsFor:'queries'!

isStcCompiledMethod:aMethod in:instance
    ^ self 
        isStcCompiledMethod:aMethod
        inClass:instance class

    "Modified (format): / 30-07-2018 / 09:16:27 / Stefan Vogel"
!

isStcCompiledMethod:aMethod inClass:aClass
    |compiledMethod|

    compiledMethod := aClass compiledMethodAt:aMethod.
    ^ compiledMethod notNil and:[compiledMethod byteCode isNil]

    "Modified (format): / 30-07-2018 / 09:16:15 / Stefan Vogel"
!

packageDirectoryForRegressionTests
    ^ self workDirectory / 'stx' / 'goodies' / 'regression'     
!

smalltalkDirectory
    ^ self workDirectory / 'stx' / 'projects' / 'smalltalk'     
!

workDirectory
    "return the directory one above the stx folder"

    |directoryOfStandaloneBinary dir parent|

    directoryOfStandaloneBinary := OperatingSystem nameOfSTXExecutable asFilename directory.
    "/ search for the directory above stx/goodies
    dir := directoryOfStandaloneBinary.
    [ 
        parent := dir directory.
        (dir pathName ~= parent pathName)
        and:[ (dir / 'stx' / 'goodies' / 'regression') exists not ]
    ] whileTrue:[
        dir := parent.
    ].
    (dir / 'stx/goodies/regression') exists ifFalse:[self error:'where am I?' ].
    ^ dir.
"/    (directoryOfStandaloneBinary pathName includesSubString:'quickSelfTest') ifTrue:[
"/        "this test is called by /stx/goodies/builder/quickSelfTest"
"/        dir := directoryOfStandaloneBinary.
"/        dir 
"/        ^ directoryOfStandaloneBinary 
"/            directory "/ /stx/goodies/builder/
"/            directory "/ /stx/goodies/  
"/            directory "/ /stx  
"/            directory "/ <one above>
"/    ].
"/
"/    ^ directoryOfStandaloneBinary directory directory directory 
! !

!Helper class methodsFor:'documentation'!

version
    ^ '$Header$'
!

version_CVS
    ^ '$Header$'
! !