tests/preprocessor.rb in metasm-1.0.3 vs tests/preprocessor.rb in metasm-1.0.4

- old
+ new

@@ -67,10 +67,27 @@ #define tutu #if defined ( tutu ) tutu coucou #endif EOS + helper_preparse(<<EOS, 'a1') +#define tutu +#if ! defined ( tutu ) +a0 +#else +a1 +#endif +EOS + helper_preparse(<<EOS, 'a1') +#define tutu +#if defined(tutu) ? 0 : 1 +a0 +#endif +#if defined(toto) ? 0 : 1 +a1 +#endif +EOS helper_preparse('a #define b', 'a #define b') helper_preparse(<<EOS, "// true !\nblu") #ifdef toto // this is false bla #elif .2_3e-4 > 2 /* this one too */ @@ -140,9 +157,10 @@ helper_preparse(<<EOS, 'in') #pragma include_path "." #include <tests/prepro_testinclude.asm> out EOS + rescue Errno::ENOENT ensure File.unlink('tests/prepro_testinclude.asm') rescue nil end helper_preparse(<<EOS, 'in') { |p_| p_.hooked_include['bla.h'] = '#define out in' }