test: add comprehensive tests and CI for export feature

Add extensive test coverage, demo program, and CI integration for
//export with different names feature:

Unit Tests (cl/builtin_test.go):
- TestHandleExportDiffName: core functionality with 4 scenarios
  * Different names with enableExportRename
  * Same names with enableExportRename
  * Different names with spaces in export directive
  * Matching names without enableExportRename
- TestInitLinknameByDocExportDiffNames: flag behavior verification
  * Export with different names when enabled
  * Export with same name when enabled
  * Normal linkname directives
- TestInitLinkExportDiffNames: edge case handling
  * Symbol not found in decl packages (silent handling)

Demo (_demo/embed/export/):
- Example program demonstrating various export patterns
- Verification script testing both embedded and non-embedded targets
- Documents expected behavior and error cases

CI Integration (.github/workflows/llgo.yml):
- Add export demo to embedded target tests
- Ensure feature works correctly across platforms
- Catch regressions in future changes

The tests verify:
✓ Different names work with -target flag
✓ Same names work in all cases
✓ Different names fail without -target flag
✓ Proper error messages for invalid exports
✓ Silent handling for decl packages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
luoliwoshang
2025-11-10 18:52:58 +08:00
parent dac3365c73
commit e11ae0e21b
5 changed files with 368 additions and 3 deletions

View File

@@ -133,6 +133,13 @@ jobs:
chmod +x test.sh
./test.sh
- name: Test export with different symbol names on embedded targets
run: |
echo "Testing //export with different symbol names on embedded targets..."
cd _demo/embed/export
chmod +x verify_export.sh
./verify_export.sh
- name: _xtool build tests
run: |
cd _xtool