1.1 --- a/librazor/test-lua.c Wed Jul 08 22:14:16 2009 +0100
1.2 +++ b/librazor/test-lua.c Thu Jul 09 00:01:18 2009 +0100
1.3 @@ -21,6 +21,7 @@
1.4 #include <stdlib.h>
1.5 #include <stdio.h>
1.6 #include <string.h>
1.7 +#include <errno.h>
1.8 #include <sys/types.h>
1.9 #include <sys/stat.h>
1.10 #include <dirent.h>
1.11 @@ -62,7 +63,7 @@
1.12 int r;
1.13 void *script;
1.14 size_t len;
1.15 - char *s, *test_file;
1.16 + char *s, *test_file, *srcdir;
1.17 FILE *fp;
1.18
1.19 if (argc > 2) {
1.20 @@ -94,6 +95,24 @@
1.21 free(s);
1.22
1.23 script = razor_file_get_contents(test_file, &len);
1.24 + if (!script) {
1.25 + srcdir = getenv("srcdir");
1.26 + if (srcdir && errno == ENOENT && *test_file != '/') {
1.27 + s = malloc(strlen(srcdir) + strlen(test_file) + 2);
1.28 + strcpy(s, srcdir);
1.29 + strcat(s, "/");
1.30 + strcat(s, test_file);
1.31 + script = razor_file_get_contents(s, &len);
1.32 + if (!script) {
1.33 + perror(s);
1.34 + exit(1);
1.35 + }
1.36 + free(s);
1.37 + } else {
1.38 + perror(test_file);
1.39 + exit(1);
1.40 + }
1.41 + }
1.42 r = run_lua_script(root, test_file, script, len, -1);
1.43 razor_file_free_contents(script, len);
1.44
2.1 --- a/po/POTFILES.in Wed Jul 08 22:14:16 2009 +0100
2.2 +++ b/po/POTFILES.in Thu Jul 09 00:01:18 2009 +0100
2.3 @@ -0,0 +1,3 @@
2.4 +gl/error.c
2.5 +gl/fnmatch_loop.c
2.6 +gl/xalloc-die.c
3.1 --- a/test/Makefile.am Wed Jul 08 22:14:16 2009 +0100
3.2 +++ b/test/Makefile.am Thu Jul 09 00:01:18 2009 +0100
3.3 @@ -49,6 +49,13 @@
3.4 named-root.sh \
3.5 relocate.sh
3.6
3.7 +MOSTLYCLEANFILES = \
3.8 + primary.xml.gz \
3.9 + filelists.xml.gz \
3.10 + $(check_SCRIPTS) \
3.11 + rawhide.rzdb
3.12 +
3.13 clean-local :
3.14 rm -f *~
3.15 + rm -rf repodata rpms
3.16