Skip to content

Reduce unit test debug output and fix -w flag line numbers#299

Merged
fglock merged 6 commits intomasterfrom
fix/asm-crash-atan2-exists
Mar 10, 2026
Merged

Reduce unit test debug output and fix -w flag line numbers#299
fglock merged 6 commits intomasterfrom
fix/asm-crash-atan2-exists

Conversation

@fglock
Copy link
Owner

@fglock fglock commented Mar 10, 2026

Summary

  • Comment out diag() calls in unit tests to reduce debug output
  • Fix -w flag line numbers by setting $^W at initialization time instead of prepending code
  • Use GlobalContext.encodeSpecialVar("W") for cleaner $^W access

Changes

  • pack_utf8.t, io_read.t, io_layers.t, io_pipe.t, subroutine.t: Comment out diag() calls
  • lvalue_substr.t, demo.t: Add no warnings blocks for expected warnings
  • ArgumentParser.java: Set warnFlag instead of prepending BEGIN block
  • CompilerOptions.java: Add warnFlag field for -w
  • GlobalContext.java: Initialize $^W based on warnFlag
  • EmitForeach.java, OperatorParser.java: Use encodeSpecialVar("W")

Note: Some runtime warnings still emit because PerlOnJava's warn() goes directly to stderr without checking warning state.

Generated with Devin

fglock and others added 6 commits March 10, 2026 17:04
- Comment out diag() calls in pack_utf8.t, io_read.t, io_layers.t,
  io_pipe.t, subroutine.t
- Add no warnings blocks to lvalue_substr.t and demo.t

Note: Some warnings still emit because PerlOnJava warn() goes
directly to stderr without checking warning state.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
Add Warnings.warningManager.isWarningEnabled() checks before:
- substr: 'substr outside of string' warnings
- misc: 'Odd number of elements' warnings
- uninitialized: 'Use of uninitialized value' warnings

Files changed:
- Operator.java: substr, repeat warnings
- RuntimeSubstrLvalue.java: substr warnings
- RuntimeHash.java: odd elements warnings
- StringOperators.java: concatenation, join warnings
- MathOperators.java: multiplication, division, exponentiation warnings

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
Replace string-based isWarningEnabled("category") calls with int-based
isWarningEnabled(ScopedSymbolTable.WARN_*) calls for O(1) BitSet lookup.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
After 'use warnings;' was parsed and its import method executed, the
warning flags were being enabled in a nested scope but lost when
parsing continued due to scope popping.

Fix: After calling the import method, copy the current warning flags
to ALL levels of the parser's symbol table's warning flags stack.
This ensures warning state is preserved when scopes are exited.

Also simplified initializeEnabledWarnings() to just call enableWarning('all')
and changed HashSet to TreeSet for consistent bit position ordering.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
1. Add check for $^W (global warning flag from -w) in isWarningEnabled()
   so that -w command line flag properly enables all warnings at runtime.

2. Fix multiply() fast path skipping uninitialized value warnings.
   Check for UNDEF type before the INTEGER fast path to ensure warnings
   are emitted even when one argument is undef and the other is an int.

Fixes assignwarn.t (116/116 now pass).

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
When exit() was called inside a sort comparator block, PerlExitException
was being caught and wrapped in RuntimeException, preventing Main.main()
from catching it properly. This caused the exception to be printed as an
error instead of cleanly exiting.

Fix: Add explicit catch for PerlExitException in ListOperators.sort()
that re-throws without wrapping.

Fixes op/runlevel.t test 17 (exit inside sort block), restoring test
count from 9/24 to 10/24.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
@fglock fglock merged commit 694b74f into master Mar 10, 2026
2 checks passed
@fglock fglock deleted the fix/asm-crash-atan2-exists branch March 10, 2026 19:53
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.

1 participant