Example 'make check'
This commit is contained in:
parent
507e3c4213
commit
0a60c39c32
12
.gitignore
vendored
12
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
INSTALL
|
.deps
|
||||||
|
.dirstamp
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
|
@ -12,7 +13,6 @@ configure
|
||||||
depcomp
|
depcomp
|
||||||
install-sh
|
install-sh
|
||||||
missing
|
missing
|
||||||
src/.deps/
|
|
||||||
src/Makefile
|
src/Makefile
|
||||||
src/Makefile.in
|
src/Makefile.in
|
||||||
src/*.o
|
src/*.o
|
||||||
|
@ -20,5 +20,9 @@ src/myexecutable
|
||||||
stamp-h1
|
stamp-h1
|
||||||
*~
|
*~
|
||||||
myexecutable
|
myexecutable
|
||||||
.dirstamp
|
test-driver
|
||||||
|
test-suite.log
|
||||||
|
tests/*.o
|
||||||
|
testsuite
|
||||||
|
testsuite.log
|
||||||
|
testsuite.trs
|
||||||
|
|
11
Makefile.am
11
Makefile.am
|
@ -4,3 +4,14 @@ bin_PROGRAMS = myexecutable
|
||||||
myexecutable_SOURCES = \
|
myexecutable_SOURCES = \
|
||||||
src/main.c
|
src/main.c
|
||||||
myexecutable_CFLAGS = #--std=c11 # CFLAGS applicable to myexecutable_SOURCES
|
myexecutable_CFLAGS = #--std=c11 # CFLAGS applicable to myexecutable_SOURCES
|
||||||
|
|
||||||
|
# Tests
|
||||||
|
# 'check' comes from 'make check'
|
||||||
|
check_PROGRAMS = testsuite # will generate and run testsuite exec
|
||||||
|
|
||||||
|
testsuite_CFLAGS = $(DEPS_CFLAGS) # DEPS_* are filled by PKG_CHECK_MODULES
|
||||||
|
testsuite_LIBS = $(DEPS_LIBS) # in configure.ac
|
||||||
|
|
||||||
|
testsuite_SOURCES = tests/test.c
|
||||||
|
TESTS = testsuite
|
||||||
|
|
||||||
|
|
|
@ -44,5 +44,7 @@ AC_CHECK_HEADER([stdlib.h])
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
|
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES([DEPS], [glib-2.0 >= 2.24.1]) # use pkg-config to fill DEPS_CFLAGS and DEPS_LIBS
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile])
|
AC_CONFIG_FILES([Makefile])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
10
tests/test.c
Normal file
10
tests/test.c
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#include <glib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
printf("Write some tests!!! Failing!\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user