Skip to content

Commit 9d493c7

Browse files
committed
chore: prepare v0.2.1 release
1 parent eb1ceae commit 9d493c7

File tree

3 files changed

+88
-37
lines changed

3 files changed

+88
-37
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,16 @@
3434
### Changed
3535
- Compiler pipeline now includes TACKY transformation stage
3636
- Assembly generation now works from TACKY rather than directly from AST
37-
- Parser improved to handle nested expressions correctly
37+
- Parser improved to handle nested expressions correctly
38+
39+
## 0.2.1.0 -- 2024-11-25
40+
41+
### Added
42+
- Comprehensive test suite with Hspec and Tasty
43+
- Unit tests for all compiler stages:
44+
- Lexer tests
45+
- Parser tests
46+
- TACKY generation tests
47+
- Assembly generation tests
48+
- Full pipeline integration tests
49+
- Test utilities and helper functions in Test.Common

README.md

Lines changed: 73 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -65,40 +65,47 @@ Programs are represented internally using a series of increasingly lower-level d
6565

6666
## Project Structure
6767

68-
```
69-
.
70-
├── app/ # Application entry point
71-
│ └── Main.hs
72-
├── bin/ # Binary outputs
73-
├── lib/ # Main library code
74-
│ ├── Halcyon.hs # Library entry point
75-
│ └── Halcyon/ # Core modules
76-
│ ├── Backend/ # Code generation and emission
77-
│ │ ├── Codegen.hs # TACKY to Assembly conversion
78-
│ │ ├── Emit.hs # Assembly to text output
79-
│ │ └── ReplacePseudos.hs # Register/stack allocation
80-
│ ├── Core/ # Core data types and utilities
81-
│ │ ├── Assembly.hs # Assembly representation
82-
│ │ ├── Ast.hs # C language AST
83-
│ │ ├── Monad.hs # Compiler monad stack
84-
│ │ ├── Settings.hs # Compiler settings and types
85-
│ │ ├── Tacky.hs # TACKY IR definition
86-
│ │ └── TackyGen.hs # AST to TACKY transformation
87-
│ ├── Driver/ # Compiler driver
88-
│ │ ├── Cli.hs # Command line interface
89-
│ │ └── Pipeline.hs # Compilation pipeline
90-
│ └── Frontend/ # Parsing and analysis
91-
│ ├── Lexer.hs # Lexical analysis
92-
│ ├── Parse.hs # Parsing
93-
│ └── Tokens.hs # Token definitions
94-
├── test/ # Test suite
95-
│ └── Main.hs
96-
├── CHANGELOG.md # Version history
97-
├── LICENSE # Project license
98-
├── README.md # Project documentation
99-
├── flake.nix # Nix build configuration
100-
└── halcyon.cabal # Cabal build configuration
101-
```
68+
```
69+
.
70+
├── app/ # Application entry point
71+
│ └── Main.hs
72+
├── bin/ # Binary outputs
73+
├── lib/ # Main library code
74+
│ ├── Halcyon.hs # Library entry point
75+
│ └── Halcyon/ # Core modules
76+
│ ├── Backend/ # Code generation and emission
77+
│ │ ├── Codegen.hs # TACKY to Assembly conversion
78+
│ │ ├── Emit.hs # Assembly to text output
79+
│ │ └── ReplacePseudos.hs # Register/stack allocation
80+
│ ├── Core/ # Core data types and utilities
81+
│ │ ├── Assembly.hs # Assembly representation
82+
│ │ ├── Ast.hs # C language AST
83+
│ │ ├── Monad.hs # Compiler monad stack
84+
│ │ ├── Settings.hs # Compiler settings and types
85+
│ │ ├── Tacky.hs # TACKY IR definition
86+
│ │ └── TackyGen.hs # AST to TACKY transformation
87+
│ ├── Driver/ # Compiler driver
88+
│ │ ├── Cli.hs # Command line interface
89+
│ │ └── Pipeline.hs # Compilation pipeline
90+
│ └── Frontend/ # Parsing and analysis
91+
│ ├── Lexer.hs # Lexical analysis
92+
│ ├── Parse.hs # Parsing
93+
│ └── Tokens.hs # Token definitions
94+
├── test/ # Test suite
95+
│ ├── Main.hs
96+
│ └── Test/
97+
│ ├── Lexer.hs
98+
│ ├── Parser.hs
99+
│ ├── Tacky.hs
100+
│ ├── Assembly.hs
101+
│ ├── Pipeline.hs
102+
│ └── Common.hs
103+
├── CHANGELOG.md # Version history
104+
├── LICENSE # Project license
105+
├── README.md # Project documentation
106+
├── flake.nix # Nix build configuration
107+
└── halcyon.cabal # Cabal build configuration
108+
```
102109
103110
### Architecture
104111
@@ -147,6 +154,37 @@ cabal run halcyon -- input.c
147154
cabal run halcyon -- --lex input.c
148155
```
149156

157+
## Testing
158+
159+
Halcyon uses Hspec and Tasty for its test suite. The tests cover all stages of compilation:
160+
161+
```bash
162+
# Run all tests
163+
cabal test
164+
165+
# Run tests with output
166+
cabal test --test-show-details=direct
167+
168+
# Run a specific test module
169+
cabal test --test-pattern "Lexer"
170+
```
171+
172+
The test suite includes:
173+
174+
- Unit tests for each compiler stage
175+
- Integration tests for the full pipeline
176+
- Helper utilities for building test cases
177+
178+
Tests are organized by compiler stage in `test/Test/`:
179+
180+
- `Lexer.hs`: Token generation
181+
- `Parser.hs`: AST construction
182+
- `Tacky.hs`: TACKY IR generation
183+
- `Assembly.hs`: Assembly generation
184+
- `Pipeline.hs`: Full compilation pipeline
185+
- `Common.hs`: Shared test utilities
186+
187+
150188
## External Dependencies
151189

152190
Halcyon relies on the following system tools:
@@ -168,7 +206,7 @@ The compiler provides detailed error reporting for:
168206

169207
### The Basics
170208
- [x] A minimal compiler
171-
- [ ] Unary operators
209+
- [x] Unary operators
172210
- [ ] Binary operators
173211
- [ ] Logical and relational operators
174212
- [ ] Local variables

halcyon.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: halcyon
3-
version: 0.2.0.0
3+
version: 0.2.1.0
44
-- synopsis:
55
-- description:
66
license: BSD-3-Clause
@@ -70,6 +70,7 @@ test-suite halcyon-test
7070
, Test.Parser
7171
, Test.Tacky
7272
, Test.Assembly
73+
, Test.Pipeline
7374
-- other-extensions:
7475
type: exitcode-stdio-1.0
7576
hs-source-dirs: test

0 commit comments

Comments
 (0)