From 4bd0cdb05e05e6b0d9035ffa8534443ba1b82019 Mon Sep 17 00:00:00 2001 From: ptarjan Date: Fri, 12 Apr 2013 21:58:53 -0700 Subject: [PATCH] Support repo mode in run_verify.sh --- hphp/test/.gitignore | 3 ++ hphp/test/hphp_config.hdf | 2 ++ hphp/test/tcr/compilation/1319.php.expect | 1 - hphp/test/tcr/compilation/1319.php.expectf | 1 + hphp/test/tcr/hphp_config.hdf | 0 hphp/test/verify | 24 +++++++++++++++- hphp/test/zend/hphp_config.hdf | 0 hphp/tools/run_verify.sh | 33 ++++++++++++++++++---- 8 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 hphp/test/.gitignore create mode 100644 hphp/test/hphp_config.hdf delete mode 100644 hphp/test/tcr/compilation/1319.php.expect create mode 100644 hphp/test/tcr/compilation/1319.php.expectf create mode 100644 hphp/test/tcr/hphp_config.hdf create mode 100644 hphp/test/zend/hphp_config.hdf diff --git a/hphp/test/.gitignore b/hphp/test/.gitignore new file mode 100644 index 000000000..ac6749cef --- /dev/null +++ b/hphp/test/.gitignore @@ -0,0 +1,3 @@ +*.out +*.diff +*.repo diff --git a/hphp/test/hphp_config.hdf b/hphp/test/hphp_config.hdf new file mode 100644 index 000000000..560244817 --- /dev/null +++ b/hphp/test/hphp_config.hdf @@ -0,0 +1,2 @@ +EnableXHP = true +EnableHipHopSyntax = true diff --git a/hphp/test/tcr/compilation/1319.php.expect b/hphp/test/tcr/compilation/1319.php.expect deleted file mode 100644 index d85d9d35c..000000000 --- a/hphp/test/tcr/compilation/1319.php.expect +++ /dev/null @@ -1 +0,0 @@ -HipHop Fatal error: Cannot pass parameter 1 by reference in /data/users/ptarjan/hphp/hphp/test/tcr/compilation/1319.php on line 3 diff --git a/hphp/test/tcr/compilation/1319.php.expectf b/hphp/test/tcr/compilation/1319.php.expectf new file mode 100644 index 000000000..1f3dd3c46 --- /dev/null +++ b/hphp/test/tcr/compilation/1319.php.expectf @@ -0,0 +1 @@ +%S \ No newline at end of file diff --git a/hphp/test/tcr/hphp_config.hdf b/hphp/test/tcr/hphp_config.hdf new file mode 100644 index 000000000..e69de29bb diff --git a/hphp/test/verify b/hphp/test/verify index 19883691e..350915c91 100755 --- a/hphp/test/verify +++ b/hphp/test/verify @@ -38,6 +38,8 @@ if ($opt_threads > 20) { $opt_reduce = ""; $opt_coverage = ""; $opt_hhvm = "hhvm"; +$opt_hphp = "hphp"; +$opt_repo = 0; $opt_cpu_time_limit = 0; $opt_real_time_limit = 0; $opt_no_exp = 0; @@ -59,6 +61,8 @@ $opt_retval = "coverage=s" => \$opt_coverage, "no-exp" => \$opt_no_exp, "hhvm=s" => \$opt_hhvm, + "hphp=s" => \$opt_hphp, + "repo=i" => \$opt_repo, "cpu-time-limit=i" => \$opt_cpu_time_limit, "real-time-limit=i" => \$opt_real_time_limit, ); @@ -367,7 +371,25 @@ sub run_test @lines = ; close(FILE); chomp(@lines); - $opts = join('', @lines); + $opts = join(' ', @lines); + } + + + if ($opt_repo) { + if ($test =~ m/\.hhas/) { + # We don't have a way to skip, I guess run non-repo? + } else { + my ($hphp_opts) = ""; + if (-e "$opt_objdir/$test.hphp_opts") { + open (FILE, "<$opt_objdir/$test.hphp_opts"); + @lines = ; + close(FILE); + chomp(@lines); + $hphp_opts = join(' ', @lines); + } + `$opt_hphp -thhbc -l0 -k1 -o $opt_objdir/$test.repo $hphp_opts $opt_objdir/$test`; + $opts .= " -v Repo.Authoritative=true -v Repo.Central.Path=$opt_objdir/$test.repo/hhvm.hhbc"; + } } ($utime, $stime, $cutime, $cstime) = times; diff --git a/hphp/test/zend/hphp_config.hdf b/hphp/test/zend/hphp_config.hdf new file mode 100644 index 000000000..e69de29bb diff --git a/hphp/tools/run_verify.sh b/hphp/tools/run_verify.sh index 932d3aaa2..959b96ed3 100755 --- a/hphp/tools/run_verify.sh +++ b/hphp/tools/run_verify.sh @@ -32,6 +32,7 @@ DEFAULT_VERIFY_HHBC=$FBMAKE_BIN_ROOT/verify.hhbc DEFAULT_HHVM=$FBMAKE_BIN_ROOT/hphp/hhvm/hhvm +DEFAULT_HPHP=$FBMAKE_BIN_ROOT/hphp/hhvm/hphp QTESTS_SKIP='autoload5.php condinfinite.php condinfinite2.php define_b.php _fbcufa_init.php include_b.php include_c.php include_d.php @@ -49,8 +50,10 @@ if [ x"$HPHP_HOME" = x"" ] ; then fi : ${HHVM:=$DEFAULT_HHVM} +: ${HPHP:=$DEFAULT_HPHP} : ${VERIFY_HHBC:=$DEFAULT_VERIFY_HHBC} : ${VQ:=jit} +: ${REPO:=0} : ${TEST_PATH:=test/vm} cd $HPHP_HOME/hphp @@ -75,8 +78,13 @@ hhir_args="$jit_args -v Eval.JitUseIR=true -v Eval.HHIRDisableTx64=true" # Find a config.hdf in the test dir or a parents # inspired by http://unix.stackexchange.com/questions/13464/ -cur_dir=$TEST_PATH; -slashes=${TEST_PATH//[^\/]/} + +if [ -f $TEST_PATH ]; then + cur_dir=`dirname $TEST_PATH`; +else + cur_dir="$TEST_PATH/" +fi +slashes=${cur_dir//[^\/]/} config="test/config.hdf" for (( n=${#slashes}; n>0; --n )); do if [ -f "$cur_dir/config.hdf" ]; then @@ -87,6 +95,22 @@ for (( n=${#slashes}; n>0; --n )); do done cmd="$HHVM --config $config" +if [ -f $TEST_PATH ]; then + cur_dir=`dirname $TEST_PATH`; +else + cur_dir="$TEST_PATH/" +fi +slashes=${cur_dir//[^\/]/} +config="test/hphp_config.hdf" +for (( n=${#slashes}; n>0; --n )); do + if [ -f "$cur_dir/hphp_config.hdf" ]; then + config="$cur_dir/hphp_config.hdf" + break + fi + cur_dir="$cur_dir/.." +done +HPHP_ARGS="--config $config" + if [ x"$MODE" = x"server" ] ; then : ${PORT:=8080} : ${TEST_HOME:=.} @@ -95,8 +119,7 @@ if [ x"$MODE" = x"server" ] ; then else cmd="$cmd --file %3\$s" fi -verify_args="$verify_args --hhvm $HHVM" - +verify_args="$verify_args --hhvm $HHVM --repo $REPO" cmd="$cmd -v Eval.EnableObjDestructCall=true" case $VQ in @@ -115,4 +138,4 @@ case $VQ in esac exec $VERIFY_SCRIPT --command="$cmd $VERIFY_EXTRA_CMD_ARGS" $verify_args \ - $VERIFY_EXTRA_ARGS $qtests + $VERIFY_EXTRA_ARGS --hphp="$HPHP $HPHP_ARGS" $qtests