Skip to content

Commit ac780dd

Browse files
william-lavertyWilliam Lavertyclaude
authored
Add comprehensive test suite and GitHub Actions CI (#2)
* Add comprehensive test suite and GitHub Actions CI - Add 30+ test cases covering execution, errors, globals, functions, booleans, macros, multi-return, multiple instances, and error messages - Add macro expansion tests with diagnostic validation - Add GitHub Actions workflow (macOS 14, Xcode 15.4) - CI runs on push to main and all PRs - Clean up stale test files * Fix demo: add missing try for throwing execute() * Fix linker error: add LuaKitMacros dependency to LuaKitTests target The macro test file imports LuaKitMacros directly to reference LuaFunctionMacro.self, but the test target was missing the dependency, causing undefined symbol errors at link time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: William Laverty <william@laverty.dev> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 943084d commit ac780dd

7 files changed

Lines changed: 558 additions & 50 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build-and-test:
15+
name: Build & Test
16+
runs-on: macos-14
17+
strategy:
18+
matrix:
19+
xcode: ['15.4']
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Select Xcode ${{ matrix.xcode }}
24+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
25+
26+
- name: Install Lua
27+
run: brew install lua
28+
29+
- name: Build
30+
run: swift build -v
31+
32+
- name: Run Tests
33+
run: swift test -v

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ let package = Package(
2626
name: "LuaKitTests",
2727
dependencies: [
2828
"LuaKit",
29+
"LuaKitMacros",
2930
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax")
3031
]),
3132
.macro(name: "LuaKitMacros",

Sources/LuaKitDemo/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ do {
2929
"""#
3030

3131
// Execute Lua code using the Lua instance
32-
lua.execute(source: source)
32+
try lua.execute(source: source)
3333
}
3434
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// LuaDemoTests.swift
3+
// Placeholder for demo integration tests.
4+
// Created by William Laverty on 14/12/2023.
5+
//
6+
7+
import XCTest
8+
9+
final class LuaDemoTests: XCTestCase {
10+
func testDemoTargetBuilds() throws {
11+
// Validates the demo target compiles successfully
12+
XCTAssertTrue(true)
13+
}
14+
}

Tests/LuaDemoTests/LuaIntegrationTest.swift

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)