Skip to content

Conversation

@paul-hammant
Copy link
Contributor

This commit adds a complete port of the FiveAM testing framework from Common Lisp to ChrysaLisp. FiveAM is a well-established testing framework that provides a comprehensive set of test assertion macros, test suites, dependency management, and detailed result reporting.

Features implemented:

  • Core test definition macros (def-test, test)
  • Test suite organization (def-suite, in-suite)
  • Assertion macros (is, is-true, is-false, is-eq, is-equal)
  • Test execution and dependency resolution
  • Detailed result reporting and statistics
  • Pass/Fail/Skip/Error tracking
  • Example tests demonstrating usage

The port has been adapted to ChrysaLisp's functional/procedural style:

  • Uses Emap (environment maps) instead of CLOS classes
  • Uses ChrysaLisp's error handling (catch) instead of condition system
  • Simplified to match ChrysaLisp's macro capabilities
  • Maintains original BSD 3-Clause License

Credits:

  • Original FiveAM by Edward Marco Baringer (c) 2002-2003
  • Ported to ChrysaLisp 2025

Files added:

  • lib/test/test.inc - Main entry point with imports
  • lib/test/check.inc - Assertion macros
  • lib/test/suite.inc - Test suite management
  • lib/test/run.inc - Test execution engine
  • lib/test/explain.inc - Result reporting
  • lib/test/README.md - Documentation and usage examples
  • lib/test/examples/example-tests.inc - Example tests

claude and others added 3 commits November 16, 2025 12:35
This commit adds a complete port of the FiveAM testing framework from
Common Lisp to ChrysaLisp. FiveAM is a well-established testing framework
that provides a comprehensive set of test assertion macros, test suites,
dependency management, and detailed result reporting.

Features implemented:
- Core test definition macros (def-test, test)
- Test suite organization (def-suite, in-suite)
- Assertion macros (is, is-true, is-false, is-eq, is-equal)
- Test execution and dependency resolution
- Detailed result reporting and statistics
- Pass/Fail/Skip/Error tracking
- Example tests demonstrating usage

The port has been adapted to ChrysaLisp's functional/procedural style:
- Uses Emap (environment maps) instead of CLOS classes
- Uses ChrysaLisp's error handling (catch) instead of condition system
- Simplified to match ChrysaLisp's macro capabilities
- Maintains original BSD 3-Clause License

Credits:
- Original FiveAM by Edward Marco Baringer (c) 2002-2003
- Ported to ChrysaLisp 2025

Files added:
- lib/test/test.inc - Main entry point with imports
- lib/test/check.inc - Assertion macros
- lib/test/suite.inc - Test suite management
- lib/test/run.inc - Test execution engine
- lib/test/explain.inc - Result reporting
- lib/test/README.md - Documentation and usage examples
- lib/test/examples/example-tests.inc - Example tests
This commit fixes several ChrysaLisp syntax incompatibilities found during
testing of the FiveAM framework port.

Fixes applied:
- Fixed Emap :each method usage to use callback signature (e, key, val)
- Replaced destructuring assignment with explicit elem access
- Added missing collections.inc import
- Fixed every function to use lambda syntax
- Added comprehensive test suite and smoke tests
- Added TESTING.md documentation

Changes to core files:
- lib/test/test.inc: Added collections import
- lib/test/check.inc: Fixed Emap creation
- lib/test/suite.inc: Fixed Emap usage and :each callbacks
- lib/test/run.inc: Fixed :each callbacks and every usage
- lib/test/explain.inc: Replaced destructuring with elem access

New test files:
- lib/test/test_smoke.lisp: Minimal smoke test
- lib/test/test_fiveam.lisp: Comprehensive self-tests
- lib/test/TESTING.md: Testing documentation

Known issue:
- run.inc still causes segfault during import, needs further investigation

All syntax follows ChrysaLisp Development Guide best practices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants