Skip to content

Added a tutorial for running and creating unit tests. #2554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2024

Conversation

nedsels
Copy link
Contributor

@nedsels nedsels commented May 16, 2024

Description

Modified the Developer Guide to give a basic tutorial for how to (1) run testers and (2) create unit tests, including a simple example. Also added test_archfpga to the list of tests that are run by make test.

Motivation and Context

There was only a brief tutorial on how to run unit tests in the guide previously: one instruction to run make && make test. This is not very helpful for anyone wanting to create their own unit tests, or run individual tests that target part of the software.

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@nedsels nedsels requested a review from AlexandreSinger May 16, 2024 20:51
@github-actions github-actions bot added the docs Documentation label May 16, 2024
Copy link
Contributor

@AlexandreSinger AlexandreSinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very great PR, and very well written documentation. I have left some comments of the PR regarding a few things, but for the most part this looks very good.

@nedsels nedsels force-pushed the update_quickstart_fix branch from 00bae72 to eca55b8 Compare May 21, 2024 20:29
@github-actions github-actions bot added libarchfpga Library for handling FPGA Architecture descriptions lang-make CMake/Make code labels May 21, 2024
Copy link
Contributor

@AlexandreSinger AlexandreSinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nedsels nedsels force-pushed the update_quickstart_fix branch from eca55b8 to a5c8733 Compare May 21, 2024 21:41
@nedsels nedsels force-pushed the update_quickstart_fix branch from a5c8733 to 07547a3 Compare May 21, 2024 21:43
@nedsels
Copy link
Contributor Author

nedsels commented May 21, 2024

@vaughnbetz Please review

Copy link
Contributor

@vaughnbetz vaughnbetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good, thanks! Just a couple of minor suggestions.

```shell
#include "catch2/catch_test_macros.hpp"

// To choose a tag, see examples from when you run ./test_vpr --list-tests in the test exectuable directory,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "to choose a test name" (not tag).

#include "catch2/catch_test_macros.hpp"

// To choose a tag, see examples from when you run ./test_vpr --list-tests in the test exectuable directory,
// as shown earlier. A good default tag name is the name of the test: in this case, [vpr].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean the syntax below ([test_tag]) will be filled in with [vpr]? Or are you saying [vpr] would be a good tag name for a test of a feature within the vpr code base?
I think clarifying this text a bit would be good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is meant to give a recommendation for the tag in square brackets. I've changed it now so that hopefully this is clear

@nedsels nedsels force-pushed the update_quickstart_fix branch from 07547a3 to f13a5b0 Compare May 23, 2024 16:31
@vaughnbetz
Copy link
Contributor

Looks good -- thanks!

@vaughnbetz vaughnbetz merged commit 29760b4 into verilog-to-routing:master May 23, 2024
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation lang-make CMake/Make code libarchfpga Library for handling FPGA Architecture descriptions libvtrutil
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants