Skip to content

Commit

Permalink
Avoid /dev/null in LIT tests
Browse files Browse the repository at this point in the history
Summary: Additionally, re-enables those LIT tests now that they can run successfully in Cygwin on Windows.

Reviewed By: dulinriley

Differential Revision: D18328915

fbshipit-source-id: bf455206801379135e3fa8d4ea7e03e72f86b7d8
  • Loading branch information
haozhun authored and facebook-github-bot committed Nov 7, 2019
1 parent 46f1053 commit fd9c6b7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
19 changes: 9 additions & 10 deletions test/Driver/driver-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# RUN: sh %s %S %T %hermes
# RUN: sh %s %S %T %hermesc
# TODO(T53144040) Fix LIT tests on Windows
# XFAIL: windows
# RUN: sh %s %S %t %hermes
# RUN: sh %s %S %t %hermesc

# shellcheck disable=SC2148

SRCDIR=$1
TMPDIR=$2
TMPFILE=$2
HERMES=$3

# Return values from hermes and hermesc.
Expand All @@ -28,7 +27,7 @@ set -x
expect() {
EXPECTED=$1
shift
eval "$@" 2>/dev/null
eval "$@" 2>"$TMPFILE"
if [[ $? != "$EXPECTED" ]]; then
echo "Command '$CMD' produced wrong exit status" >&2
exit 1
Expand All @@ -37,10 +36,10 @@ expect() {
}

cd "${SRCDIR}" || exit 1
expect "${Success}" "${HERMES}" test.js.in -target=HBC -emit-binary > /dev/null
expect "${Success}" "${HERMES}" test.js.in -target=HBC -emit-binary > "$TMPFILE"
expect "${InvalidFlags}" "${HERMES}" -lazy -commonjs test.js.in
expect "${InvalidFlags}" "${HERMES}" -nonsenseflag test.js.in
expect "${ParsingFailed}" "${HERMES}" bogus.js.in -target=HBC -emit-binary > /dev/null
expect "${LoadGlobalsFailed}" "${HERMES}" test.js.in -include-globals bogus.js.in -emit-binary -target=HBC > /dev/null
expect "${InputFileError}" "${HERMES}" ./not/a/valid/path.js -target=HBC -emit-binary > /dev/null
expect "${ParsingFailed}" "${HERMES}" bogus.js.in -target=HBC -emit-binary > "$TMPFILE"
expect "${LoadGlobalsFailed}" "${HERMES}" test.js.in -include-globals bogus.js.in -emit-binary -target=HBC > "$TMPFILE"
expect "${InputFileError}" "${HERMES}" ./not/a/valid/path.js -target=HBC -emit-binary > "$TMPFILE"
expect "${OutputFileError}" "${HERMES}" test.js.in -target=HBC -emit-binary -out ./not/a/valid/path.hbc
6 changes: 3 additions & 3 deletions test/Optimizer/cjs/cjs-static-fail-1.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* LICENSE 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
// RUN: %hermesc -fstatic-require -commonjs -emit-binary %s 2>&1 > %t | %FileCheck --match-full-lines %s



foo(require);
//CHECK: {{.*}}cjs-static-fail-1.js:12:4: warning: 'require' used as function call argument
Expand Down
6 changes: 3 additions & 3 deletions test/Optimizer/cjs/cjs-static-fail-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* LICENSE 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
// RUN: %hermesc -O -fstatic-require -commonjs -emit-binary %s 2>&1 > %t | %FileCheck --match-full-lines %s



foo(require);
//CHECK: {{.*}}cjs-static-fail-2.js:12:4: warning: 'require' used as function call argument
Expand Down
4 changes: 1 addition & 3 deletions test/Optimizer/promotion_on_switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
* LICENSE 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
// RUN: %hermes -target=HBC -emit-binary -O %s > %t

function days_of_the_w_ek(x) {
switch (1) {
Expand Down

0 comments on commit fd9c6b7

Please sign in to comment.