summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2012-10-16 10:57:41 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-16 13:15:29 +0200
commitadb6125097d6e73650d4eea0e4447a4001a0766c (patch)
tree4da142d9e714042c72d8ba6ae1ca08934ee70ac8 /tests
parentf5db1b5f6a04d5f08671ae4cee2eea8283a578aa (diff)
downloadqtjsbackend-adb6125097d6e73650d4eea0e4447a4001a0766c.tar.gz
Fix non-Qt testing
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 <simon.hausmann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/v8/Makefile.nonqt39
-rw-r--r--tests/auto/v8/README.txt44
-rw-r--r--tests/auto/v8/v8main.cpp3
-rw-r--r--tests/auto/v8/v8test.cpp4
4 files changed, 66 insertions, 24 deletions
diff --git a/tests/auto/v8/Makefile.nonqt b/tests/auto/v8/Makefile.nonqt
index fbdbeaf..8d911e4 100644
--- a/tests/auto/v8/Makefile.nonqt
+++ b/tests/auto/v8/Makefile.nonqt
@@ -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)
diff --git a/tests/auto/v8/README.txt b/tests/auto/v8/README.txt
index 097c459..da74642 100644
--- a/tests/auto/v8/README.txt
+++ b/tests/auto/v8/README.txt
@@ -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
diff --git a/tests/auto/v8/v8main.cpp b/tests/auto/v8/v8main.cpp
index ebb5b24..309a900 100644
--- a/tests/auto/v8/v8main.cpp
+++ b/tests/auto/v8/v8main.cpp
@@ -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;
}
diff --git a/tests/auto/v8/v8test.cpp b/tests/auto/v8/v8test.cpp
index 2145acb..2f434bb 100644
--- a/tests/auto/v8/v8test.cpp
+++ b/tests/auto/v8/v8test.cpp
@@ -40,7 +40,9 @@
****************************************************************************/
#include "v8test.h"
+#ifndef NONQT_TESTING
#include <private/qcalculatehash_p.h>
+#endif
using namespace v8;
@@ -1091,6 +1093,7 @@ cleanup:
ENDTEST();
}
+#ifndef NONQT_TESTING
bool v8test_stringhashcomparison()
{
BEGINTEST();
@@ -1143,3 +1146,4 @@ cleanup:
ENDTEST();
}
+#endif