Add feature to select simulator programatically #805
Add feature to select simulator programatically #805nfrancque wants to merge 4 commits intoVUnit:masterfrom
Conversation
|
@LarsAsplund Please review. I don't have much experience with tox but it seems natural to change the environment variable settings in the |
|
@nfrancque Today the selection of simulator is done in two steps based on the user's PATH and VUNIT_SIMULATOR:
Rearranging these events makes it harder to see if there are changes in behavior that would break backward compatibility. For that reason I suggest that the programmatic approach to changing the simulator is the same as doing step 1 and that step 2 remains where it is today. You may need to hold on to some of the arguments in the Note that |
| Sets id of simulator, used for unique separate output directories for multiple versions of a class | ||
| param: id: The id to use | ||
| """ | ||
| if id is None: |
There was a problem hiding this comment.
Patterns like this can be simplified as
self.id = id or self.name| param: simulator: Name of a supported simulator | ||
| """ | ||
| supported_simulators = self.supported_simulators() | ||
| name_mapping = {simulator_class.name: simulator_class for simulator_class in self.supported_simulators()} |
There was a problem hiding this comment.
You declared supported_simulators on the previous line. I would either remove that and only use self.supported_simulators() everywhere or use that variable everywhere in here.
|
One request I have is to be able to also select the simulator from the CLI. When I'm debugging, it's often that I change the simulator from the command line using bash aliases. However, it'd be nice to have the ability to do this from the CLI instead of in the My use-cases are:
For 2., I would probably just use Python to run with two different simulators for all the tests to run back-to-back. But, I switch often enough that it'd be nice to change from the CLI as well. |
Add set_simulator method exposed to user for simpler switching between simulators
#793