Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot DNS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
24
Issues
24
List
Boards
Labels
Milestones
Merge Requests
6
Merge Requests
6
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Knot projects
Knot DNS
Commits
f76d35d1
Commit
f76d35d1
authored
Jun 11, 2013
by
Daniel Salzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zscanner: improve building process
parent
8d8ee4ec
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
49 additions
and
122 deletions
+49
-122
.gitignore
.gitignore
+8
-7
Knot.files
Knot.files
+3
-0
configure.ac
configure.ac
+4
-4
src/Makefile.am
src/Makefile.am
+0
-4
src/common/descriptor.c
src/common/descriptor.c
+2
-2
src/tests/Makefile.am
src/tests/Makefile.am
+0
-2
src/tests/unittests_main.c
src/tests/unittests_main.c
+0
-4
src/tests/zscanner/zscanner_tests.c
src/tests/zscanner/zscanner_tests.c
+0
-44
src/tests/zscanner/zscanner_tests.h
src/tests/zscanner/zscanner_tests.h
+0
-25
src/zscanner/Makefile.am
src/zscanner/Makefile.am
+7
-3
src/zscanner/error.c
src/zscanner/error.c
+2
-1
src/zscanner/file_loader.c
src/zscanner/file_loader.c
+1
-2
src/zscanner/file_loader.h
src/zscanner/file_loader.h
+1
-1
src/zscanner/scanner.c
src/zscanner/scanner.c
+3
-3
src/zscanner/scanner.rl
src/zscanner/scanner.rl
+3
-3
src/zscanner/scanner_functions.c
src/zscanner/scanner_functions.c
+4
-5
src/zscanner/test/processing.c
src/zscanner/test/processing.c
+3
-4
src/zscanner/test/run_tests.sh.in
src/zscanner/test/run_tests.sh.in
+4
-4
src/zscanner/test/tests.c
src/zscanner/test/tests.c
+4
-4
No files found.
.gitignore
View file @
f76d35d1
...
...
@@ -13,6 +13,8 @@
/src/Makefile.in
/src/tests/Makefile
/src/tests/Makefile.in
/src/zscanner/Makefile
/src/zscanner/Makefile.in
/samples/Makefile
/samples/Makefile.in
/doc/Makefile
...
...
@@ -41,19 +43,18 @@
/samples/knot.sample.conf
/src/stamp-*
/doc/html/
# Binaries
/src/tests/unittests
/src/zscanner-tool
/src/knotc
/src/knotd
/src/knot-zcompile
/INSTALL
/m4/libtool.m4
/m4/ltoptions.m4
/m4/ltsugar.m4
/m4/ltversion.m4
/m4/lt~obsolete.m4
# Binaries
/src/tests/unittests
/src/tests/unittests_xfr
/INSTALL
/src/zscanner/zscanner-tool
/src/knotc
/src/knotd
/src/kdig
/src/khost
/src/knsupdate
...
...
Knot.files
View file @
f76d35d1
...
...
@@ -270,6 +270,9 @@ src/utils/nsupdate/nsupdate_exec.h
src/utils/nsupdate/nsupdate_main.c
src/utils/nsupdate/nsupdate_params.c
src/utils/nsupdate/nsupdate_params.h
src/zscanner/Makefile.am
src/zscanner/error.c
src/zscanner/error.h
src/zscanner/file_loader.c
src/zscanner/file_loader.h
src/zscanner/scanner.c
...
...
configure.ac
View file @
f76d35d1
...
...
@@ -288,12 +288,12 @@ gl_VISIBILITY()
CFLAGS="$CFLAGS $CFLAG_VISIBILITY"
AC_CONFIG_FILES([Makefile
samples/Makefile
src/Makefile
src/zscanner/Makefile
src/tests/Makefile
doc/Makefile
man/Makefile
src/Makefile
samples/Makefile
src/tests/Makefile
src/zscanner/Makefile
src/zscanner/test/run_tests.sh
src/zscanner/test/cases/06-3_INCLUDE.in:src/zscanner/test/cases/06-3_INCLUDE.inin
src/zscanner/test/cases/06-4_INCLUDE.in:src/zscanner/test/cases/06-4_INCLUDE.inin
...
...
src/Makefile.am
View file @
f76d35d1
...
...
@@ -10,10 +10,6 @@ AM_YFLAGS = -d
libknotd_la_YFLAGS
=
-pcf_
-d
libknotd_la_LFLAGS
=
# TODO: reentrant parser, prefix
EXTRA_DIST
=
\
zscanner/test/run_tests.sh
\
zscanner/test/cases
BUILT_SOURCES
=
\
knot/conf/libknotd_la-cf-lex.c
\
knot/conf/libknotd_la-cf-parse.c
\
...
...
src/common/descriptor.c
View file @
f76d35d1
...
...
@@ -15,12 +15,12 @@
*/
#include <config.h>
#include "common/descriptor.h"
#include <stdio.h> // snprintf
#include <stdlib.h> // strtoul
#include <strings.h> // strcasecmp
#include <common/descriptor.h>
/*!
* \brief Table with DNS classes.
*/
...
...
src/tests/Makefile.am
View file @
f76d35d1
...
...
@@ -49,8 +49,6 @@ unittests_SOURCES = \
knot/server_tests.h
\
knot/rrl_tests.h
\
knot/rrl_tests.c
\
zscanner/zscanner_tests.h
\
zscanner/zscanner_tests.c
\
libknot/dname_tests.h
\
libknot/dname_tests.c
\
libknot/ztree_tests.h
\
...
...
src/tests/unittests_main.c
View file @
f76d35d1
...
...
@@ -33,7 +33,6 @@
#include "tests/knot/server_tests.h"
#include "tests/knot/conf_tests.h"
#include "tests/knot/rrl_tests.h"
#include "tests/zscanner/zscanner_tests.h"
#include "tests/libknot/wire_tests.h"
#include "tests/libknot/dname_tests.h"
#include "tests/libknot/ztree_tests.h"
...
...
@@ -69,9 +68,6 @@ int main(int argc, char *argv[])
&
server_tests_api
,
//! Server unit
&
rrl_tests_api
,
//! RRL tests
/* Zone scanner. */
&
zscanner_tests_api
,
//! Wrapper for external unittests
/* Libknot library. */
&
wire_tests_api
,
&
dname_tests_api
,
...
...
src/tests/zscanner/zscanner_tests.c
deleted
100644 → 0
View file @
8d8ee4ec
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include "tests/zscanner/zscanner_tests.h"
#include <stdlib.h>
static
int
zscanner_tests_count
(
int
argc
,
char
*
argv
[]);
static
int
zscanner_tests_run
(
int
argc
,
char
*
argv
[]);
unit_api
zscanner_tests_api
=
{
"Zone scanner"
,
&
zscanner_tests_count
,
&
zscanner_tests_run
};
static
int
zscanner_tests_count
(
int
argc
,
char
*
argv
[])
{
return
1
;
}
static
int
zscanner_tests_run
(
int
argc
,
char
*
argv
[])
{
int
ret
;
ret
=
system
(
"/bin/sh ../zscanner/test/run_tests.sh test"
);
cmp_ok
(
ret
,
"=="
,
0
,
"zscanner unittests"
);
return
0
;
}
src/tests/zscanner/zscanner_tests.h
deleted
100644 → 0
View file @
8d8ee4ec
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _ZSCANNER_TESTS_H_
#define _ZSCANNER_TESTS_H_
#include "common/libtap/tap_unit.h"
/* Unit API. */
unit_api
zscanner_tests_api
;
#endif
/* _ZSCANNER_TESTS_H_ */
src/zscanner/Makefile.am
View file @
f76d35d1
ACLOCAL_AMFLAGS
=
-I
$(top_srcdir)
/m4
AM_CPPFLAGS
=
-I
$(top_srcdir)
/src/zscanner
-I
$(top_srcdir)
/src
-DSYSCONFDIR
=
'"
$(sysconfdir)
"'
-DSBINDIR
=
'"
$(sbindir)
"'
noinst_PROGRAMS
=
zscanner-tool
noinst_LTLIBRARIES
=
libzscanner.la
TESTS
=
test
/run_tests.sh
EXTRA_DIST
=
\
scanner.rl
\
scanner_body.rl
\
...
...
@@ -25,8 +29,6 @@ zscanner_tool_SOURCES = \
test
/processing.c
libzscanner_la_SOURCES
=
\
../common/descriptor.h
\
../common/descriptor.c
\
error.h
\
error.c
\
file_loader.h
\
...
...
@@ -34,7 +36,9 @@ libzscanner_la_SOURCES = \
scanner.h
\
scanner.c
\
scanner_functions.h
\
scanner_functions.c
scanner_functions.c
\
../common/descriptor.h
\
../common/descriptor.c
libzscanner_la_LIBADD
=
@LIBOBJS@
zscanner_tool_LDADD
=
libzscanner.la @LIBOBJS@
src/zscanner/error.c
View file @
f76d35d1
...
...
@@ -15,9 +15,10 @@
*/
#include <config.h>
#include "zscanner/error.h"
#include <stdlib.h> // NULL
#include "zscanner/error.h"
typedef
struct
{
int
code
;
const
char
*
name
;
...
...
src/zscanner/file_loader.c
View file @
f76d35d1
...
...
@@ -15,8 +15,6 @@
*/
#include <config.h>
#include "zscanner/file_loader.h"
#include <inttypes.h> // PRIu64
#include <unistd.h> // sysconf
#include <stdio.h> // sprintf
...
...
@@ -27,6 +25,7 @@
#include <sys/stat.h> // fstat
#include <sys/mman.h> // mmap
#include "zscanner/file_loader.h"
#include "zscanner/error.h" // error codes
/*! \brief Mmap block size in bytes. */
...
...
src/zscanner/file_loader.h
View file @
f76d35d1
...
...
@@ -29,8 +29,8 @@
#include <stdint.h> // uint32_t
#include "common/descriptor.h" // KNOT_CLASS_IN
#include "zscanner/scanner.h" // scanner_t
#include "common/descriptor.h" // KNOT_CLASS_IN
/*! \brief Settings block size in bytes. */
#define SETTINGS_BUFFER_LENGTH 1024
...
...
src/zscanner/scanner.c
View file @
f76d35d1
...
...
@@ -16,8 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "zscanner/scanner.h"
#include <config.h>
#include <stdint.h> // uint32_t
#include <stdlib.h> // calloc
#include <stdio.h> // sprintf
...
...
@@ -30,10 +29,11 @@
#include <netinet/in.h> // in_addr (BSD)
#include <arpa/inet.h> // inet_pton
#include "zscanner/scanner.h"
#include "zscanner/error.h" // error codes
#include "common/descriptor.h" // KNOT_RRTYPE_A
#include "zscanner/file_loader.h" // file_loader
#include "zscanner/scanner_functions.h" // Base64
#include "common/descriptor.h" // KNOT_RRTYPE_A
/*! \brief Shorthand for setting warning data. */
#define SCANNER_WARNING(code) { s->error_code = code; }
...
...
src/zscanner/scanner.rl
View file @
f76d35d1
...
...
@@ -14,8 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "zscanner/scanner.h"
#include <config.h>
#include <stdint.h> // uint32_t
#include <stdlib.h> // calloc
#include <stdio.h> // sprintf
...
...
@@ -28,10 +27,11 @@
#include <netinet/in.h> // in_addr (BSD)
#include <arpa/inet.h> // inet_pton
#include "zscanner/scanner.h"
#include "zscanner/error.h" // error codes
#include "common/descriptor.h" // KNOT_RRTYPE_A
#include "zscanner/file_loader.h" // file_loader
#include "zscanner/scanner_functions.h" // Base64
#include "common/descriptor.h" // KNOT_RRTYPE_A
/*! \brief Shorthand for setting warning data. */
#define SCANNER_WARNING(code) { s->error_code = code; }
...
...
src/zscanner/scanner_functions.c
View file @
f76d35d1
...
...
@@ -15,14 +15,13 @@
*/
#include <config.h>
#include "zscanner/scanner_functions.h"
#include <stdint.h>
#include <stdlib.h>
#include "zscanner/error.h"
#include "common/descriptor.h"
#include "zscanner/scanner.h"
#include "zscanner/scanner_functions.h"
#include "zscanner/error.h" // error codes
#include "zscanner/scanner.h" // scanner_t
#include "common/descriptor.h" // KNOT_RDATA_WF_END
const
uint8_t
digit_to_num
[]
=
{
[
'0'
]
=
0
,
[
'1'
]
=
1
,
[
'2'
]
=
2
,
[
'3'
]
=
3
,
[
'4'
]
=
4
,
...
...
src/zscanner/test/processing.c
View file @
f76d35d1
...
...
@@ -15,14 +15,13 @@
*/
#include <config.h>
#include "zscanner/scanner_functions.h"
#include <inttypes.h> // PRIu64
#include <stdio.h> // printf
#include "zscanner/
error.h" // knot_strerror
#include "
common/descriptor.h" // knot_rrtype_to_string
#include "zscanner/
test/processing.h"
#include "
zscanner/error.h" // zscanner_strerror
#include "zscanner/scanner.h" // scanner_t
#include "common/descriptor.h" // knot_rrtype_to_string
#define ERROR_CODE_TO_STRING(code) [code - ZSCANNER_UNCOVERED_STATE] = #code
const
char
*
error_names
[]
=
{
...
...
src/zscanner/test/run_tests.sh.in
View file @
f76d35d1
...
...
@@ -2,13 +2,13 @@
TESTS_DIR
=
"@abs_srcdir@/cases"
OUTS_DIR
=
"@abs_builddir@/.out"
TEST_BIN
=
"@builddir@/
../
zscanner-tool -m 2"
TEST_BIN
=
"@builddir@/zscanner-tool -m 2"
# Delete temporary output directory at exit.
trap
"chmod -R u+rw
${
OUTS_DIR
}
&& rm -rf
${
OUTS_DIR
}
"
EXIT
# If an argument -> verbose mode (stores result in /tmp).
if
[
$#
-
eq
0
]
;
then
if
[
$#
-
ne
0
]
;
then
RESULT_DIR
=
`
mktemp
-d
/tmp/zscanner_test.XXXX
`
echo
"ZSCANNER TEST
${
RESULT_DIR
}
"
fi
...
...
@@ -31,7 +31,7 @@ for file in $(find "${TESTS_DIR}" -name "*.in" | sort -n); do
# Check for differences.
if
[
$RET
-ne
0
]
;
then
# If verbose print diff.
if
[
$#
-
eq
0
]
;
then
if
[
$#
-
ne
0
]
;
then
echo
"
\n
===
${
fileout
}
DIFF ======================"
diff
"
${
OUTS_DIR
}
/
${
fileout
}
"
"
${
TESTS_DIR
}
/
${
fileout
}
"
fi
...
...
@@ -39,7 +39,7 @@ for file in $(find "${TESTS_DIR}" -name "*.in" | sort -n); do
done
# Store test result.
if
[
$#
-
eq
0
]
;
then
if
[
$#
-
ne
0
]
;
then
cp
-a
"
${
OUTS_DIR
}
/."
"
${
RESULT_DIR
}
/"
echo
"
\n
FINISHED
${
RESULT_DIR
}
"
fi
src/zscanner/test/tests.c
View file @
f76d35d1
...
...
@@ -15,13 +15,13 @@
*/
#include <config.h>
#include "zscanner/test/tests.h"
#include <inttypes.h> // PRIu64
#include <stdlib.h> // putenv
#include <stdio.h> // printf
#include <time.h> // mktime
#include <stdlib.h> // printf
#include "../scanner_functions.h" // date_to_timestamp
#include "zscanner/test/tests.h"
#include "zscanner/scanner_functions.h" // date_to_timestamp
int
test__date_to_timestamp
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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