WML for Complete Beginners: Chapter 6
From The Battle for Wesnoth Wiki
Chapter 6: Building and Including a Custom Unit
Sometimes campaign authors only use mainline units in their campaigns. Other times, however, they may want to include a custom unit that isn't found in default Wesnoth. Thankfully, including a custom unit is quite easy.
Creating Your Custom Unit's .cfg File
This is just a test