Test package names

17 views
Skip to first unread message

Warren Savage

unread,
Feb 8, 2025, 7:47:16 PMFeb 8
to chisel-users
This is a section in the Chisel Developers Style Guide with a section on Tests:

Tests

Test classes are named starting with the name of the class they are testing, and ending with "Test". Test files must start with the name of the class you are testing and end with "Test.scala". Test files should reside in a subdirectory called "tests". The tests package should be composed of the package class you are testing.

package class.under.test.class
package tests



The package specification confuses me a bit in that I've not seen any examples of code doing this. Furthermore, I would expect that the package name to be fully specified as advised in the Scala Style Guide.

I would have expected something like this: 

package com.mycompany.adder.tests

Can anyone clarify the proper way to do this?

Warren


Edward Wang

unread,
Feb 8, 2025, 7:57:50 PMFeb 8
to warren...@rocksavage.tech, chisel...@googlegroups.com
Hi Warren,

I believe the advantage would be to get class.under.test.class
imported automatically using chained package clauses.
See https://stackoverflow.com/a/3541148

Best regards,
Edward
> --
> You received this message because you are subscribed to the Google Groups "chisel-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to chisel-users...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/chisel-users/859fe49e-ec8a-46db-ad8c-b65fd1894bcdn%40googlegroups.com.
Message has been deleted

Warren Savage

unread,
Feb 10, 2025, 8:44:07 PMFeb 10
to chisel-users
Hi Edward, thank you. That explains it!

Warren

Reply all
Reply to author
Forward
0 new messages