mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 15:09:51 +00:00
* refactor script manager
* remove singleton GCTScriptConfig
* create constant for ".gct" extension
* move GctScriptManager into vm package
* reduce script manager global dependencies
* use manager struct to store runtime override values
* enable/disable scripting subsystem now doesn't store the setting in
config (aligned with other subsystems)
* setting max VMs via start option doesn't change config
* instantiate scriptmanager as part of creating a new Engine
* script manager config is now set during instantiation
* run script manager when enabled in conf or explicitly enabled
* use the Started() method to check if script manager is running
* in tests set script manager as running
* script manager adjustments
* create manager before attempting overrides
* check for nil config when creating script manager
* fix script manager waitgroup counter increased too late
* move autoload() function to autoload.go
* add tests to script manager
19 lines
341 B
Go
19 lines
341 B
Go
package vm
|
|
|
|
import "testing"
|
|
|
|
func TestGctScriptManagerAutoLoadNonExisting(t *testing.T) {
|
|
var vms uint8 = 1
|
|
g := &GctScriptManager{
|
|
config: &Config{
|
|
AutoLoad: []string{"non-existing"},
|
|
},
|
|
started: 1,
|
|
MaxVirtualMachines: &vms,
|
|
}
|
|
g.autoLoad()
|
|
if VMSCount != 0 {
|
|
t.Errorf("Expected no VMs, got %v", VMSCount)
|
|
}
|
|
}
|