Mercurial > nand-ecoscentric
changeset 1704:fe5ff0959ecd
Make the testcase work on big-endian as well as little-endian systems,
plus some minor clean-ups.
| author | bartv |
|---|---|
| date | Sun, 08 Aug 2004 21:23:39 +0000 |
| parents | 81766aaddf79 |
| children | ffd21edfae82 |
| files | packages/fs/rom/current/ChangeLog packages/fs/rom/current/cdl/romfs.cdl packages/fs/rom/current/tests/fileio1.c |
| diffstat | 3 files changed, 45 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/fs/rom/current/ChangeLog +++ b/packages/fs/rom/current/ChangeLog @@ -1,3 +1,17 @@ +2004-08-08 Bart Veer <bartv@ecoscentric.com> + + * cdl/romfs.cdl: generate both little-endian and big-endian image + files. + + * tests/fileio1.c: include either a little-endian or a big-endian + image. Totally fail the test early on if the file system cannot be + mounted. + +2004-06-14 John Dallaway <jld@ecoscentric.com> + + * cdl/romfs.cdl: Specify the test executable file name for + compatibility with the eCos Configuration Tool. + 2004-02-20 Vincent Catros <Vincent.Catros@elios-informatique.fr> * src/fs-ecos.c :
--- a/packages/fs/rom/current/cdl/romfs.cdl +++ b/packages/fs/rom/current/cdl/romfs.cdl @@ -68,7 +68,7 @@ cdl_package CYGPKG_FS_ROM { # Tests cdl_component CYGTST_ROMFS_BUILD_TESTS { - display "Build ROMFS tests" + display "Build ROM filesystem tests" flavor bool no_define default_value 0 @@ -76,7 +76,7 @@ cdl_package CYGPKG_FS_ROM { requires CYGINT_ISO_STDIO_FORMATTED_IO requires CYGINT_ISO_STRERROR description " - This option enables the building of the ROMFS tests." + This option enables the building of the ROM filesystem tests." # FIXME: host compiler/flags should be provided by config system make -priority 100 { @@ -86,24 +86,34 @@ cdl_package CYGPKG_FS_ROM { } make -priority 100 { - <PREFIX>/include/cyg/romfs/testromfs.h : $(PREFIX)/bin/mk_romfs <PACKAGE>/support/file2c.tcl - $(PREFIX)/bin/mk_romfs $(REPOSITORY)/$(PACKAGE)/tests/testromfs testromfs.bin + <PREFIX>/include/cyg/romfs/testromfs_le.h : $(PREFIX)/bin/mk_romfs <PACKAGE>/support/file2c.tcl + $(PREFIX)/bin/mk_romfs $(REPOSITORY)/$(PACKAGE)/tests/testromfs testromfs_le.bin @mkdir -p "$(dir $@)" # work around cygwin path problems by copying to build dir @cp $(REPOSITORY)/$(PACKAGE)/support/file2c.tcl . - sh file2c.tcl testromfs.bin testromfs.h + sh file2c.tcl testromfs_le.bin testromfs_le.h @rm -f $@ file2c.tcl - @cp testromfs.h $@ + @cp testromfs_le.h $@ } + make -priority 100 { + <PREFIX>/include/cyg/romfs/testromfs_be.h : $(PREFIX)/bin/mk_romfs <PACKAGE>/support/file2c.tcl + $(PREFIX)/bin/mk_romfs -b $(REPOSITORY)/$(PACKAGE)/tests/testromfs testromfs_be.bin + @mkdir -p "$(dir $@)" + # work around cygwin path problems by copying to build dir + @cp $(REPOSITORY)/$(PACKAGE)/support/file2c.tcl . + sh file2c.tcl testromfs_be.bin testromfs_be.h + @rm -f $@ file2c.tcl + @cp testromfs_be.h $@ + } cdl_option CYGPKG_FS_ROM_TESTS { - display "ROM FS tests" + display "ROM filesystem tests" flavor data no_define - calculated { "tests/fileio1.c" } + calculated { "tests/fileio1" } description " - This option specifies the set of tests for the ROM FS package." + This option specifies the set of tests for the ROM filesystem package." } } }
--- a/packages/fs/rom/current/tests/fileio1.c +++ b/packages/fs/rom/current/tests/fileio1.c @@ -66,10 +66,17 @@ #include <cyg/fileio/fileio.h> +#include <cyg/infra/cyg_type.h> #include <cyg/infra/testcase.h> #include <cyg/infra/diag.h> // HAL polled output -#include <cyg/romfs/testromfs.h> // Test ROMFS data +// Test ROMFS data. Two example data files are generated so that +// the test will work on both big-endian and little-endian targets. +#if (CYG_BYTEORDER == CYG_LSBFIRST) +# include <cyg/romfs/testromfs_le.h> +#else +# include <cyg/romfs/testromfs_be.h> +#endif //========================================================================== @@ -288,7 +295,10 @@ int main( int argc, char **argv ) diag_printf("<INFO>: cd /etc\n" ); err = chdir( "/etc" ); - if ( err < 0 ) SHOW_RESULT( chdir, err ); + if ( err < 0 ) { + SHOW_RESULT( chdir, err ); + CYG_TEST_FAIL_FINISH("fileio1"); + } diag_printf("<INFO>: ROMFS list of '' follows\n"); listdir( "", true );
