Convert more tests to new build.

This commit is contained in:
Brad Nelson
2024-01-15 11:37:13 -08:00
parent b5aec80fd2
commit 8aff943a00
5 changed files with 33 additions and 4 deletions

View File

@ -498,6 +498,10 @@ def Command(target, source, command, implicit=[], pool=None):
return target
def TestCommand(*args, **kwargs):
return Command(*args, **kwargs)
def Publish(target, source, pubpath):
global output
implicit = ' '.join([

View File

@ -56,14 +56,17 @@ ESP32_FILES += [
ESP32_FILES += [
Compile('$dst/esp32-sim/Esp32forth-sim', '$src/esp32/sim_main.cpp',
implicit=['$dst/gen/esp32_boot.h', '$dst/gen/esp32_sim_opcodes.h']),
Command('$dst/esp32-sim/sizes.txt',
' '.join(['$dst/esp32-sim/Esp32forth-sim', '$src/tools/memuse.py']),
'echo internals size-all bye | $dst/esp32-sim/Esp32forth-sim | '
'$src/tools/memuse.py >$dst/esp32-sim/sizes.txt'),
TestCommand('$dst/esp32-sim/sizes.txt',
' '.join(['$dst/esp32-sim/Esp32forth-sim', '$src/tools/memuse.py']),
'echo internals size-all bye | $dst/esp32-sim/Esp32forth-sim | '
'$src/tools/memuse.py >$dst/esp32-sim/sizes.txt'),
ForthTest('$dst/tests/esp32_sim_all_tests.out',
'$dst/esp32-sim/Esp32forth-sim', '$src/esp32/esp32_all_tests.fs',
interp=('echo "include $src/esp32/esp32_all_tests.fs \\n1 terminate" | '
'$dst/esp32-sim/Esp32forth-sim')),
TestCommand('$dst/tests/esp32_sim_see_all_test.out',
'$dst/esp32-sim/Esp32forth-sim',
'echo internals see-all bye | $dst/esp32-sim/Esp32forth-sim 2>&1 | cat >$dst/tests/esp32_sim_see_all_test.out'),
]
Compile('$dst/gen/print-esp32-builtins', '$src/esp32/print-builtins.cpp'),
Run('$dst/gen/esp32_sim_opcodes.h', '$dst/gen/print-esp32-builtins')

View File

@ -19,6 +19,17 @@ Compile('$dst/posix/ueforth', '$src/posix/main.c',
Alias('posix', ' '.join([
ForthTest('$dst/tests/posix_all_tests.out',
'$dst/posix/ueforth', '$src/common/all_tests.fs'),
TestCommand('$dst/tests/posix_see_all_test.out',
'$dst/posix/ueforth',
'echo internals see-all bye | $dst/posix/ueforth 2>&1 | '
'cat >$dst/tests/posix_see_all_test.out'),
TestCommand(' '.join(['$dst/tests/posix_save_restore_test.out',
'$dst/tests/posix_save_restore.bin']),
'$dst/posix/ueforth',
'echo ": foosquare dup * ; save $dst/tests/posix_save_restore.bin bye" | '
'$dst/posix/ueforth > $dst/tests/posix_save_restore_test.out && '
'echo "restore $dst/tests/posix_save_restore.bin 4 foosquare 16 <> posix sysexit" | '
'$dst/posix/ueforth >> $dst/tests/posix_save_restore_test.out'),
]))
OneShot('install',

View File

@ -27,3 +27,7 @@ if not source.strip().endswith('--> 123'):
print('MISSING EXPECTED OUTPUT')
print(source)
sys.exit(1)
if len(sys.argv) > 1:
with open(sys.argv[1], 'w') as fh:
fh.write(source)

View File

@ -31,6 +31,13 @@ WEB_ITEMS = [
Copy('$dst/web/script_lite_test.html', '$src/web/script_lite_test.html'),
Copy('$dst/web/script_test.html', '$src/web/script_test.html'),
Copy('$dst/web/script_test.fs', '$src/web/script_test.fs'),
TestCommand('$dst/tests/web_sanity_test.out',
' '.join([
'$dst/web/ueforth.js',
'$src/tools/check_web_sanity.py',
]),
'echo "120 3 + . cr bye" | ' + D8 + ' $dst/web/ueforth.js | '
'$src/tools/check_web_sanity.py $dst/tests/web_sanity_test.out'),
]
Alias('web', ' '.join(WEB_ITEMS))