Skip to content

Commit

Permalink
add test for hashing failure in .a files
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed May 22, 2015
1 parent 7c6bf7e commit c9fdca2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,14 @@ def test_dup_o_in_one_a(self):
for line in text.split('\n'):
assert len(line) < 20, line # should not have huge hash names

# make the hashing fail: 'q' is just a quick append, no replacement, so hashing is not done, and dupes are easy
Popen([PYTHON, EMAR, 'q', 'liba.a', 'common.o', os.path.join('libdir', 'common.o')]).communicate()
out, err = Popen([PYTHON, EMCC, 'main.c', '-L.', '-la'], stderr=PIPE).communicate()
assert 'loading from archive' in err, err
assert 'which has duplicate entries' in err, err
assert 'duplicate: common.o' in err, err
assert err.count('duplicate: ') == 1, err # others are not duplicates - the hashing keeps them separate

def test_export_in_a(self):
export_name = 'this_is_an_entry_point'

Expand Down

0 comments on commit c9fdca2

Please sign in to comment.