Browse Source

Add `ODIN_TEST` constant for checking if `odin test` is being run

gingerBill 4 years ago
parent
commit
fa50c8d7d3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/checker.cpp

+ 1 - 0
src/checker.cpp

@@ -744,6 +744,7 @@ void init_universal(void) {
 	add_global_constant(str_lit("ODIN_DEFAULT_TO_NIL_ALLOCATOR"), t_untyped_bool, exact_value_bool(bc->ODIN_DEFAULT_TO_NIL_ALLOCATOR));
 	add_global_constant(str_lit("ODIN_USE_LLVM_API"), t_untyped_bool, exact_value_bool(bc->use_llvm_api));
 	add_global_constant(str_lit("ODIN_NO_DYNAMIC_LITERALS"), t_untyped_bool, exact_value_bool(bc->no_dynamic_literals));
+	add_global_constant(str_lit("ODIN_TEST"), t_untyped_bool, exact_value_bool(bc->command_kind == Command_test));
 
 
 // Builtin Procedures