2017-08-26 13 views
0

我正在根据从Verigy收到的ASCII文件导入我的所有Verigy 93k test methods参数。在导入时,测试方法属性别名和方法将不可知。它们可以在以后由各种开发人员静态创建吗?下面的代码只是我试图自动创建的测试方法的一个片段。可以在不同的时间定义测试方法的参数,别名和方法吗?

THX

add_tml :my93k, 
    class_name:  'my93k', 
    Functional: { 
     class_name: 'Functional', 
     'ErrorMap.DutCyclesPerTesterCycles' => [:string, '1'], 
     'ErrorMap.EdgesPerTesterCycle' => [:string, '4'], 
     'ErrorMap.Location' => [:string, 'RAM'], 
     # Attribute aliases can be defined like this: 
     aliases: { 
     }, 
     # Define any methods you want the test method to have 
     methods: { 
     } 
    }, 

    my_other_test: { 
     # Define another test in exactly the same way... 
    } 
end 

回答

0

有没有办法做到今天的,但我不认为这将是很难,如果要添加该功能。

从你上面的例子,test_methods.my93k.Functional将返回OrigenTesters::SmartestBasedTester::Base::TestMethod一个实例,在此规定:https://github.com/Origen-SDK/origen_testers/blob/5b89bf287b3d307bd6708c878666f3609a5fd3af/lib/origen_testers/smartest_based_tester/base/test_method.rb

分配给:Functional上述形式传入的初始化选项时TestMethod实例的实例哈希的内容。 如果你看看initialize方法的实现,你会看到它定义了别名和方法的地方。

您可以通过一些新的方法公开相同的功能,为开发人员提供一个API,以便在此过程中稍后添加其他别名和方法。例如test_methods.my93k.Functional.add_alias(:blah)

+0

好的感谢您的解释。似乎有更多的PR将会在途中。 –

相关问题