diff --git a/CMakeLists.txt b/CMakeLists.txt index 828ee4227fc..14595e1ee5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -496,15 +496,15 @@ set(HERMES_LIT_TEST_PARAMS use_flowparser=${HERMES_USE_FLOWPARSER} jit_enabled=${HERMESVM_JIT} jit_disassembler_enabled=${HERMESVM_JIT_DISASSEMBLER} - hbc_deltaprep=${HERMES_BINARY_DIR}/bin/hbc-deltaprep - FileCheck=${LLVM_BUILD_DIR}/bin/FileCheck - hermes=${HERMES_BINARY_DIR}/bin/hermes - hermesc=${HERMES_BINARY_DIR}/bin/hermesc - hdb=${HERMES_BINARY_DIR}/bin/hdb - hbcdump=${HERMES_BINARY_DIR}/bin/hbcdump - repl=${HERMES_BINARY_DIR}/bin/hermes-repl - hbc-deltaprep=${HERMES_BINARY_DIR}/bin/hbc-deltaprep - hbc_diff=${HERMES_BINARY_DIR}/bin/hbc-diff + hbc_deltaprep=${HERMES_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/hbc-deltaprep + FileCheck=${LLVM_BUILD_DIR}/${CMAKE_CFG_INTDIR}/bin/FileCheck + hermes=${HERMES_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/hermes + hermesc=${HERMES_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/hermesc + hdb=${HERMES_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/hdb + hbcdump=${HERMES_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/hbcdump + repl=${HERMES_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/hermes-repl + hbc-deltaprep=${HERMES_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/hbc-deltaprep + hbc_diff=${HERMES_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/hbc-diff build_mode=${HERMES_ASSUMED_BUILD_MODE_IN_LIT_TEST} exception_on_oom_enabled=${HERMESVM_EXCEPTION_ON_OOM} serialize_enabled=${HERMESVM_SERIALIZE} diff --git a/test/Driver/driver-test.sh b/test/Driver/driver-test.sh index 92aa3bb20a1..d9e1baa36f4 100644 --- a/test/Driver/driver-test.sh +++ b/test/Driver/driver-test.sh @@ -5,6 +5,8 @@ # RUN: sh %s %S %T %hermes # RUN: sh %s %S %T %hermesc +# TODO(T53144040) Fix LIT tests on Windows +# XFAIL: windows # shellcheck disable=SC2148 SRCDIR=$1 diff --git a/test/Optimizer/cjs/cjs-static-fail-1.js b/test/Optimizer/cjs/cjs-static-fail-1.js index 33f7ef93af8..343a0fd2fd3 100644 --- a/test/Optimizer/cjs/cjs-static-fail-1.js +++ b/test/Optimizer/cjs/cjs-static-fail-1.js @@ -4,55 +4,57 @@ // file in the root directory of this source tree. // // RUN: %hermesc -fstatic-require -commonjs -emit-binary %s 2>&1 > /dev/null | %FileCheck --match-full-lines %s +// TODO(T53144040) Fix LIT tests on Windows +// XFAIL: windows foo(require); -//CHECK: {{.*}}cjs-static-fail-1.js:8:4: warning: 'require' used as function call argument +//CHECK: {{.*}}cjs-static-fail-1.js:10:4: warning: 'require' used as function call argument //CHECK-NEXT: foo(require); //CHECK-NEXT: ^ require(require); -//CHECK: {{.*}}cjs-static-fail-1.js:13:8: warning: 'require' used as function call argument +//CHECK: {{.*}}cjs-static-fail-1.js:15:8: warning: 'require' used as function call argument //CHECK-NEXT: require(require); //CHECK-NEXT: ^ new require("a"); -//CHECK: {{.*}}cjs-static-fail-1.js:18:12: warning: 'require' used as a constructor +//CHECK: {{.*}}cjs-static-fail-1.js:20:12: warning: 'require' used as a constructor //CHECK-NEXT: new require("a"); //CHECK-NEXT: ^ this.prop1 = require; -//CHECK: {{.*}}cjs-static-fail-1.js:23:12: warning: 'require' escapes or is modified +//CHECK: {{.*}}cjs-static-fail-1.js:25:12: warning: 'require' escapes or is modified //CHECK-NEXT: this.prop1 = require; //CHECK-NEXT: ^ require(); -//CHECK: {{.*}}cjs-static-fail-1.js:28:8: warning: require() invoked without arguments +//CHECK: {{.*}}cjs-static-fail-1.js:30:8: warning: require() invoked without arguments //CHECK-NEXT: require(); //CHECK-NEXT: ^ require("b", "c"); -//CHECK: {{.*}}cjs-static-fail-1.js:33:8: warning: Additional require() arguments will be ignored +//CHECK: {{.*}}cjs-static-fail-1.js:35:8: warning: Additional require() arguments will be ignored //CHECK-NEXT: require("b", "c"); //CHECK-NEXT: ^ require(foo + 1); -//CHECK: {{.*}}cjs-static-fail-1.js:38:8: warning: require() argument cannot be coerced to constant string at compile time +//CHECK: {{.*}}cjs-static-fail-1.js:40:8: warning: require() argument cannot be coerced to constant string at compile time //CHECK-NEXT: require(foo + 1); //CHECK-NEXT: ^ -//CHECK: {{.*}}cjs-static-fail-1.js:38:9: note: First argument of require() +//CHECK: {{.*}}cjs-static-fail-1.js:40:9: note: First argument of require() //CHECK-NEXT: require(foo + 1); //CHECK-NEXT: ^ function func() { require("c"); var r = require; -//CHECK: {{.*}}cjs-static-fail-1.js:48:11: warning: 'require' is copied to a variable which cannot be analyzed +//CHECK: {{.*}}cjs-static-fail-1.js:50:11: warning: 'require' is copied to a variable which cannot be analyzed //CHECK-NEXT: var r = require; //CHECK-NEXT: ^ } print({}[require]); -//CHECK: {{.*}}cjs-static-fail-1.js:54:9: warning: 'require' is used as a property key and cannot be analyzed +//CHECK: {{.*}}cjs-static-fail-1.js:56:9: warning: 'require' is used as a property key and cannot be analyzed //CHECK-NEXT: print({}[require]); //CHECK-NEXT: ^ diff --git a/test/Optimizer/cjs/cjs-static-fail-2.js b/test/Optimizer/cjs/cjs-static-fail-2.js index 20b70a8cae7..904f6f898a6 100644 --- a/test/Optimizer/cjs/cjs-static-fail-2.js +++ b/test/Optimizer/cjs/cjs-static-fail-2.js @@ -4,42 +4,44 @@ // file in the root directory of this source tree. // // RUN: %hermesc -O -fstatic-require -commonjs -emit-binary %s 2>&1 > /dev/null | %FileCheck --match-full-lines %s +// TODO(T53144040) Fix LIT tests on Windows +// XFAIL: windows foo(require); -//CHECK: {{.*}}cjs-static-fail-2.js:8:4: warning: 'require' used as function call argument +//CHECK: {{.*}}cjs-static-fail-2.js:10:4: warning: 'require' used as function call argument //CHECK-NEXT: foo(require); //CHECK-NEXT: ^ require(require); -//CHECK: {{.*}}cjs-static-fail-2.js:13:8: warning: 'require' used as function call argument +//CHECK: {{.*}}cjs-static-fail-2.js:15:8: warning: 'require' used as function call argument //CHECK-NEXT: require(require); //CHECK-NEXT: ^ new require("a"); -//CHECK: {{.*}}cjs-static-fail-2.js:18:12: warning: 'require' used as a constructor +//CHECK: {{.*}}cjs-static-fail-2.js:20:12: warning: 'require' used as a constructor //CHECK-NEXT: new require("a"); //CHECK-NEXT: ^ this.prop1 = require; -//CHECK: {{.*}}cjs-static-fail-2.js:23:12: warning: 'require' escapes or is modified +//CHECK: {{.*}}cjs-static-fail-2.js:25:12: warning: 'require' escapes or is modified //CHECK-NEXT: this.prop1 = require; //CHECK-NEXT: ^ require(); -//CHECK: {{.*}}cjs-static-fail-2.js:28:8: warning: require() invoked without arguments +//CHECK: {{.*}}cjs-static-fail-2.js:30:8: warning: require() invoked without arguments //CHECK-NEXT: require(); //CHECK-NEXT: ^ require("b", "c"); -//CHECK: {{.*}}cjs-static-fail-2.js:33:8: warning: Additional require() arguments will be ignored +//CHECK: {{.*}}cjs-static-fail-2.js:35:8: warning: Additional require() arguments will be ignored //CHECK-NEXT: require("b", "c"); //CHECK-NEXT: ^ require(foo + 1); -//CHECK: {{.*}}cjs-static-fail-2.js:38:8: warning: require() argument cannot be coerced to constant string at compile time +//CHECK: {{.*}}cjs-static-fail-2.js:40:8: warning: require() argument cannot be coerced to constant string at compile time //CHECK-NEXT: require(foo + 1); //CHECK-NEXT: ^ -//CHECK: {{.*}}cjs-static-fail-2.js:38:9: note: First argument of require() +//CHECK: {{.*}}cjs-static-fail-2.js:40:9: note: First argument of require() //CHECK-NEXT: require(foo + 1); //CHECK-NEXT: ^ diff --git a/test/Optimizer/promotion_on_switch.js b/test/Optimizer/promotion_on_switch.js index 781ffb49810..a1ce2f458cc 100644 --- a/test/Optimizer/promotion_on_switch.js +++ b/test/Optimizer/promotion_on_switch.js @@ -4,6 +4,8 @@ // file in the root directory of this source tree. // // RUN: %hermes -target=HBC -emit-binary -O %s > /dev/null +// TODO(T53144040) Fix LIT tests on Windows +// XFAIL: windows function days_of_the_w_ek(x) { switch (1) { diff --git a/test/hermes/date-locale.js b/test/hermes/date-locale.js index fc7f2eecba6..7dd91042ba1 100644 --- a/test/hermes/date-locale.js +++ b/test/hermes/date-locale.js @@ -10,6 +10,8 @@ RUN: TZ=EST+5 LC_ALL=tr_TR _HERMES_TEST_LOCALE=tr_TR %hermes -O -target=HBC %s \ RUN: | %FileCheck --match-full-lines -check-prefix TR %s RUN: TZ=EST+5 %hermes -O -target=HBC %s \ RUN: | %FileCheck --match-full-lines -check-prefix NO %s +TODO(T53144040) Fix LIT tests on Windows +XFAIL: windows */ "use strict"; diff --git a/test/hermes/string-locale.js b/test/hermes/string-locale.js index 902263be4c0..0753c09bdc0 100644 --- a/test/hermes/string-locale.js +++ b/test/hermes/string-locale.js @@ -10,6 +10,8 @@ RUN: LC_ALL=tr_TR.UTF-8 _HERMES_TEST_LOCALE=tr_TR.UTF-8 %hermes -O -target=HBC % RUN: | %FileCheck --match-full-lines -check-prefix TR %s RUN: LC_ALL=UTF-8 _HERMES_TEST_LOCALE=UTF-8 %hermes -O -target=HBC %s \ RUN: | %FileCheck --match-full-lines -check-prefix NO %s +TODO(T53144040) Fix LIT tests on Windows +XFAIL: windows */ "use strict"; diff --git a/test/lit.cfg b/test/lit.cfg index a367f728307..d0fa862feca 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -1,5 +1,6 @@ import lit import os +import sys def isTrue(v): """Check whether a string converts to True according to CMake rules""" @@ -39,6 +40,12 @@ if lit_config.params["build_mode"] != "opt": if lit_config.params["build_mode"] == "dbg": config.available_features.add("slow_debug") +if sys.platform.startswith('cygwin'): + lit_config.fatal('Running Hermes LIT tests in cygwin Python is not ' + + 'supported. Please use regular Python on Windows.') +if os.name == 'nt': + config.available_features.add("windows") + # Note substitutions are applied in order. # %hermesc must appear before %hermes, or else %hermes will substitute *inside* %hermesc config.substitutions.append(("%FileCheck", lit_config.params["FileCheck"]))