Skip to content

Conversation

@arnetheduck
Copy link
Member

This change brings 3 new items to unittest2:

  • -d:unittest2Static compile-time flag that enables test to run both at compile time and runtime
  • staticTest that only run at compilet ime no matter the flag
  • runtimeTest that only run at run time no matter the flag

This change brings 3 new items to `unittest2`:

* `-d:unittest2Static` compile-time flag that enables `test` to run both
at compile time and runtime
* `staticTest` that only run at compilet ime no matter the flag
* `runtimeTest` that only run at run time no matter the flag
@arnetheduck arnetheduck merged commit 333e74f into master Nov 10, 2023
@arnetheduck arnetheduck deleted the static-test branch November 10, 2023 12:49
Araq pushed a commit to nim-lang/Nim that referenced this pull request Nov 5, 2024
ref #24225
related #24306

> Code in branches must not affect semantics of the code that follows
the
`when nimvm` statement. E.g. it must not define symbols that are used in
  the following code.

The test shouldn't have passed when
#24306
would be implemented somehow. Some third packages have already misused
`when nimvm` by defining symbols in the other branch of `when nimvm`.

e.g. in status-im/nim-unittest2#34

```nim
when nimvm:
  discard
else:
  let suiteName {.inject.} = nameParam

use(suiteName)
```
narimiran pushed a commit to nim-lang/Nim that referenced this pull request Jan 14, 2025
ref #24225
related #24306

> Code in branches must not affect semantics of the code that follows
the
`when nimvm` statement. E.g. it must not define symbols that are used in
  the following code.

The test shouldn't have passed when
#24306
would be implemented somehow. Some third packages have already misused
`when nimvm` by defining symbols in the other branch of `when nimvm`.

e.g. in status-im/nim-unittest2#34

```nim
when nimvm:
  discard
else:
  let suiteName {.inject.} = nameParam

use(suiteName)
```

(cherry picked from commit c71de10)
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