In my Makefile.am
, I have the following test:
TESTS += tests/test1
check_PROGRAMS += tests/test1
tests_test1_SOURCES = tests/test1.c
tests_test1_CPPFLAGS = ...
tests_test1_LDADD = ...
test1
is compiled and run when make check
is invoked. How should Makefile.am
be modified to pass a command line argument to test1?
You cannot pass arguments to tests.
Instead of
TESTS += tests/test1
do
TESTS += tests/test1.test
EXTRA_DIST += tests/test1.test
where tests/test1.test
is an executable shell script that will run your program with any argument you wish:
#!/bin/sh
tests/test1 args... < $srcdir/tests/distributed-input-file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With