示例#1
0
def tests_lstiter():
    tests = ""
    tests += 'puts("* ft_lstiter");';
    for i in range(TESTS_N):
        nb = random.randint(0, 10000000000)
        tests += inputs.create_list(nb)
        tests += "ft_lstiter(list{}, {});\n".format(nb, inputs.input_del_func())
    return tests
示例#2
0
def tests_lstlast():
    tests = ""
    tests += 'puts("* ft_lstlast");';
    for i in range(TESTS_N):
        nb = random.randint(0, 10000000000)
        tests += inputs.create_list(nb)
        tests += "free(ft_lstlast(list{}));\n".format(nb)
    return tests
示例#3
0
def tests_lstaddback():
    tests = ""
    tests += 'puts("* ft_lstadd_back");';
    for i in range(TESTS_N):
        nb = random.randint(0, 10000000000)
        tests += inputs.create_list(nb)
        tests += "ft_lstadd_back(&list{}, {});\n".format(nb, inputs.input_elem())
    return tests
示例#4
0
def tests_lstsize():
    tests = ""
    tests += 'puts("* ft_lstsize");'
    for i in range(TESTS_N):
        nb = random.randint(0, 10000000000)
        tests += inputs.create_list(nb)
        tests += "ft_lstsize(list{});\n".format(nb)
    return tests
示例#5
0
def make_test(name,
              PATH,
              prototype,
              n,
              create_list=False,
              create_pointer=False):
    tests = ""
    for i in range(n):
        nb_list = None
        if (create_list):
            nb_list = random.randint(0, 10000000000)
            tests += inputs.create_list(nb_list)
        nb_pointer = None
        size_pointer = 0
        if (create_pointer):
            nb_pointer = random.randint(0, 10000000000)
            size_pointer = random.randint(0, 10)
            tests += inputs.create_pointer(nb_pointer, size_pointer)
        tests += "\t"
        tests += fill_prototype(prototype,
                                list=nb_list,
                                pointer=nb_pointer,
                                pointer_size=size_pointer)
        tests += "\n"
    create_main(name, PATH, tests)
    result = compile_main(name, PATH)
    #print(result)
    if (len(result) > 0):
        print("\u001b[31m", end="")
    else:
        print("\u001b[32m", end="")
    print("{:23s} ".format(name), end="")
    if (len(result) == 0):
        print("{:>6s}".format("Ok"))
    elif ("Abort trap" in str(result)):
        print("{:>6s}".format("Abort"))
    elif ("segfault" in str(result)):
        print("{:>6s}".format("Segfault"))
    else:
        print("{:>6s}".format("Error"))
    print("\u001b[0m", end="")
示例#6
0
Spyder Editor

This is a temporary script file.
"""

import os
import json
import sys
import inputs
import shutil

from shutil import move

from re import findall

inputs.create_list()
tot_inps = len(inputs.listofinputs)


def process(jobdetails):
    jobtype = 'conformers'
    thisdir = os.getcwd()
    ready_files = os.path.join(thisdir, 'readys')
    print tot_inps
    for e in range(tot_inps):
        info = inputs.load_json(e)
        if inputs.listofinputs[e].lock == 'ready' and 'mopac' in info[
                "FILTERED"][0]:
            print inputs.get_name_file(e)
            try:
                move(inputs.listofinputs[e].fullpath, ready_files)