Skip to content

Commit

Permalink
Fix non-Qt testing
Browse files Browse the repository at this point in the history
The Makefile.nonqt has been updated to use gyp build instead of scons.
Some new test cases have been added for non-Qt testing and the Qt
specific v8test_stringhascomparison has been skipped by NONQT_TESTING
macro.

Change-Id: I71f0d41de2f9c46767c9c9a7ec5c45ff25b1fe98
Reviewed-by: Simon Hausmann <[email protected]>
  • Loading branch information
stampho authored and The Qt Project committed Oct 16, 2012
1 parent f5db1b5 commit adb6125
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 24 deletions.
39 changes: 22 additions & 17 deletions tests/auto/v8/Makefile.nonqt
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
V8PATH = ../../../src/3rdparty/v8
V8LIBPATH = $(V8PATH)
V8INCPATH = $(V8PATH)/include
SOURCES = v8main.cpp v8test.cpp

release-m32:
g++ -o v8test_release_m32 -m32 -O2 -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH) -lv8
CCFLAGS_RELEASE = -DNONQT_TESTING -lpthread -O2
CCFLAGS_DEBUG = -DNONQT_TESTING -lpthread -g

debug-m32:
g++ -o v8test_debug_m32 -m32 -g -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH) -lv8_g
LIBS_SNAPSHOT = -lv8_base -lv8_snapshot
LIBS_NOSNAPSHOT = -lv8_base -lv8_nosnapshot

release:
g++ -o v8test_release -O2 -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH) -lv8
ia32-release: $(SOURCES)
g++ -o v8test_ia32_release -m32 $(CCFLAGS_RELEASE) -I$(V8INCPATH) $(SOURCES) -L$(V8PATH)/out/ia32.release/obj.target/tools/gyp $(LIBS_SNAPSHOT)

debug:
g++ -o v8test_debug -g -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH) -lv8_g
ia32-debug: $(SOURCES)
g++ -o v8test_ia32_debug -m32 $(CCFLAGS_DEBUG) -I$(V8INCPATH) $(SOURCES) -L$(V8PATH)/out/ia32.debug/obj.target/tools/gyp $(LIBS_SNAPSHOT)

mips-release:
g++ -o v8test_mips_release -g -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH)/out/mips.release/lib.target/ -Wl,-rpath,$(V8LIBPATH)/out/mips.release/lib.target -lv8
x64-release: $(SOURCES)
g++ -o v8test_x64_release $(CCFLAGS_RELEASE) -I$(V8INCPATH) $(SOURCES) -L$(V8PATH)/out/x64.release/obj.target/tools/gyp $(LIBS_SNAPSHOT)

mips-debug:
g++ -o v8test_mips_debug -g -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH)/out/mips.debug/lib.target/ -Wl,-rpath,$(V8LIBPATH)/out/mips.debug/lib.target -lv8
x64-debug: $(SOURCES)
g++ -o v8test_x64_debug $(CCFLAGS_DEBUG) -I$(V8INCPATH) $(SOURCES) -L$(V8PATH)/out/x64.debug/obj.target/tools/gyp $(LIBS_SNAPSHOT)

arm-release:
g++ -o v8test_arm_release -g -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH)/out/arm.release/lib.target/ -Wl,-rpath,$(V8LIBPATH)/out/arm.release/lib.target -lv8
mips-release: $(SOURCES)
g++ -o v8test_mips_release -m32 $(CCFLAGS_RELEASE) -I$(V8INCPATH) $(SOURCES) -L$(V8PATH)/out/mips.release/obj.target/tools/gyp -Wl,-rpath,$(V8PATH)/out/mips.release/obj.target/tools/gyp $(LIBS_NOSNAPSHOT)

arm-debug:
g++ -o v8test_arm_debug -g -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH)/out/arm.debug/lib.target/ -Wl,-rpath,$(V8LIBPATH)/out/arm.debug/lib.target -lv8
mips-debug: $(SOURCES)
g++ -o v8test_mips_debug -m32 $(CCFLAGS_DEBUG) -I$(V8INCPATH) $(SOURCES) -L$(V8PATH)/out/mips.debug/obj.target/tools/gyp -Wl,-rpath,$(V8PATH)/out/mips.debug/obj.target/tools/gyp $(LIBS_NOSNAPSHOT)

arm-release: $(SOURCES)
g++ -o v8test_arm_release -m32 $(CCFLAGS_RELEASE) -I$(V8INCPATH) $(SOURCES) -L$(V8PATH)/out/arm.release/obj.target/tools/gyp -Wl,-rpath,$(V8PATH)/out/arm.release/obj.target/tools/gyp $(LIBS_NOSNAPSHOT)

arm-debug: $(SOURCES)
g++ -o v8test_arm_debug -m32 $(CCFLAGS_DEBUG) -I$(V8INCPATH) $(SOURCES) -L$(V8PATH)/out/arm.debug/obj.target/tools/gyp -Wl,-rpath,$(V8PATH)/out/arm.debug/obj.target/tools/gyp $(LIBS_NOSNAPSHOT)
44 changes: 38 additions & 6 deletions tests/auto/v8/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,41 @@ without a build of Qt. The latter is necessary to run them against more exotic
build of V8, like the ARM simulator.

To build the non-Qt version of the tests, first build a debug or release V8
library under src/3rdparty/v8 using scons, and then use the Makefile.nonqt
makefile selecting one of the following targets:
release: Build the tests with -O2 and link against libv8
debug: Build the tests with -g and link against libv8_g
release-m32: Build the tests with -O2 -m32 and link against libv8
debug-m32: Build the tests with -g -m32 and link against libv8_g
library under src/3rdparty/v8 using gyp build.

For example:
make x64.release

NOTE: If you get error message like "/bin/sh: build/gyp/gyp: not found" first use:
make dependencies

For detailed description about gyp build, see:
http://code.google.com/p/v8/wiki/BuildingWithGYP

After the successful build use Makefile.nonqt under tests/auto/v8 for testing.

For example:
make -f Makefile.nonqt x64.release
./v8test_x64_release

The following targets are available for non-Qt testing:
ia32-release: Build the tests with -O2 -m32 and link against libv8_base and
libv8_snapshot.
ia32-debug: Build the tests with -g -m32 and link against libv8_base and
libv8_snapshot.
x64-release: Build the tests with -O2 and link against libv8_base and
libv8_snapshot.
x64-debug: Build the tests with -g and link against libv8_base and
libv8_snapshot.
mips-release: Build the tests with -O2 -m32 and link against libv8_base and
libv8_nosnapshot.
mips-debug: Build the tests with -g and link against libv8_base and
libv8_nosnapshot.
arm-release: Build the tests with -O2 -m32 and link against libv8_base and
libv8_nosnapshot.
arm-debug: Build the tests with -g and link against libv8_base and
libv8_nosnapshot.

NOTE: It is necessary to build the corresponding V8 libraries for each target. For
example the arm simulator testing in release mode (arm-release) needs:
make arm.release
3 changes: 2 additions & 1 deletion tests/auto/v8/v8main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ int main(int argc, char *argv[])
RUN_TEST(getcallingqmlglobal);
RUN_TEST(typeof);
RUN_TEST(referenceerror);
RUN_TEST(qtbug_24871);
RUN_TEST(fallbackpropertyhandler_callbacks);
RUN_TEST(fallbackpropertyhandler_in_prototype);
RUN_TEST(fallbackpropertyhandler_nonempty);
RUN_TEST(stringhashcomparison);
RUN_TEST(completehash);

return exit_status;
}
4 changes: 4 additions & 0 deletions tests/auto/v8/v8test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
****************************************************************************/

#include "v8test.h"
#ifndef NONQT_TESTING
#include <private/qcalculatehash_p.h>
#endif

using namespace v8;

Expand Down Expand Up @@ -1091,6 +1093,7 @@ bool v8test_completehash()
ENDTEST();
}

#ifndef NONQT_TESTING
bool v8test_stringhashcomparison()
{
BEGINTEST();
Expand Down Expand Up @@ -1143,3 +1146,4 @@ bool v8test_stringhashcomparison()

ENDTEST();
}
#endif

0 comments on commit adb6125

Please sign in to comment.