How to add a test in unicorn?

Asked by Kaspar Müller

I want to add a test for a class in unicorn.
I suppose the test should be added in the test folder.
How do I include it such that the test is built when I install unicorn?

So far I proceeded the way it is done for the minimal test in test/unicorn.
I also adapted the configure.ac file, such that the test can be built with the autotools.

When I run "make newtest" in the folder were newtest is located, I get the following error:

"make: *** No rule to make target `newtest.o', needed by `newtest'. Stop."

Any suggestions?

Question information

Language:
English Edit question
Status:
Solved
For:
Unicorn Edit question
Assignee:
Niclas Jansson Edit question
Last query:
Last reply:
Revision history for this message
Niclas Jansson (njansson) said :
#1

Kaspar Müller <email address hidden> writes:

> New question #196900 on Unicorn:
> https://answers.launchpad.net/unicorn/+question/196900
>
> I want to add a test for a class in unicorn.
> I suppose the test should be added in the test folder.
> How do I include it such that the test is built when I install unicorn?
>
> So far I proceeded the way it is done for the minimal test in test/unicorn.
> I also adapted the configure.ac file, such that the test can be built with the autotools.
>
> When I run "make newtest" in the folder were newtest is located, I get the following error:
>
> "make: *** No rule to make target `newtest.o', needed by `newtest'. Stop."
>
> Any suggestions?

The long and boring answers is to read up on autotools...

The short answer is that you have to edit the automake files
Makefile.am, regenerate everything (regen.sh) and reconfigure.

After that, tests are automatically built using the standard make check
target.

Niclas

Revision history for this message
Kaspar Müller (kasparmueller) said :
#2
Revision history for this message
Kaspar Müller (kasparmueller) said :
#3

Apparently the error was caused by a typo in the Makefile.am