Skip to content

Commit 1a907c2

Browse files
author
H. Peter Anvin
committed
travis: always generate a list file; show subtest number
Always generate a list file and point output at a given filename, even if failure is expected. Remove ad hoc -o output names that generally don't point into safe locations. The result is that the preprocessing options (-E) no longer output to stdout, so change the tests accordingly. Signed-off-by: H. Peter Anvin (Intel) <[email protected]>
1 parent 94dd4d3 commit 1a907c2

32 files changed

+52
-49
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*.ith
1515
*.lib
1616
*.lst
17+
*.log
1718
*.map
1819
*.mo32
1920
*.mo64
@@ -122,3 +123,4 @@ TAGS
122123
/autoconf/config.*
123124
/autoconf/install-sh
124125
/autoconf/clean.sh
126+
/travis/test/_version.stdout

travis/nasm-t.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def expand_templates(desc_array):
147147
for k, v in own.items():
148148
desc_array[i][k] = v
149149
del desc_array[i]['id']
150+
desc_array[i]['_seq'] = '.%d' % (i+1)
150151
return desc_array
151152

152153
def prepare_desc(desc, basedir, name, path):
@@ -157,7 +158,10 @@ def prepare_desc(desc, basedir, name, path):
157158
desc['_base-dir'] = basedir
158159
desc['_json-file'] = name
159160
desc['_json-path'] = path
160-
desc['_test-name'] = basedir + os.sep + name[:-5]
161+
if not '_seq' in desc:
162+
desc['_seq'] = ''
163+
desc['_test-name'] = basedir + os.sep + name[:-5] + desc['_seq']
164+
161165
#
162166
# If no target provided never update
163167
if 'target' not in desc:
@@ -338,19 +342,16 @@ def prepare_run_opts(desc):
338342
opts += ['-f', desc['format']]
339343
if 'option' in desc:
340344
opts += desc['option'].split(" ")
345+
outfile = desc['_test-name'] + '.out'
341346
for t in desc['target']:
342347
if 'output' in t:
343-
if 'option' in t:
344-
opts += t['option'].split(" ")
345-
else:
346-
opts += ['-o']
347348
outfile = desc['_base-dir'] + os.sep + t['output']
348-
opts += [outfile, '-L+', '-l', outfile + '.lst']
349-
if 'stdout' in t or 'stderr' in t:
350-
if 'option' in t:
351-
opts += t['option'].split(" ")
349+
if 'option' in t:
350+
opts += t['option'].split(" ")
351+
opts += ['-o', outfile, '-L+', '-l', outfile + '.lst']
352352
if 'source' in desc:
353353
opts += [desc['_base-dir'] + os.sep + desc['source']]
354+
354355
return opts
355356

356357
def exec_nasm(desc):
@@ -436,7 +437,7 @@ def test_run(desc):
436437
if f:
437438
out_data = f_pat.sub(f_sub, out_data, 0)
438439
if cmp_std(match, match_data, 'stdout', out_data) == False:
439-
return test_fail(desc['_test-name'], "Stdout mismatch")
440+
return test_fail(desc['_test-name'], "stdout mismatch")
440441
else:
441442
stdout = ""
442443
elif 'stderr' in t:
@@ -449,17 +450,17 @@ def test_run(desc):
449450
if f:
450451
out_data = f_pat.sub(f_sub, out_data, 0)
451452
if cmp_std(match, match_data, 'stderr', out_data) == False:
452-
return test_fail(desc['_test-name'], "Stderr mismatch")
453+
return test_fail(desc['_test-name'], "stderr mismatch")
453454
else:
454455
stderr = ""
455456

456457
if stdout != "":
457458
show_std("stdout", stdout)
458-
return test_fail(desc['_test-name'], "Stdout is not empty")
459+
return test_fail(desc['_test-name'], "stdout is not empty")
459460

460461
if stderr != "":
461462
show_std("stderr", stderr)
462-
return test_fail(desc['_test-name'], "Stderr is not empty")
463+
return test_fail(desc['_test-name'], "stderr is not empty")
463464

464465
return test_pass(desc['_test-name'])
465466

travis/test/align13.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"id": "align13",
55
"format": "bin",
66
"source": "align13.asm",
7-
"option": "-Ox -o align13.bin",
7+
"option": "-Ox",
88
"target": [
99
{ "stderr": "align13.stderr" }
1010
],
@@ -13,13 +13,13 @@
1313
{
1414
"description": "Test of non-power-of-2 alignment (-O1)",
1515
"ref": "align13",
16-
"option": "-O1 -o align13.bin",
16+
"option": "-O1",
1717
"update": "false"
1818
},
1919
{
2020
"description": "Test of non-power-of-2 alignment (-O0)",
2121
"ref": "align13",
22-
"option": "-O0 -o align13.bin",
22+
"option": "-O0",
2323
"update": "false"
2424
}
2525
]

travis/test/align13s.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"id": "align13s",
55
"format": "bin",
66
"source": "align13s.asm",
7-
"option": "-Ox -o align13s.bin",
7+
"option": "-Ox",
88
"target": [
99
{ "stderr": "align13s.stderr" }
1010
],
@@ -13,13 +13,13 @@
1313
{
1414
"description": "Test of non-power-of-2 smart-alignment (-O1)",
1515
"ref": "align13s",
16-
"option": "-O1 -o align13s.bin",
16+
"option": "-O1",
1717
"update": "false"
1818
},
1919
{
2020
"description": "Test of non-power-of-2 smart-alignment (-O0)",
2121
"ref": "align13s",
22-
"option": "-O0 -o align13s.bin",
22+
"option": "-O0",
2323
"update": "false"
2424
}
2525
]

travis/test/br2222615.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{
1313
"description": "Test br2222615 (err)",
1414
"ref": "br2222615",
15-
"option": "-DERROR -o br2222615.bin",
15+
"option": "-DERROR",
1616
"target": [
1717
{ "stderr": "br2222615.stderr" }
1818
],

travis/test/br3392392.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{
1313
"description": "Test br3392392 (error)",
1414
"ref": "br3392392",
15-
"option": "-DERROR -o br3392392.bin",
15+
"option": "-DERROR",
1616
"target": [
1717
{ "stderr": "br3392392.stderr" }
1818
],

travis/test/br3392528.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"id": "br3392528",
55
"format": "bin",
66
"source": "br3392528.asm",
7-
"option": "-Ox -o br3392528.bin",
7+
"option": "-Ox",
88
"target": [
99
{ "stderr": "br3392528.stderr" }
1010
],

travis/test/br3392707.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{
1414
"description": "Test br3392707 (error)",
1515
"ref": "br3392707",
16-
"option": "-o br3392707.bin -DERROR -Ox",
16+
"option": "-DERROR -Ox",
1717
"target": [
1818
{ "stderr": "br3392707-error.stderr" }
1919
],

travis/test/expimp.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{
2323
"description": "Test of explicitly and implicitly sized operands (-Ox)",
2424
"ref": "expimp",
25-
"option": "-Ox -DERROR -o expimp-ox-error.bin",
25+
"option": "-Ox -DERROR",
2626
"target": [
2727
{ "stderr": "expimp-ox-error.stderr" }
2828
],
@@ -31,7 +31,7 @@
3131
{
3232
"description": "Test of explicitly and implicitly sized operands (-O0 error)",
3333
"ref": "expimp",
34-
"option": "-O0 -DERROR -o expimp-o0-error.bin",
34+
"option": "-O0 -DERROR",
3535
"target": [
3636
{ "stderr": "expimp-o0-error.stderr" }
3737
],

travis/test/fwdoptpp.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{
2222
"description": "Test error directive",
2323
"ref": "fwdoptpp",
24-
"option": "-O0 -DERROR -o fwdoptpp.null.bin",
24+
"option": "-O0 -DERROR",
2525
"target": [
2626
{ "stderr": "fwdoptpp.error.stderr" }
2727
],
@@ -30,7 +30,7 @@
3030
{
3131
"description": "Test fatal directive",
3232
"ref": "fwdoptpp",
33-
"option": "-O0 -DFATAL -o fwdoptpp.null.bin",
33+
"option": "-O0 -DFATAL",
3434
"target": [
3535
{ "stderr": "fwdoptpp.fatal.stderr" }
3636
],

0 commit comments

Comments
 (0)