]> git.mdlowis.com Git - projs/opts.git/commitdiff
Update rakefile to build tests and library. Also fixed a warning in the library
authorMichael D. Lowis <mike@mdlowis.com>
Tue, 15 Jul 2014 01:25:20 +0000 (21:25 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Tue, 15 Jul 2014 01:25:20 +0000 (21:25 -0400)
Rakefile
source/opts.c
source/opts.h

index 62f6cf78b43b7f880e3d430aceb9ca49d50521ff..9c69c307b934696e505af46b2020b93f0c01da9c 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -7,19 +7,21 @@ desc "Force the build to build in Posix mode"
 task(:posix){ is_windows = false }
 
 base = Rscons::Environment.new do |env|
-  #env["CFLAGS"] += ['-Wall', '-Werror']
+  env["CFLAGS"] += ['-Wall', '-Werror']
   env['CXXSUFFIX'] = '.cpp'
 end
 
-task :default => [:staticlib]
+task :default => [:test, :build]
 
 task :build => [:staticlib]
 
+desc "Run all unit tests"
 task :test => [:unittest_pp] do
     base.clone do |env|
-        env['CPPFLAGS'] << 'tools/UnitTest++/src/'
-        env.Program('build/test_libopts', Dir['source/**/*.{c,cpp}', "tests/**/*.{c,cpp}"])
-    end.process
+        env['CPPPATH'] += ['tools/UnitTest++/src/', 'source/']
+        env.Program('build/test_libopts', Dir['source/**/*.{c,cpp}', "tests/**/*.{c,cpp}", 'build/UnitTest++.a'])
+     end.process
+     sh "build/test_libopts"
 end
 
 desc "Build the OPTS static library"
index 1fd3314559956ff0d82a2a49e2d2010d007a528c..f4713b039b85fdf46836f8993115e652cff30d1a 100644 (file)
@@ -201,7 +201,7 @@ void OPTS_AddOption( Result_T* res, char* name, char* arg )
     }
 }
 
-char OPTS_ConsumeWhitespace( StreamContext_T* ctx )
+void OPTS_ConsumeWhitespace( StreamContext_T* ctx )
 {
     while( ' ' == ctx->current )
     {
index bfa9d166eae2c10f755a19bfa2d1fe59e782fdb8..e922db648a2984c3b3ea3af3925ebf4430b25d7c 100644 (file)
@@ -71,7 +71,7 @@ char* OPTS_NextToken( StreamContext_T* ctx );
 
 void OPTS_AddOption( Result_T* res, char* name, char* arg );
 
-char OPTS_ConsumeWhitespace( StreamContext_T* ctx );
+void OPTS_ConsumeWhitespace( StreamContext_T* ctx );
 
 char OPTS_NextCharacter( StreamContext_T* ctx );