2017-08-26 11 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將會在途中。 –

相關問題