Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / native_client / src / trusted / validator_ragel / build.scons
index 65c102d..3ff8239 100644 (file)
@@ -96,6 +96,16 @@ env.AddNodeToTestSuite(
     ['small_tests', 'validator_tests'],
     'run_trie_test')
 
+proof_tools_test = env.CommandTest(
+    'proof_tools_test.out',
+    ['${PYTHON}', env.File('proof_tools_test.py'), '--verbose'],
+    direct_emulation=False)
+
+env.AddNodeToTestSuite(
+    proof_tools_test,
+    ['small_tests', 'validator_tests'],
+    'run_proof_tools_test')
+
 dll_env = env.Clone(COMPONENT_STATIC=False)
 
 if env.Bit('windows'):
@@ -158,7 +168,7 @@ if python_can_load_dll:
 #   dfagen : Regenerate any autogenerated source files.
 
 ragel_targets = set([
-    'dfagen', 'dfacheckdecoder', 'dfacheckvalidator'])
+    'dfagen', 'dfacheckdecoder', 'dfacheckvalidator', 'dfachecktries'])
 ragel_involved = ragel_targets.intersection(COMMAND_LINE_TARGETS)
 
 gas = env.MakeUntrustedNativeEnv()['AS']
@@ -289,6 +299,65 @@ if ragel_involved:
   env.AlwaysBuild(env.Alias('dfagen', automata))
   env.AlwaysBuild(env.Alias('dfacheckdecoder', check_decoders))
 
+  check_tries = []
+
+  for bits, xml in [('32', validator32_xml), ('64', validator64_xml)]:
+    latest_trie_file = env.AutoDepsCommand(
+        '%s/gen_trie_%s.out' % (gen_dir, bits),
+        ['${PYTHON}',
+         env.File('gen_trie_from_dfa.py'),
+         xml,
+         '--bitness', bits,
+         '--validator_dll', validator_dll,
+         '--decoder_dll', decoder_dll,
+         '--trie_path', '${TARGET}'])
+
+    check_latest_trie_file = env.AutoDepsCommand(
+        'check_latest_trie_%s.out' % bits,
+        ['${PYTHON}',
+         env.File('check_trie.py'),
+         '--bitness', bits,
+         latest_trie_file])
+    check_tries.append(check_latest_trie_file)
+
+
+  snapshots_dir = '${MAIN_DIR}/../validator_snapshots'
+  trie_proofs = [
+    # (proof_file_name, bitness, old_trie_path, new_trie_path)
+    ('vzero_proof.py', '32', '20141001', '20141020.vzero'),
+    ('vzero_proof.py', '64', '20141001', '20141020.vzero'),
+    ('movbe_proof.py', '32', '20141020.vzero', '20141021.movbe'),
+    ('movbe_proof.py', '64', '20141020.vzero', '20141021.movbe'),
+    ('bsr_bsf_proof.py', '32', '20141021.movbe', '20141027.bsr_bsf'),
+    ('bsr_bsf_proof.py', '64', '20141021.movbe', '20141027.bsr_bsf'),
+    ('shld_shrd_proof.py', '32', '20141027.bsr_bsf', '20141028.shld_shrd'),
+    ('shld_shrd_proof.py', '64', '20141027.bsr_bsf', '20141028.shld_shrd'),
+    ('xadd16_proof.py', '32', '20141028.shld_shrd', '20141029.xadd16'),
+    ('xadd16_proof.py', '64', '20141028.shld_shrd', '20141029.xadd16'),
+    ('cmpxchg16_proof.py', '32', '20141029.xadd16', '20141030.cmpxchg16'),
+    ('cmpxchg16_proof.py', '64', '20141029.xadd16', '20141030.cmpxchg16'),
+    ('avx1_xmm_ymm_memory_3op_pd_proof.py', '32', '20141030.cmpxchg16',
+     '20141031.avx1_3op_fp_pd'),
+    ('avx1_xmm_ymm_memory_3op_pd_proof.py', '64', '20141030.cmpxchg16',
+     '20141031.avx1_3op_fp_pd'),
+  ]
+  for proof_file, bitness, old, new in trie_proofs:
+    trie_subdirs = {'32': 'ragel_trie_x86_32', '64': 'ragel_trie_x86_64'}
+    check_proof = env.AutoDepsCommand(
+      '%s_%s_results' % (proof_file, bitness),
+      ['${PYTHON}',
+       env.File(proof_file),
+       '--validator_dll', validator_dll,
+       '--decoder_dll', decoder_dll,
+       '--bitness', bitness,
+       '--old', snapshots_dir + '/' + trie_subdirs[bitness] + '/' + old,
+       '--new', snapshots_dir + '/' + trie_subdirs[bitness] + '/' + new])
+    check_tries.append(check_proof)
+
+  # Don't run gen_trie tests in parallel because they can take all CPU.
+  SideEffect('check_tries', check_tries)
+  env.Alias('dfachecktries', check_tries)
+
   if python_can_load_dll:
 
     dfacheckvalidator_tests = []
@@ -328,29 +397,6 @@ if ragel_involved:
       SideEffect('check_validator', regular_instructions_test)
       dfacheckvalidator_tests.append(regular_instructions_test)
 
-      env32 = env.Clone(BUILD_TARGET_NAME='x86-32')
-      env64 = env.Clone(BUILD_TARGET_NAME='x86-64')
-      old_ncval32 = env32.File('$STAGING_DIR/ncval$PROGSUFFIX')
-      old_ncval64 = env64.File('$STAGING_DIR/ncval$PROGSUFFIX')
-
-      regular_instructions_old_test = env.AutoDepsCommand(
-        'regular_instructions_old_test_x86_%s.out' % bitness,
-        ['${PYTHON}',
-         env.File('verify_regular_instructions_old.py'),
-         xml,
-         '--bitness', bitness,
-         '--gas', gas,
-         '--objdump', objdump,
-         '--validator_dll', validator_dll,
-         '--ncval32', old_ncval32,
-         '--ncval64', old_ncval64,
-         '--errors', '${TARGET}'])
-
-      # Never run exhaustive tests in parallel because they can take all CPU.
-      env.AlwaysBuild(regular_instructions_old_test)
-      SideEffect('check_validator', regular_instructions_old_test)
-      dfacheckvalidator_tests.append(regular_instructions_old_test)
-
     # There are three categories of protected files: validator files, generated
     # files (those of validator files that lie withing 'gen' directory) and
     # generating files (programs and input data used to produce generated