VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /usr/share/emscripten/tools/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/emscripten/tools/traverse.py
#!/usr/bin/env python2

'''
simple tool to run emcc and clang on C testcases each in a separate subdir of the current dir
'''

import os, sys

__rootpath__ = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def path_from_root(*pathelems):
  return os.path.join(__rootpath__, *pathelems)
sys.path += [path_from_root('')]
import tools.shared
from tools.shared import *

curr = os.getcwd()

for d in os.listdir(curr):
  print '(' + d + ') ',
  os.chdir(curr)
  if os.path.isdir(d):
    os.chdir(d)
    for c in os.listdir('.'):
      if c.endswith('.c'):
        execute([EMCC, c, '-O2', '--embed-file', 'input.txt'])
        js = jsrun.run_js('a.out.js', filter(lambda x: x != '-w', SPIDERMONKEY_ENGINE), stdout=PIPE)

        execute([CLANG_CC, '-m32', c])
        n1 = execute(['./a.out'], stdout=PIPE)[0]

        execute([CLANG_CC, '-m32', c, '-O2'])
        n2 = execute(['./a.out'], stdout=PIPE)[0]

        execute(['gcc', c, '-m32'])
        n3 = execute(['./a.out'], stdout=PIPE)[0]

        if js == n1:
          print 'ok'
        elif js == n2:
          print 'emcc and clang -O2 both equally wrong'
        elif js == n3:
          print 'emcc agrees with gcc, so probably ok'
        else:
          print
          print 'js  ', js,
          print 'c0  ', n1,
          print 'c2  ', n2,
          print 'g   ', n3,
          print 'fail!!!', d


VaKeR 2022