Exemplo n.º 1
0
def record(script,jalangi=util.DEFAULT_INSTALL):
    dummy_filename = os.path.join(tempfile.gettempdir(),"dummy.html")
    runtime = [os.path.join(jalangi.get_home(),s) for s in util.RUNTIME_SCRIPTS]
    in_memory_trace_code = "window.__JALANGI_IN_MEMORY_TRACE__ = true;"
    util.gen_wrapper_html_file(runtime + [script],dummy_filename,on_error_handler_code + in_memory_trace_code)
    return run_html_in_selenium(dummy_filename,get_regression_msgs_and_trace(True))
Exemplo n.º 2
0
def run_normal(script,jalangi=util.DEFAULT_INSTALL):
    dummy_filename = os.path.join(tempfile.gettempdir(),"dummy.html")
    util.gen_wrapper_html_file([script],dummy_filename,on_error_handler_code)
    return run_html_in_selenium(dummy_filename,get_regression_msgs(True))
Exemplo n.º 3
0
# You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Author: Manu Sridharan

import sys
import os
scriptpath = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../src/python/")
sys.path.insert(0,scriptpath)
import util

args = sys.argv
if len(args) == 1:
    print "Usage: python scripts/gen_wrapper_html.py script_file"
    sys.exit(0)
script_file = os.path.abspath(args[1])
no_ext = os.path.splitext(script_file)[0]
normal_html_file = no_ext + ".html"
inst_script_name = no_ext + "_jalangi_.js"
inst_html_file = no_ext + "_jalangi_.html"

util.gen_wrapper_html_file([script_file],normal_html_file)
util.gen_wrapper_html_file(util.RUNTIME_SCRIPTS + [inst_script_name],inst_html_file)