2025-09-05 06:11:48 -06:00
2024-11-07 13:41:16 -07:00
2024-11-07 10:35:28 -07:00
2024-11-07 10:35:28 -07:00
2024-11-07 13:41:16 -07:00
2025-09-05 06:11:48 -06:00

fused-gtest

Warning

Unofficial single-source single-header for the googletest library.

Google removed support for generating a single-file googletest with version 1.12. This repository provides unofficial fused versions for releases after 1.11.

  1. Download the version you want from _generated
  2. Provide your own main function, something like this:
cat << 'EOF' >> main.cpp
#include <gtest/gtest.h>
int main(int argc, char **argv) {
  printf("Running main() from %s\n", __FILE__);
  testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}
EOF
  1. Compile together:
g++ --std=c++14 -I gtest-<version> main.cpp gtest-<version>/gtest-all.cc

Users should take care to respect the respective googletest licences (current version). The license for each release is included in this repository as well.

Description
Single-source / single-header google test files
Readme 1.1 MiB
Languages
C++ 99.8%
Python 0.2%