# Debug files
*.dSYM/
.rsconscache
+test_libc
+test_libc.exe
[submodule "modules/build-system"]
path = modules/build-system
url = https://github.com/mikedlowis/build-system.git
+[submodule "modules/atf"]
+ path = modules/atf
+ url = https://github.com/mikedlowis/atf.git
# Define the default compiler environment
main_env = BuildEnv.new do |env|
env["CFLAGS"] += ['-O3', '-Wall', '-Wextra', '--std=c99', '--pedantic']
- env["CPPPATH"] += Dir['source/']
+ env["CPPPATH"] += Dir['source/', 'modules/atf/source']
end
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
if Opts[:profile].include? "test"
# Do nothing for now
+ main_env.Program('test_libc', Dir["tests/**/*.c", "modules/atf/source/*.c"] + ['./libc.a'])
+ main_env.Command('Unit Tests', 'test_libc', "CMD" => './test_libc')
end
--- /dev/null
+Subproject commit 1105e4a88bbda546991da0314ba6060f9f624dba
--- /dev/null
+#include "libc.h"
+
+char* errstr = nil;
+
+static int exitcode(void)
+{
+ return errstr ? 1 : errno;
+}
+
+void exits(char* estr)
+{
+ errstr = estr;
+ exit(exitcode());
+}
+
*/
#include <stdio.h>
+#if 0
#define Bsize 8*1024
#define Bungetsize 4 /* space for ungetc */
#define Bmagic 0x314159
int ioungetrune(iobuf*);
long iowrite(iobuf*, void*, long);
int iovprint(iobuf*, char*, va_list);
+#endif
/*
* New Features
#define NO_MAIN_WRAPPER
#include "libc.h"
-char* errstr = nil;
-
-static int exitcode(void)
-{
- return errstr ? 1 : errno;
-}
-
-void exits(char* estr)
-{
- if (estr)
- errstr = estr;
- exit(exitcode());
-}
-
int main(int argc, char** argv)
{
user_main(argc, argv);
--- /dev/null
+#include "atf.h"
+#include "libc.h"
+
+void main(int argc, char** argv)
+{
+ (void)argc;
+ (void)argv;
+ RUN_EXTERN_TEST_SUITE(RefCount);
+ exit(PRINT_TEST_RESULTS());
+}
--- /dev/null
+// Unit Test Framework Includes
+#include "atf.h"
+
+// File To Test
+#include "libc.h"
+
+//-----------------------------------------------------------------------------
+// Begin Unit Tests
+//-----------------------------------------------------------------------------
+TEST_SUITE(RefCount) {
+}