This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
romfs testcase patch
- From: Bart Veer <bartv at ecoscentric dot com>
- To: ecos-patches at ecos dot sourceware dot org
- Date: Sun, 8 Aug 2004 22:23:01 +0100 (BST)
- Subject: romfs testcase patch
A couple of minor changes related to the romfs test. The main one is
that this never actually worked on a big-endian system since the fs
image was only ever generated in little-endian format. Now the system
will invoke mk_romfs twice, once normally and once with the -b option,
and thus generate both big-endian and little-endian images. The
testcase will then pick up the appropriate one.
Bart
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/rom/current/ChangeLog,v
retrieving revision 1.14
diff -u -r1.14 ChangeLog
--- ChangeLog 9 Mar 2004 08:11:27 -0000 1.14
+++ ChangeLog 8 Aug 2004 21:17:26 -0000
@@ -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 :
Index: cdl/romfs.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/rom/current/cdl/romfs.cdl,v
retrieving revision 1.8
diff -u -r1.8 romfs.cdl
--- cdl/romfs.cdl 24 Feb 2003 14:22:28 -0000 1.8
+++ cdl/romfs.cdl 8 Aug 2004 21:18:20 -0000
@@ -68,7 +68,7 @@
# 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 @@
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 @@
}
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."
}
}
}
Index: tests/fileio1.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/rom/current/tests/fileio1.c,v
retrieving revision 1.4
diff -u -r1.4 fileio1.c
--- tests/fileio1.c 23 May 2002 23:01:40 -0000 1.4
+++ tests/fileio1.c 8 Aug 2004 21:21:43 -0000
@@ -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 @@
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 );