Skip to content

Commit

Permalink
Merge latest changes from 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
astares committed Sep 9, 2023
2 parents c3f913f + 5c0cd72 commit c20149a
Show file tree
Hide file tree
Showing 136 changed files with 2,420 additions and 1,303 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build

on: [push,pull_request,workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
smalltalk: [ Pharo64-7.0, Pharo64-8.0, Pharo64-9.0, Pharo64-10, Pharo64-11 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2
- name: Set up Smalltalk CI
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
- name: Load Image and Run Tests
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalkci/.unit-tests.ston
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 15
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
name: ${{matrix.os}}-${{matrix.smalltalk}}
token: ${{ secrets.CODECOV_TOKEN }}
16 changes: 16 additions & 0 deletions .smalltalkci/.unit-tests.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'Artefact',
#directory : '../src',
#load : [ 'CI' ],
#platforms : [ #pharo ]
}
],
#testing : {
#coverage : {
#packages : [ 'Artefact*' ],
#format: #lcov
}
}
}
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ Artefact is a framework to generate PDF documents in Pharo.

Artefact is written and supported by Olivier Auverlot and Guillaume Larcheveque (aka The Pasta Team)

[![Unit Tests](https://github.com/pharo-contributions/Pharo-Pomodoro/workflows/Build/badge.svg?branch=master)](https://github.com/pharo-contributions/Artefact/actions?query=workflow%3ABuild)
[![Coverage Status](https://codecov.io/github/pharo-contributions/Pharo-Pomodoro/coverage.svg?branch=master)](https://codecov.io/gh/pharo-contributions/Artefact/branch/master)

[![Pharo 6](https://img.shields.io/badge/Pharo-6.0-%23aac9ff.svg)](https://pharo.org/download)
[![Pharo 7](https://img.shields.io/badge/Pharo-7.0-%23aac9ff.svg)](https://pharo.org/download)
[![Pharo 8](https://img.shields.io/badge/Pharo-8.0-%23aac9ff.svg)](https://pharo.org/download)
[![Pharo 9](https://img.shields.io/badge/Pharo-9.0-%23aac9ff.svg)](https://pharo.org/download)
[![Pharo 10](https://img.shields.io/badge/Pharo-10-%23aac9ff.svg)](https://pharo.org/download)
[![Pharo 11](https://img.shields.io/badge/Pharo-11-%23aac9ff.svg)](https://pharo.org/download)

## Description

It is fully written in Smalltalk and doesn't require any native library. Artefact is light, platform independant and offer to users a high level of abstraction in order to easily creating PDF documents.
Expand Down Expand Up @@ -43,4 +53,4 @@ Note that you can replace the #master by another branch as #development or a tag

## Getting started

To start using Artefact, you should look at the Artefact tutorial in the Help Browser of Pharo (accessible from the World menu)
To start using Artefact, you should look at the Artefact tutorial in the Help Browser of Pharo (accessible from the World menu)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#instVars : [
'element'
],
#category : #'Artefact-Tests-Base'
#category : #'Artefact-Core-Tests-Base'
}

{ #category : #accessing }
Expand All @@ -19,10 +19,10 @@ PDFBasicTest >> element: anObject [

{ #category : #running }
PDFBasicTest >> setUp [
self element: PDFDummyBasic new.
self element: PDFDummyBasic new
]

{ #category : #tests }
PDFBasicTest >> testSplitCoordinates [
self assert: (self element splitCoordinates: 20@30) = '20 30'.
self assert: (self element splitCoordinates: 20@30) = '20 30'
]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Class {
#name : #PDFColorTest,
#superclass : #TestCase,
#category : #'Artefact-Tests-Base'
#category : #'Artefact-Core-Tests-Base'
}

{ #category : #tests }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#instVars : [
'aStream'
],
#category : #'Artefact-Tests-DataTypes'
#category : #'Artefact-Core-Tests-DataTypes'
}

{ #category : #utilities }
Expand All @@ -15,7 +15,7 @@ PDFDataTypeTest >> assert: aPDFDataType print: aString [

{ #category : #running }
PDFDataTypeTest >> setUp [
aStream := WriteStream on: ''.
aStream := WriteStream on: ''
]

{ #category : #tests }
Expand Down Expand Up @@ -61,12 +61,12 @@ PDFDataTypeTest >> testDataAssociativeArray [
dataArray addElement: (PDFDataReference reference: (PDFDataObject new id: 2; revision: 0; yourself)).
dataArray addElement: (PDFDataReference reference: (PDFDataObject new id: 5; revision: 0; yourself)).
dataArray addElement: (PDFDataReference reference: (PDFDataObject new id: 8; revision: 0; yourself)).

dataAssociativeArray := PDFDataAssociativeArray new.
dataAssociativeArray add:( PDFDataCouple key: (PDFDataSymbol symbol: 'Type') value: (PDFDataSymbol symbol: 'Pages' )).
dataAssociativeArray add:( PDFDataCouple key: (PDFDataSymbol symbol: 'Kids') value: dataArray).
dataAssociativeArray add:( PDFDataCouple key: (PDFDataSymbol symbol: 'Count') value: (PDFDataValue value: 3)).

self assert: dataAssociativeArray print: '<<',String lf, '/Type /Pages',String lf, '/Kids [ 2 0 R 5 0 R 8 0 R ]',String lf, '/Count 3',String lf, '>>'
]

Expand All @@ -82,9 +82,9 @@ PDFDataTypeTest >> testDataCouple [
dataArray addElement: (PDFDataReference reference: (PDFDataObject new id: 2; revision: 0; yourself)).
dataArray addElement: (PDFDataReference reference: (PDFDataObject new id: 5; revision: 0; yourself)).
dataArray addElement: (PDFDataReference reference: (PDFDataObject new id: 8; revision: 0; yourself)).

couple:= PDFDataCouple key: (PDFDataSymbol symbol: 'Kids') value: dataArray.

self assert: couple print: '/Kids [ 2 0 R 5 0 R 8 0 R ]'
]

Expand Down
16 changes: 16 additions & 0 deletions src/Artefact-Core-Tests/PDFDemosTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Class {
#name : #PDFDemosTest,
#superclass : #TestCase,
#category : #'Artefact-Core-Tests-Base'
}

{ #category : #tests }
PDFDemosTest >> testAllDemos [

| demos |
demos := PDFDemos new.
PDFDemos methods do: [ :m |
PDFDemos
streamNamed: 'allDemos.pdf'
do: [ :stream | demos perform: m selector with: stream ] ]
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Instance Variables
Class {
#name : #PDFDummyBasic,
#superclass : #PDFBasic,
#category : #'Artefact-Tests-Base'
#category : #'Artefact-Core-Tests-Base'
}

{ #category : #style }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Instance Variables
Class {
#name : #PDFDummyLayout,
#superclass : #PDFLayout,
#category : #'Artefact-Tests-Elements'
#category : #'Artefact-Core-Tests-Elements'
}

{ #category : #layouting }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
Class {
#name : #PDFElementTest,
#superclass : #TestCase,
#category : #'Artefact-Tests-Elements'
#category : #'Artefact-Core-Tests-Elements'
}

{ #category : #'tests orientation' }
{ #category : #'tests - orientation' }
PDFElementTest >> testOrientationBottomLeft [
self assert: (PDFElement determineOrientation: -20 mm @ 10mm) equals: #bottomLeft
]

{ #category : #'tests orientation' }
{ #category : #'tests - orientation' }
PDFElementTest >> testOrientationBottomRight [
self assert: (PDFElement determineOrientation: 20 mm @ 10mm) equals: #bottomRight
]

{ #category : #'tests orientation' }
{ #category : #'tests - orientation' }
PDFElementTest >> testOrientationDefaultCase [
self assert: (PDFElement determineOrientation: 0 mm @ 0 mm) equals: #bottomRight
]

{ #category : #'tests orientation' }
{ #category : #'tests - orientation' }
PDFElementTest >> testOrientationTopLeft [
self assert: (PDFElement determineOrientation: -20 mm @ -10mm) equals: #topLeft
]

{ #category : #'tests orientation' }
{ #category : #'tests - orientation' }
PDFElementTest >> testOrientationTopRight [
self assert: (PDFElement determineOrientation: 20 mm @ -10mm) equals: #topRight
]

{ #category : #tests }
PDFElementTest >> testRequiredAttributesIsFilled [
self shouldnt: [(PDFDummyLayout new from: 10mm@5mm; dimension: 5cm@12cm) checkAttributes] raise: ArtefactUndefinedAttribute
self shouldnt: [(PDFDummyLayout new from: 10mm@5mm; dimension: 5cm@12cm) checkAttributes] raise: ArtefactUndefinedAttribute
]

{ #category : #tests }
PDFElementTest >> testRequiredAttributesIsNotFilled [
self should: [PDFDummyLayout new checkAttributes] raise: ArtefactUndefinedAttribute
self should: [PDFDummyLayout new checkAttributes] raise: ArtefactUndefinedAttribute
]
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Class {
'doc',
'page'
],
#category : #'Artefact-Tests-Base'
#category : #'Artefact-Core-Tests-Base'
}

{ #category : #accessing }
Expand All @@ -30,14 +30,14 @@ PDFFontTest >> page: anObject [

{ #category : #running }
PDFFontTest >> setUp [
self doc: PDFDocument new.
self doc: PDFDocument new
]

{ #category : #running }
PDFFontTest >> tearDown [
PDFFontTest >> tearDown [
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testCourierBIWidth [
self
assert:
Expand All @@ -49,7 +49,7 @@ PDFFontTest >> testCourierBIWidth [
equals: 48 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testCourierBWidth [
self
assert:
Expand All @@ -60,7 +60,7 @@ PDFFontTest >> testCourierBWidth [
equals: 48 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testCourierIWidth [
self
assert:
Expand All @@ -71,7 +71,7 @@ PDFFontTest >> testCourierIWidth [
equals: 48 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testCourierWidth [
self
assert:
Expand All @@ -81,7 +81,7 @@ PDFFontTest >> testCourierWidth [
equals: 48 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testHelveticaBIWidth [
self
assert:
Expand All @@ -93,7 +93,7 @@ PDFFontTest >> testHelveticaBIWidth [
equals: 37 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testHelveticaBWidth [
self
assert:
Expand All @@ -104,7 +104,7 @@ PDFFontTest >> testHelveticaBWidth [
equals: 37 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testHelveticaIWidth [
self
assert:
Expand All @@ -115,7 +115,7 @@ PDFFontTest >> testHelveticaIWidth [
equals: 34 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testHelveticaWidth [
self
assert:
Expand All @@ -125,7 +125,7 @@ PDFFontTest >> testHelveticaWidth [
equals: 34 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testSymbolWidth [
self
assert:
Expand All @@ -135,7 +135,7 @@ PDFFontTest >> testSymbolWidth [
equals: 43 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testTimesBIWidth [
self
assert:
Expand All @@ -147,7 +147,7 @@ PDFFontTest >> testTimesBIWidth [
equals: 33 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testTimesBWidth [
self
assert:
Expand All @@ -158,7 +158,7 @@ PDFFontTest >> testTimesBWidth [
equals: 33 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testTimesIWidth [
self
assert:
Expand All @@ -169,7 +169,7 @@ PDFFontTest >> testTimesIWidth [
equals: 32 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testTimesWidth [
self
assert:
Expand All @@ -179,7 +179,7 @@ PDFFontTest >> testTimesWidth [
equals: 32 pt
]

{ #category : #fontsWidth }
{ #category : #'tests - fonts width' }
PDFFontTest >> testZapfdingbatsWidth [
self
assert:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Class {
#instVars : [
'generator'
],
#category : #'Artefact-Tests-Generator'
#category : #'Artefact-Core-Tests-Generator'
}

{ #category : #running }
PDFGeneratorTest >> setUp [
generator := PDFGenerator new.
generator := PDFGenerator new
]

{ #category : #tests }
Expand Down Expand Up @@ -61,5 +61,5 @@ PDFGeneratorTest >> testGeneratePDFVersion [
| dataType version |
version := '1.3'.
dataType:= generator generatePDFVersion: version.
self assert: dataType class equals: PDFDataComment.
self assert: dataType class equals: PDFDataComment
]
Loading

0 comments on commit c20149a

Please sign in to comment.