Commit Graph

277 Commits

Author SHA1 Message Date
Jeremiah Orians 46cf81af83
Replace file_print with fputs 2021-04-03 18:56:55 -04:00
Jeremiah Orians b0b440c2df
Update M2libc to fix fflushing of buffers at exit or return from main 2021-02-21 21:00:34 -05:00
Jeremiah Orians 163dab268c
Merge remote-tracking branch 'deesix/TMP' 2021-02-17 23:01:23 -05:00
Jeremiah Orians 37ca8e3df9
Remove test/common_x86 files and switch x86 to M2libc 2021-02-17 22:01:28 -05:00
Jeremiah Orians 5f8484e683
Move self-hosting test to use M2libc 2021-02-17 21:40:59 -05:00
Jeremiah Orians 32ef09f964
Update M2libc and update known_issues.org 2021-02-06 13:40:28 -05:00
Jeremiah Orians fc4c1998aa
Remove test/common_knight/ files and switch knight-posix to M2libc 2021-02-06 00:45:32 -05:00
Jeremiah Orians a9d88e8e6c
Add support for -D variable and -D variable=value 2021-02-05 21:34:00 -05:00
Jeremiah Orians 8007ae9ce6
Add support for #if defined(__M2__) to enable M2-Planet specific functionality 2021-02-05 20:39:54 -05:00
Jeremiah Orians 62eedce858
Remove test/common_aarch64 files and switch AArch64 to M2libc 2021-02-05 15:54:38 -05:00
Jeremiah Orians a65619dbf4
Remove test/common_knight/*native files and switch knight-native to M2libc 2021-02-03 19:47:18 -05:00
Jeremiah Orians ba1fc44f29
Remove test/common_armv7l files and switch armv7l to M2libc 2021-02-03 07:30:15 -05:00
Jeremiah Orians 695672985e
Remove test/common_amd64 files and switch amd64 to M2libc 2021-02-03 00:32:47 -05:00
Jeremiah Orians 6f8e2eb905
Removed need for fixup 2021-02-02 23:39:27 -05:00
deesix 17c4c6b977 @@@ tests: -e (errexit) shell option in scripts, where possible
Some test scripts run programs that return non-zero values for correct
outcome; those would fail the shell -e checks.

But some scripts not using -e are fine with it because we expect zero or
the error condition is handled otherwise. So, for robustness, the option is
added into them.
2021-01-31 00:00:00 +01:00
deesix cb27e5314a @@@ remove scripts 2021-01-31 00:00:00 +01:00
deesix dd67ccddce @@@ ARCH_IS_64_BITS
In three scripts, we need to adjust the expected value check depending on
the word size of the arch.

We do it based on a this new var.
2021-01-31 00:00:00 +01:00
deesix 3400296b9b @@@ BLOOD_ELF_WORD_SIZE_FLAG 2021-01-31 00:00:00 +01:00
deesix 05d962fcfc @@@ unify 64 bits archs (run_test.sh) 2021-01-31 00:00:00 +01:00
deesix fb5bae96ab @@@ tests: source new test/env.inc.sh
... which sets, given the ARCH, the following vars:

 BASE_ADDRESS
 ENDIANNESS_FLAG
2021-01-31 00:00:00 +01:00
deesix ab055a8823 @@@ tests: ARCH var in non-Knight scripts 2021-01-31 00:00:00 +01:00
deesix 6bb784eae5 tests: minor tweaks in comments 2021-01-31 00:00:00 +01:00
deesix f865e47646 @@@ tests: aarch64 test0100 using debug ELF header
It was using the non-debug one but the rest of the compilation chain is
done with debug in mind.
2021-01-31 00:00:00 +01:00
deesix 1a9bbe6e63 @@@ tests: same --debug behaviour for all scripts of the same test
Until now, a few scripts compiled the test program with/without debug,
differently to the rest.
2021-01-31 00:00:00 +01:00
Jeremiah Orians c5068b227a
Add support for &global_variable 2021-01-28 22:22:08 -05:00
Jeremiah Orians 2043a574c9
Enable virtualization of bare metal binaries 2021-01-27 20:42:42 -05:00
deesix 548993a884 tests: use new-style mescc-tools flags
This completes the transition started in Knight scripts during their M2libc
migration at f2094a9e5b

from           : to

--BaseAddress  : --base-address
--BigEndian    : --big-endian
--LittleEndian : --little-endian

The plan for mescc-tools is to deprecate the old (pre-1.0.0) flags.

Note that test0101 compiles "hex2 0.3" and verifies that it works by
linking an example. This 0.3 version requires the old-style flags, so the
calls to test/results/test0101-*-binary are left unchanged.
2021-01-23 00:00:00 +01:00
deesix ae897dcfdb tests: no --exec_enable in hex2 calls because it's "Effectively a NOP"
hex2 in mescc-tools defaults to executable output file since 1.0.0.

See 0a553f720d39dae4231611671e4163a2d2422e0a there.

This completes the removal started in Knight scripts during their M2libc
migration at f2094a9e5b

Note that test0101 compiles "hex2 0.3" and verifies that it works by
linking an example. Calls to test/results/test0101-*-binary never used the
flag because we don't call the linked example (we just check its SHA-256).
2021-01-23 00:00:00 +01:00
deesix 52b638f48f tests: prettier scripts
One line per flag for multi-line "Verify that the resulting file works"
calls; for coherency with 3aa8327334
2021-01-23 00:00:00 +01:00
Jeremiah Orians f2094a9e5b
Migrate knight-posix to M2libc 2021-01-22 00:35:43 -05:00
Jeremiah Orians 3c6b23f734
Update M2libc to remove duplicate opens 2021-01-21 22:41:23 -05:00
Jeremiah Orians 5dd81d871e
Updated Documentation to reflect new M2libc changes 2021-01-21 18:37:59 -05:00
deesix 818784228c Use M2libc in all x86 tests < test1000 2021-01-21 00:00:00 +01:00
deesix e660caca73 Use M2libc in all armv7l tests < test1000 2021-01-21 00:00:00 +01:00
deesix 7860378b75 Use M2libc in all amd64 tests < test1000 2021-01-21 00:00:00 +01:00
deesix 55db771e29 tests: get proof from test0025 stderr (and other minor fixes)
We were checking an empty proof because the test writes to stderr and we
were redirecting stdout to the file. With the correct redirection the hash
is different, so proof.answer is also adjusted.

The x86 test was calling blood-elf with the 64bits flag. Removed to ask for
32bits behaviour.

For consistency, --BaseAddress is now using the usual value for the arch.

Also, unused input file is removed here.
2021-01-17 00:00:00 +01:00
deesix e9553d5f13 M2libc with standard architecture naming
Every AArch64 test script is affected because AArch64 -> aarch64. test0101
needs i386 -> x86 because it verifies the resulting AArch64 binary (hex2)
creating some x86 proof.

Also, a couple of x86 tests (test0000 and test0025) that are M2libc aware,
again because i386 -> x86 (hex2 ELF parts).
2021-01-16 00:00:00 +01:00
deesix bcd0f49859 Use M2libc in all AArch64 tests < test1000
Finally test0021, now that M2libc has getcwd.

See b83086642e
2021-01-15 00:00:00 +01:00
Jeremiah Orians 204d2612d7 whitespace 2021-01-12 02:57:35 +01:00
Jeremiah Orians f5f996626a tests: --output-sync for readability 2021-01-12 02:57:35 +01:00
Jeremiah Orians d34bb92b0d tests: workaround parallel clean/test make error
Something weird happens if one tries to clean and test at the same time
with a command like:

make clean test -j2

See https://lists.gnu.org/archive/html/help-make/2021-01/msg00000.html

To be safe until further investigation, we breakup the makefile into 2
files and serialize the first where M2-Planet is built.
2021-01-12 02:57:35 +01:00
deesix 9f26dbcc68 tests: support for make -j
For any test there's a directory with a script for each architecture.

These scripts generate intermediate files in the dir during compilation,
with the same names no matter the arch. So if one tries to execute the
scripts in parallel they all fight for the files.

To allow for parallel testing, now we create a temporal dir named after
the arch to isolate the intermediate files. Scripts are patched
accordingly.

This also allows easier clean-up: now, removing the temporal dirs is
almost all that we need (and the per-test .gitignore files are replaced
with a couple of lines in test/.gitignore). A common script replaces
the per-test cleanup.sh. It gets the number of the test as an argument
and takes care of some minor special cases. The makefile is adapted to
use this new test/cleanup_test.sh script.

Those special files are created during the last stage of each test, but
only if the host arch matches the test. They're _not_ isolated here
because it's harder (due to how we do the checksum) and they cannot
collide unless emulation is used and several calls to make are made at
the same time.
2021-01-12 00:00:00 +01:00
deesix 3aa8327334 tests: prettier scripts
One line per flag for the major calls. This simplifies a bit the automated
patching for parallel testing that comes next.
2021-01-12 00:00:00 +01:00
Jeremiah Orians 4def464475
Merge remote-tracking branch 'yt/array' 2021-01-10 20:07:38 -05:00
Jeremiah Orians 768f229c1d
Updated M2libc 2021-01-10 18:29:28 -05:00
Sanne Wouda 0e3d5b609a Add support for global char foo[12]; definitions
- only enabled in --bootstrap-mode

- allocates space for both the char array and the pointer to the start of
  the array
2021-01-10 23:01:08 +00:00
Sanne Wouda b83086642e Use M2libc in nearly all AArch64 tests
- disables --bootstrap-mode where it was enabled, except for test1000
  which needs to build in bootstrap-mode to check that M2-Planet can be
  compiled by cc_*

- the only hold-out is test0021 which needs getcwd which is missing in
  M2libc

- note that test0106 needs a fix to fgetc or it will never notice it has
  reached the end of stdin
2021-01-10 22:02:29 +00:00
Jeremiah Orians 674a6f5569
Update M2libc to working standard 2021-01-10 12:55:51 -05:00
Sanne Wouda dd1f5db9f1 Port AArch64 test0008 to M2libc 2021-01-10 17:50:04 +00:00
Jeremiah Orians bb3b4eebd8
Upgrade M2libc to include armv7l and prototype AArch64 2021-01-10 12:16:22 -05:00