Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
extractor
gesa
Commits
44edc9a0
Commit
44edc9a0
authored
Jan 09, 2018
by
jkvis
Browse files
Added test framework
parent
e59a2cd6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
44edc9a0
CC
=
gcc
CFLAGS
=
-O3
-march
=
native
CPPFLAGS
=
-Iinclude
/
-Ilib
/sais-lite-lcp/
-Wall
-Wextra
-pedantic
CPPFLAGS
=
-Iinclude
/
-Ilib
/sais-lite-lcp/
-DNDEBUG
-Wall
-Wextra
-pedantic
SOURCES
=
$(
shell
find src/
-name
'*.c'
)
OBJECTS
=
$(SOURCES:.c=.o)
DEPS
=
$(OBJECTS:.o=.d)
LIBS
=
$(
shell
find lib/
-name
'*.a'
)
.PHONY
:
clean
.PHONY
:
clean
tests
libgesa.a
:
$(LIBS) $(OBJECTS)
$(MAKE)
-wC
lib/
ar rcsT
$@
$(LIBS)
$(OBJECTS)
tests
:
libgesa.a
$(MAKE)
-wC
tests/
clean
:
rm
-f
$(OBJECTS)
$(DEPS)
libgesa.a
...
...
tests/.gitignore
0 → 100644
View file @
44edc9a0
gesa_test
tests/Makefile
View file @
44edc9a0
CXXC
=
g++
CXXFLAGS
=
-O0
-march
=
native
CPPFLAGS
=
-I
../include/
-Wall
-Wextra
-pedantic
SOURCES
=
$(
shell
find
.
-name
'*.cc'
)
OBJECTS
=
$(SOURCES:.cc=.o)
DEPS
=
$(OBJECTS:.o=.d)
TARGET
=
gesa_test
.PHONY
:
all clean memory_check
all
:
$(TARGET)
./
$<
memory_check
:
$(TARGET)
valgrind
--leak-check
=
full ./
$<
$(TARGET)
:
$(OBJECTS)
$(CXXC)
$(CXXFLAGS)
$(CPPFLAGS)
$(OBJECTS)
-L
..
-lgesa
-o
$@
clean
:
rm
-f
$(OBJECTS)
$(TARGET)
-include
$(DEPS)
%.o
:
%.cc
$(CXXC)
$(CXXFLAGS)
$(CPPFLAGS)
-MMD
-o
$@
-c
$<
tests/main.cc
View file @
44edc9a0
#include
<cassert>
#include
<cstdio>
#include
<cstdlib>
...
...
@@ -10,7 +11,7 @@ int main(int, char* [])
GESA
test
;
if
(
GESA_create
(
&
test
,
(
GESA_char_t
*
)
string
,
9
)
!=
0
)
if
(
GESA_create
(
&
test
,
(
GESA_char_t
*
)
string
,
8
)
!=
0
)
{
fprintf
(
stderr
,
"Error GESA_create()
\n
"
);
return
EXIT_FAILURE
;
...
...
@@ -18,5 +19,7 @@ int main(int, char* [])
printf
(
"%s
\n
"
,
test
.
string
[
0
]);
GESA_destroy
(
&
test
,
GESA_KEEP_STRINGS
);
return
EXIT_SUCCESS
;
}
// main
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment