Skip to content

Commit

Permalink
default.nix: Test with -DLUA_USE_ASSERT and -Werror
Browse files Browse the repository at this point in the history
The standard test cases are all executed with VMs build with
-DLUA_USE_ASSERT. If the check argument is specified then the VM is
also built with -Werror to check for (fail on) compiler warnings.
  • Loading branch information
lukego committed Aug 14, 2018
1 parent 5d235e6 commit d3c149d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
let
callPackage = (pkgs.lib.callPackageWith { inherit pkgs source version; });
raptorjit = (callPackage ./raptorjit.nix {});
test = name: args: (callPackage ./test.nix { inherit raptorjit name args; });
raptorjit-assert = raptorjit.overrideAttrs(
old: { NIX_CFLAGS_COMPILE = " -DLUA_USE_ASSERT"; });
test = name: args: (callPackage ./test.nix { inherit name args; raptorjit = raptorjit-assert; });
check-generated-code = (callPackage ./check-generated-code.nix { inherit raptorjit; });
nowarnings = raptorjit.overrideAttrs(
old: { NIX_CFLAGS_COMPILE = "-Werror"; });
in

# Build RaptorJIT and run mulitple test suites.
Expand All @@ -27,5 +31,5 @@ in
test-O1 = test "O1" "-O1";
test-nojit = test "nojit" "-joff";
} //
(if check then { inherit check-generated-code; } else {})
(if check then { inherit nowarnings check-generated-code; } else {})

2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ NODOTABIVER= 51
# to slow down the C part by not omitting it. Debugging, tracebacks and
# unwinding are not affected -- the assembler part has frame unwind
# information and GCC emits it where needed (x64) or with -g (see CCDEBUG).
CCOPT= -O2 -fomit-frame-pointer -Werror
CCOPT= -O2 -fomit-frame-pointer
# Use this if you want to generate a smaller binary (but it's slower):
#CCOPT= -Os -fomit-frame-pointer
# Note: it's no longer recommended to use -O3 with GCC 4.x.
Expand Down

0 comments on commit d3c149d

Please sign in to comment.