The Trunk: ST80Tests-fn.6.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ST80Tests-fn.6.mcz

commits-2
Fabio Niephaus uploaded a new version of ST80Tests to project The Trunk:
http://source.squeak.org/trunk/ST80Tests-fn.6.mcz

==================== Summary ====================

Name: ST80Tests-fn.6
Author: fn
Time: 16 February 2018, 2:58:20.729869 pm
UUID: 7fb784f8-d1b5-453f-a315-fb72b7bfa045
Ancestors: ST80Tests-dtl.5

'ST80' package no longer depends on Network. Also, classify methods.

=============== Diff against ST80Tests-dtl.5 ===============

Item was changed:
+ ----- Method: ST80PackageDependencyTest>>testPackage:dependsExactlyOn: (in category 'helpers') -----
- ----- Method: ST80PackageDependencyTest>>testPackage:dependsExactlyOn: (in category 'as yet unclassified') -----
  testPackage: pkgName dependsExactlyOn: pkgList
  "Ensure that the package with the given name depends only on the packages in pkgList.
  NOTE: If you use this for fixing dependencies, classDeps includes the classes
  and users from the package(s) not declared as dependents. Basically, you need
  to fix all the references in classDeps to make the test pass."
  | classDeps pi pkgDeps |
  classDeps := IdentityDictionary new.
  pi := PackageOrganizer default packageNamed: pkgName ifAbsent:[^self]. "unloaded"
  pi classes do:[:pkgClass|
  (classDeps at: (pkgClass superclass ifNil:[ProtoObject])
  ifAbsentPut:[OrderedCollection new]) add: pkgClass name, ' superclass'.
  ].
  pi methods do:[:mref| | cm |
  cm := mref compiledMethod.
  1 to: cm numLiterals do:[:i| | lit |
  ((lit := cm literalAt: i) isVariableBinding
  and:[lit value isBehavior]) ifTrue:[(classDeps at: lit value ifAbsentPut:[OrderedCollection new]) add: cm methodClass asString, '>>', cm selector]]].
  pkgDeps := Dictionary new.
  classDeps keys do:[:aClass| | pkg |
  pkg := PackageOrganizer default packageOfClass: aClass ifNone:[nil].
  pkg ifNil:[
  Transcript cr; show: 'WARNING: No package for ', aClass.
  (classDeps removeKey: aClass) do:[:each| Transcript crtab; show: each].
  ] ifNotNil:[
  (pkgDeps at: pkg name ifAbsentPut:[OrderedCollection new]) add: aClass.
  ].
  ].
  (pkgDeps removeKey: pkgName ifAbsent:[#()])
  do:[:aClass| classDeps removeKey: aClass ifAbsent:[]].
  pkgList do:[:pkg|
  self assert: (pkgDeps includesKey: pkg)
  description: pkgName, ' no longer depends on ', pkg.
  (pkgDeps removeKey: pkg ifAbsent: [#()])
  do:[:aClass| classDeps removeKey: aClass ifAbsent:[]].
  ].
  classDeps keysAndValuesDo:[:class :deps|
  Transcript cr; show: class name, ' dependencies:'.
  deps do:[:each| Transcript crtab; show: each].
  ].
  self assert: pkgDeps isEmpty
  description: pkgName, ' now depends on ', pkgDeps.
  !

Item was changed:
+ ----- Method: ST80PackageDependencyTest>>testST80 (in category 'tests') -----
- ----- Method: ST80PackageDependencyTest>>testST80 (in category 'as yet unclassified') -----
  testST80
  self testPackage: #ST80 dependsExactlyOn: #(
  #'Chronology-Core'
  Collections
  Compiler
  Files
  Graphics
  Kernel
  Morphic
  Multilingual
- Network
  SUnit
  System
  #'ToolBuilder-Kernel'
  Tools
  Monticello
  ).!