Skip to content

Instantly share code, notes, and snippets.

View mabdi's full-sized avatar
😷

Mehrdad Abdi mabdi

😷
  • Universitet Antwerpen
  • Belgium
View GitHub Profile
@mabdi
mabdi / projectDetails.st
Last active April 22, 2020 12:57
Pharo Script: get number of classes, test classes, ...
| search packages classes testPackages tests focousedTests testMethodFocoused stat testrun |
search := 'project' asLowercase.
"replace with loading code"
Metacello new
baseline: '***';
repository: 'github://****';
load.
@mabdi
mabdi / runSmallAmp.py
Created April 22, 2020 13:01
I use this code to run smallamp inside a Ubuntu
import os
import glob
def getTodo():
f = open("todo.txt", "r")
todo = f.readlines()
f.close()
return todo
def checkDone(className):
@mabdi
mabdi / uage.py
Created April 23, 2020 09:57
Python read command-line args
import sys
try:
project = sys.argv[1]
prefix = sys.argv[2]
except IndexError:
raise SystemExit(f"Usage: {sys.argv[0]} <project-name> <packages prefix>")
| sendPush appId appAuthKey pushProc search packages testPackages tests targetedTests|
appId := 'TODO'.
appAuthKey := 'TODO'.
sendPush := [ :msg | |entity|
entity := STONJSON
toString:
{('app_id' -> appId).
('included_segments' -> #(All)).
('contents' -> {('en' -> msg)} asDictionary)} asDictionary.
ZnClient new
z := OrderedCollection new.
'SmallAmpTempClasses' asPackage definedClassesDo: [ :c |
c asClass testSelectors collect: [ :c2 |
s:= ((c asClass lookupSelector: c2) ast comments collect: #contents) select: [:m | m beginsWith: 'I test correctness of:'].
r := '- `' asRegex.
( z add: { s ifNotEmpty: [ (r matchesIn: s first)size ] ifEmpty: [ 0 ]. c. c2. }) ] ].
z sort: [ :a :b | (a at: 1) > (b at: 1) ]
@mabdi
mabdi / pretify.st
Last active October 13, 2020 15:52
| config readable reducer prettifier amplifiedClass targetClasses testClass result failedSelectorInOriginal selection notCoveredInOriginal |
amplifiedClass := RSResizeTest574.
config := SAConfig default.
testClass := amplifiedClass superclass.
targetClasses := testClass smallAmpTargetClasses.
result := testClass suite run.
failedSelectorInOriginal :=(result failures , result expectedDefects
collect: [ :failed | failed class lookupSelector: failed selector ])
asOrderedCollection.
selection := config selection initializeWith: config.
'From Pharo8.0.0 of 22 January 2020 [Build information: Pharo-8.0.0+build.1124.sha.0932da82f08175e906b0e2a8052120c823374e9f (64 Bit)] on 14 October 2020 at 4:06:48.881327 pm'!
RSChartTest subclass: #RSChartTest374
instanceVariableNames: ''
classVariableNames: ''
package: 'SmallAmpFinalClasses'!
!RSChartTest374 methodsFor: 'as yet unclassified' stamp: 'Mehrdad 10/9/2020 14:35'!
testMustInclude02_amp_A15_A29
"I test correctness of:
'From Pharo8.0.0 of 22 January 2020 [Build information: Pharo-8.0.0+build.1124.sha.0932da82f08175e906b0e2a8052120c823374e9f (64 Bit)] on 14 October 2020 at 4:08:16.160034 pm'!
RSHighlightableTest subclass: #RSHighlightableTest113
instanceVariableNames: ''
classVariableNames: ''
package: 'SmallAmpFinalClasses'!
!RSHighlightableTest113 methodsFor: 'as yet unclassified' stamp: 'Mehrdad 9/11/2020 01:02'!
testBasic_amp_N7
<smallAmpCoveres: 'RemoveCaretOperator#RSHighlightable#highlightShapes#18#34'>
<madeBySmallAmp>
'From Pharo8.0.0 of 22 January 2020 [Build information: Pharo-8.0.0+build.1124.sha.0932da82f08175e906b0e2a8052120c823374e9f (64 Bit)] on 14 October 2020 at 4:09:42.330761 pm'!
RSLabelTest subclass: #RSLabelTest439
instanceVariableNames: ''
classVariableNames: ''
package: 'SmallAmpFinalClasses'!
!RSLabelTest439 methodsFor: 'as yet unclassified' stamp: 'Mehrdad 10/9/2020 14:53'!
testHasChildren_amp_A12_A55_A119
"I test correctness of:
'From Pharo8.0.0 of 22 January 2020 [Build information: Pharo-8.0.0+build.1124.sha.0932da82f08175e906b0e2a8052120c823374e9f (64 Bit)] on 14 October 2020 at 4:10:53.791981 pm'!
RSResizeTest subclass: #RSResizeTest575
instanceVariableNames: ''
classVariableNames: ''
package: 'SmallAmpFinalClasses'!
!RSResizeTest575 methodsFor: 'as yet unclassified' stamp: 'Mehrdad 10/9/2020 15:53'!
testBiggestShape_amp_A16_A11
"I test correctness of: