Integrate tests into automake

This commit is contained in:
Martin Bickel 2017-03-04 23:25:31 +01:00 committed by Serge Lamikhov-Center
parent a2cd870eb9
commit 65335f6a75
8 changed files with 20 additions and 29 deletions

2
.gitignore vendored
View File

@ -49,6 +49,8 @@ CMakeFiles
# autotools artifacts
.deps
config.status
test-driver
ELFIOTest/runELFtests.trs
# eclipse project files
.settings

View File

@ -1,27 +0,0 @@
CXX=g++
CPPFLAGS=-c -Wall -std=c++0x -I..
LDLIBS=-lboost_unit_test_framework
ELFIODIR=../elfio/
SOURCES=ELFIOTest.cpp ELFIOTest1.cpp
INCLUDES=$(ELFIODIR)elfio.hpp $(ELFIODIR)elfio_header.hpp \
$(ELFIODIR)elfio_note.hpp $(ELFIODIR)elfio_section.hpp \
$(ELFIODIR)elfio_segment.hpp $(ELFIODIR)elfio_strings.hpp \
$(ELFIODIR)elfio_symbols.hpp $(ELFIODIR)elfio_utils.hpp \
$(ELFIODIR)elf_types.hpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=ELFIOTest
all: $(SOURCES) $(EXECUTABLE) $(INCLUDES)
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $@
.cpp.o:
$(CXX) $(CPPFLAGS) $< -o $@
test: $(EXECUTABLE)
./$(EXECUTABLE) -r short
clean:
rm $(OBJECTS) $(EXECUTABLE)

6
ELFIOTest/Makefile.am Normal file
View File

@ -0,0 +1,6 @@
AM_CPPFLAGS = -I$(top_srcdir)
bin_PROGRAMS = ELFIOTest
ELFIOTest_SOURCES = ELFIOTest.cpp ELFIOTest1.cpp
ELFIOTest_LDADD = -lboost_unit_test_framework
TESTS=runELFtests

6
ELFIOTest/runELFtests Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
# ELFIOTest requires to have the current working directory here,
# otherwise it would not find its test files
cd `dirname $0`
./ELFIOTest

View File

@ -1,4 +1,4 @@
SUBDIRS = examples
SUBDIRS = examples ELFIOTest
nobase_include_HEADERS = elfio/elf_types.hpp elfio/elfio_dynamic.hpp \
elfio/elfio.hpp elfio/elfio_header.hpp \
elfio/elfio_note.hpp elfio/elfio_relocation.hpp \

1
autogen.sh Executable file
View File

@ -0,0 +1 @@
autoreconf --install

4
configure vendored
View File

@ -3099,7 +3099,7 @@ else
fi
ac_config_files="$ac_config_files Makefile examples/Makefile examples/elfdump/Makefile examples/tutorial/Makefile examples/writer/Makefile examples/write_obj/Makefile"
ac_config_files="$ac_config_files Makefile examples/Makefile examples/elfdump/Makefile examples/tutorial/Makefile examples/writer/Makefile examples/anonymizer/Makefile examples/write_obj/Makefile ELFIOTest/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -3848,7 +3848,9 @@ do
"examples/elfdump/Makefile") CONFIG_FILES="$CONFIG_FILES examples/elfdump/Makefile" ;;
"examples/tutorial/Makefile") CONFIG_FILES="$CONFIG_FILES examples/tutorial/Makefile" ;;
"examples/writer/Makefile") CONFIG_FILES="$CONFIG_FILES examples/writer/Makefile" ;;
"examples/anonymizer/Makefile") CONFIG_FILES="$CONFIG_FILES examples/anonymizer/Makefile" ;;
"examples/write_obj/Makefile") CONFIG_FILES="$CONFIG_FILES examples/write_obj/Makefile" ;;
"ELFIOTest/Makefile") CONFIG_FILES="$CONFIG_FILES ELFIOTest/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac

View File

@ -9,5 +9,6 @@ AC_CONFIG_FILES([
examples/writer/Makefile
examples/anonymizer/Makefile
examples/write_obj/Makefile
ELFIOTest/Makefile
])
AC_OUTPUT