I’m Sam
I’m Sam
May 28, 2017 · 2 min read
[153] JUCE Diary #14:Catch Test Framework
[153] JUCE Diary #14:Catch Test Framework

Catch 在 C++ 單元測試、自動化測試領域算是新兵。由於設計優良,使用簡便,近來頗受好評。JUCE 內建了單元測試機制,雖然大部分情況下比夠用還多,不過,為了避免落入「固步自封」的工程師死亡陷阱,偶爾還是要看看窗外的世界,弄髒手,動動腦。

JUCE 論壇經常出現高手分享自己的作品,昨天就看到 varx 這個把 Reactive-Extension, RxCpp 導入到 JUCE 的專案,太有才,改天一定要試試。不過,今天的重點不在該專案,原因是我挖了專案原始碼來看,發現作者用了 Catch 做單元測試,而不是用 JUCE 內建的機制。然後,使用 Catch 來做測試真的很簡單。底下說明使用方式。

首先,使用 Projucer 建一個 Console Application。為什麼要選這個類型的專案?因為「自動產生的程式碼最少」。Main.cpp 長這樣:


中略。

原因是,在 Medium 寫含有程式碼的文章太痛苦了,想看完整版,請移駕主站: http://ift.tt/2r9i1z0

JUCE Tips

A place you don’t want to miss while learning JUCE

I’m Sam

Written by

I’m Sam

Developer | CTO of I³D Technology Inc. | Blog at https://samtsai.org | Newsletter: http://thecpp.news | WorkFlowy Tips: https://workflowy.tips

JUCE Tips

JUCE Tips

A place you don’t want to miss while learning JUCE

I’m Sam

Written by

I’m Sam

Developer | CTO of I³D Technology Inc. | Blog at https://samtsai.org | Newsletter: http://thecpp.news | WorkFlowy Tips: https://workflowy.tips

JUCE Tips

JUCE Tips

A place you don’t want to miss while learning JUCE

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store