ci: add valgrind check #5
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
					@ -12,6 +12,8 @@ using lt::test::expect_le;
 | 
				
			||||||
// <1us error margin is tested manually in release builds and it works fine.
 | 
					// <1us error margin is tested manually in release builds and it works fine.
 | 
				
			||||||
constexpr auto max_error_margin = std::chrono::milliseconds { 1 };
 | 
					constexpr auto max_error_margin = std::chrono::milliseconds { 1 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					volatile int *volatile global_leak {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
lt::test::Suite raii = [] {
 | 
					lt::test::Suite raii = [] {
 | 
				
			||||||
	using std::chrono::microseconds;
 | 
						using std::chrono::microseconds;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,8 +31,8 @@ lt::test::Suite raii = [] {
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int *leak = new int(42); // Allocated memory, never freed
 | 
						global_leak = new int(42); // Allocated memory, never freed
 | 
				
			||||||
	std::cout << "Hello, Valgrind!" << *leak << std::endl;
 | 
						std::cout << "Hello, Valgrind!" << *global_leak << std::endl;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
lt::test::Suite reset_and_elapsed_time = [] {
 | 
					lt::test::Suite reset_and_elapsed_time = [] {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue