A Docker-based test runner for Odin programming language challenges.
- Docker: Must be installed and running on your system
- Windows: For the PowerShell runner (
run.ps1) - Linux/macOS: For the bash runner (
run)
# Run the default "addition" example
& .\bin\run.ps1
# Run a specific example
& .\bin\run.ps1 -ExampleName "hello_world"# Run the default "addition" example
./bin/run
# Run a specific example
./bin/run hello_world.
├── Dockerfile # Docker image configuration with Odin compiler
├── README.md # This file
├── bin/
│ ├── run # Bash script for Linux/macOS
│ └── run.ps1 # PowerShell script for Windows
├── examples/ # Sample challenges with solutions
│ ├── addition/
│ │ ├── solution.odin
│ │ └── solution_test.odin
│ └── hello_world/
│ ├── solution.odin
│ └── solution_test.odin
└── workspace/ # Files needed by the Docker environment
├── codewars_reporter.odin # Test reporting framework
└── tests.odin # Main test runner
- Build Phase: If the Docker image doesn't exist, it's built from the Dockerfile
- Copy Phase: Example files are copied into the container
- Execution Phase: The Odin compiler runs the code with tests via
odin run . - Cleanup Phase: The container is removed after execution
examples/
└── my_challenge/
├── solution.odin
└── solution_test.odin
solution.odin:
package tests
// Your solution code here
solution :: proc(x: int) -> int {
return x * 2
}solution_test.odin:
package tests
do_tests :: proc() {
describe("Describe Your Test Suite", proc() {
it("Test case 1", proc() {
assert_equals(solution(5), 10)
})
it("Test case 2", proc() {
assert_equals(solution(0), 0)
})
})
}.\bin\run.ps1 -ExampleName "my_challenge"or
./bin/run my_challengeThe project includes a Codewars-compatible testing framework in workspace/codewars_reporter.odin with the following functions:
describe(name: string, proc())- Describe a test suiteit(name: string, proc())- Define a test caseassert_equals(actual, expected)- Assert equal valuespass()- Mark test as passedfail(message: string)- Mark test as failed
- Base: Ubuntu 22.04
- Odin Compiler: dev-2026-03 build