hefeix / szl

Automatically exported from code.google.com/p/szl
Other
0 stars 0 forks source link

Broken test masked by broken test harness (engine/language_tests/base/include_b.szl) #35

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The szl_regtest.sh test base/include_b.szl is broken; it should not pass.
The szl_regtest.sh support script ./update has a bug which masks the brokenness.

The test apparently is intended to work like so:
 - base/include_b.szl loads and executes base/include_dir/a.szl
 - a.szl includes b.szl
 - b.szl declares a variable x
 - base/include_b.szl assigns to x (thereby checking that b.szl was successfully executed)

However, this cannot work as (apparently) intended because include_b.szl uses 
the load() builtin to load a.szl, and load() does not attempt to execute or 
otherwise interpret the bytes that it loads. Ref: 
http://szl.googlecode.com/svn/doc/sawzall-intrinsics.html

The test harness support script src/engine/language_tests/update has a large 
shell-case-statement with special settings for different test sources. The case 
for base/include_b.szl inserts "base/include_dir/a.szl" into the $sources 
variable. However, only the first word in that variable is used as the szl 
program; subsequent words are used as input data filenames. The effect of all 
this is that the test executes a.szl and ignores include_b.szl.

I am at a loss to recommend a fix, as the whole test appears to be a confusion 
of ideas complicated by a confused idea. I recommend deleting all three files 
unless the author has a better idea.

Original issue reported on code.google.com by aecolley on 3 Jun 2014 at 3:15