Exemple #1
0
 def get_command_diff(self):
     c = []
     c.append("diff")
     c.append("-Naur")
     c.append(config.pkg_home() + '/script/ilist.txt.err')
     c.append(config.pkg_home() + '/script/ilist.txt.merge.sort.' + str(self.merging_number).zfill(3))
     return c
Exemple #2
0
 def display(self):
     for i in range(1, int(self.merging_number)+1):
         input_file = open(config.pkg_home() + '/script/ilist.db.' + str(i).zfill(3), "rb")
         ilist_db = ilist_pb2.iListProto()
         ilist_db.ParseFromString(input_file.read())
         input_file.close()
         #output to txt file, can be read by human
         output_file = open(config.pkg_home() + '/script/ilist.txt.' + str(i).zfill(3), 'w')
         for entry in ilist_db.entry:
             output_file.write(str(entry.iroot_id))
             output_file.write('\n')
         output_file.close()
Exemple #3
0
 def __init__(self, input_idx):
     testing.CmdlineTest.__init__(self, input_idx)
     self.add_input(
         ([self.bin(), '-n2', 'jieyu'] +
          self.get_cc_files(config.pkg_home() + '/src/systematic'), _sio))
     self.add_input(
         ([self.bin(), '-n3', 'Authors'] +
          self.get_cc_files(config.pkg_home() + '/src/systematic'), _sio))
     self.add_input(
         ([self.bin(), '-n3', 'main'] +
          self.get_all_files(config.pkg_home() + '/src/pct'), _sio))
     self.add_input(([
         self.bin(), '-n2', 'Apache',
         config.pkg_home() + '/src/idiom/memo.cc'
     ], _sio))
     self.add_input(
         ([self.bin(), '-n2', 'get_benchmark'] +
          self.get_py_files(config.pkg_home() + '/script/maple/benchmark'),
          _sio))
     self.add_input(
         ([self.bin(), '-n3', 'PreSetup'] +
          self.get_all_files(config.pkg_home() + '/src/core'), _sio))
     self.add_input(
         ([self.bin(), '-n3', 'NO_EXIST'] +
          self.get_all_files(config.pkg_home() + '/src/idiom'), _sio))
     self.add_input(
         ([self.bin(), '-n2', 'main'] +
          self.get_cc_files(config.pkg_home() + '/test/idiom/observer'),
          _sio))
Exemple #4
0
 def diff(self):
     diff_command = self.get_command_diff() 
     output_file_diff = open(config.pkg_home() + '/script/ilist.txt.err.'+str(self.merging_number).zfill(3) 
                             + '.diff', 'w')
     proc_diff = subprocess.Popen(diff_command, shell = False, stdout = output_file_diff)
     proc_diff.wait()
     output_file_diff.close()
Exemple #5
0
 def get_command_sort(self, i):
     c = []
     c.append("sort")
     c.append("-d")
     c.append("-k1")
     c.append("-u")
     c.append(config.pkg_home() + '/script/ilist.txt.merge.' + str(i+1).zfill(3))
     return c
Exemple #6
0
def valid_benchmark_set():
    result = set()
    path = config.pkg_home() + '/script/maple/benchmark'
    for f in os.listdir(path):
        if f.endswith('.py'):
            if f != '__init__.py':
                result.add(f[:-3])
    return result
Exemple #7
0
def valid_benchmark_set():
    result = set()
    path = config.pkg_home() + '/script/maple/benchmark'
    for f in os.listdir(path):
        if f.endswith('.py'):
            if f != '__init__.py':
                result.add(f[:-3])
    return result
Exemple #8
0
 def __init__(self, input_idx):
     testing.CmdlineTest.__init__(self, input_idx)
     self.add_input(([self.bin(), '-n2', 'jieyu'] + self.get_cc_files(config.pkg_home() + '/src/systematic'), _sio))
     self.add_input(([self.bin(), '-n3', 'Authors'] + self.get_cc_files(config.pkg_home() + '/src/systematic'), _sio))
     self.add_input(([self.bin(), '-n3', 'main'] + self.get_all_files(config.pkg_home() + '/src/pct'), _sio))
     self.add_input(([self.bin(), '-n2', 'Apache', config.pkg_home() + '/src/idiom/memo.cc'], _sio))
     self.add_input(([self.bin(), '-n2', 'get_benchmark'] + self.get_py_files(config.pkg_home() + '/script/maple/benchmark'), _sio))
     self.add_input(([self.bin(), '-n3', 'PreSetup'] + self.get_all_files(config.pkg_home() + '/src/core'), _sio))
     self.add_input(([self.bin(), '-n3', 'NO_EXIST'] + self.get_all_files(config.pkg_home() + '/src/idiom'), _sio))
     self.add_input(([self.bin(), '-n2', 'main'] + self.get_cc_files(config.pkg_home() + '/test/idiom/observer'), _sio))
Exemple #9
0
  def merge(self):
      proc_copy = subprocess.Popen(["cp", config.pkg_home() + '/script/ilist.txt.001', 
                                   config.pkg_home() + '/script/ilist.txt.merge.001'])
      proc_copy.wait()
      for i in range(1, self.merging_number):
          cat_command = self.get_command_cat(i)
          output_file_merge = open(config.pkg_home() + '/script/ilist.txt.merge.'+str(i+1).zfill(3), 'w')
          proc_merge = subprocess.Popen(cat_command, shell = False, stdout = output_file_merge)  
          proc_merge.wait()
          output_file_merge.close()
 
          sort_command = self.get_command_sort(i)
          output_file_sort = open(config.pkg_home() + '/script/ilist.txt.merge.sort.' + str(i+1).zfill(3), 'w')
          proc_sort = subprocess.Popen(sort_command, shell = False, stdout = output_file_sort)
          proc_sort.wait()
          output_file_sort.close()
       
      proc_del = subprocess.Popen(['rm', '-rf', config.pkg_home() + '/script/ilist.txt.merge.???'])
      proc_del.wait()
Exemple #10
0
 def bin(self):
     return config.pkg_home() + '/example/shared_counter/main'
Exemple #11
0
 def bin(self):
     return config.pkg_home() + '/example/string_buffer/main'
Exemple #12
0
 def bin(self):
     return config.pkg_home() + '/example/circular_list/main'
Exemple #13
0
 def bin(self):
     return config.pkg_home() + '/example/shared_counter/main'
 def bin(self):
     return config.pkg_home() + '/example/mysql_169_extract/main'
Exemple #15
0
 def bin(self):
     return config.pkg_home() + '/example/log_proc_sweep/main'
Exemple #16
0
def command_mv_ilist(test_history):
    cmd_list = []
    cmd_list.append('/bin/mv')
    cmd_list.append(config.pkg_home() + '/script/ilist.db')
    cmd_list.append(config.pkg_home() + '/script/ilist.db.'+str(test_history).zfill(3))
    return cmd_list
Exemple #17
0
 def bin(self):
     return config.pkg_home() + '/example/string_buffer/main'
Exemple #18
0
 def bin(self):
     return config.pkg_home() + '/example/log_proc_sweep/main'
Exemple #19
0
"""Copyright 2011 The University of Michigan

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
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.

Authors - Jie Yu ([email protected])
"""

import sys
from maple.core import config

proto_script_base = config.pkg_home() + '/script/maple/proto'
sys.path.insert(0, proto_script_base)


def module(name):
    if not name in sys.modules:
        __import__(name)
    return sys.modules[name]
Exemple #20
0
"""Copyright 2011 The University of Michigan

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
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.

Authors - Jie Yu ([email protected])
"""

import sys
from maple.core import config

proto_script_base = config.pkg_home() + '/script/maple/proto'
sys.path.insert(0, proto_script_base)

def module(name):
    if not name in sys.modules:
        __import__(name)
    return sys.modules[name]

Exemple #21
0
 def get_command_cat(self, i):
     c = []
     c.append("cat")
     c.append(config.pkg_home() + '/script/ilist.txt.merge.' + str(i).zfill(3))
     c.append(config.pkg_home() + '/script/ilist.txt.' + str(i+1).zfill(3))
     return c
Exemple #22
0
 def bin(self):
     return config.pkg_home() + '/example/bank_account/main'
 def bin(self):
     return config.pkg_home() + '/example/circular_list/main'
Exemple #24
0
 def bin(self):
     return config.pkg_home() + '/example/bank_account/main'