Skip to content

Commit

Permalink
tests/tcg: Fix compilation of test_path
Browse files Browse the repository at this point in the history
The test_path binary is (unlike the other test binaries in tests/tcg)
actually intended to be compiled with the same compiler used to build
the main QEMU executables. It actually #includes a number of the
QEMU source files in an attempt to unit-test the util/path.c functions,
and so if it is not compiled with the same compiler used by configure
to set CONFIG_ settings then it is liable to fail to build.
Fix the makefile to build it with the default C compiler rules, not
CC_I386, and fix the test itself not to include a lot of unnecessary
trace related source files which cause the build to fail if the trace
backend is anything other than 'simple'.

Signed-off-by: Peter Maydell <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
pm215 authored and Michael Tokarev committed May 7, 2014
1 parent 8e8be26 commit ad0a118
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions tests/tcg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@ run-test_path: test_path
# rules to compile tests

test_path: test_path.o
$(CC_I386) $(LDFLAGS) -o $@ $^ $(LIBS)

test_path.o: test_path.c
$(CC_I386) $(QEMU_INCLUDES) $(GLIB_CFLAGS) $(CFLAGS) -c -o $@ $^

hello-i386: hello-i386.c
$(CC_I386) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
Expand Down
7 changes: 0 additions & 7 deletions tests/tcg/test_path.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
/* Test path override code */
#define _GNU_SOURCE
#include "config-host.h"
#include "util/cutils.c"
#include "util/hexdump.c"
#include "util/iov.c"
#include "util/path.c"
#include "util/qemu-timer-common.c"
#include "trace/control.c"
#include "../trace/generated-events.c"
#ifdef CONFIG_TRACE_SIMPLE
#include "trace/simple.c"
#endif

#include <stdarg.h>
#include <sys/stat.h>
#include <fcntl.h>
Expand Down

0 comments on commit ad0a118

Please sign in to comment.