enable aligning consecutive assignments

This commit is contained in:
Axel Kohlmeyer
2020-06-13 02:05:13 -04:00
parent 3db944decc
commit 9c3d108bbc
12 changed files with 328 additions and 302 deletions

View File

@ -2,6 +2,7 @@
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignConsecutiveAssignments: true
AlignEscapedNewlines: Left
AllowShortFunctionsOnASingleLine: Inline
AllowShortLambdasOnASingleLine: None

View File

@ -217,6 +217,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
{
// initialize system geometry
const char *args[] = {"AngleStyle", "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
LAMMPS *lmp = init_lammps(argc, argv, config);
@ -350,11 +351,13 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
TEST(AngleStyle, plain)
{
const char *args[] = {"AngleStyle", "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
::testing::internal::CaptureStdout();
LAMMPS *lmp = init_lammps(argc, argv, test_config, true);
std::string output = ::testing::internal::GetCapturedStdout();
if (verbose) std::cout << output;
@ -571,11 +574,13 @@ TEST(AngleStyle, omp)
if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP();
const char *args[] = {"AngleStyle", "-log", "none", "-echo", "screen", "-nocite",
"-pk", "omp", "4", "-sf", "omp"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
::testing::internal::CaptureStdout();
LAMMPS *lmp = init_lammps(argc, argv, test_config, true);
std::string output = ::testing::internal::GetCapturedStdout();
if (verbose) std::cout << output;
@ -736,6 +741,7 @@ TEST(AngleStyle, omp)
TEST(AngleStyle, single)
{
const char *args[] = {"AngleStyle", "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);

View File

@ -217,6 +217,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
{
// initialize system geometry
const char *args[] = {"BondStyle", "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
LAMMPS *lmp = init_lammps(argc, argv, config);
@ -350,11 +351,13 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
TEST(BondStyle, plain)
{
const char *args[] = {"BondStyle", "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
::testing::internal::CaptureStdout();
LAMMPS *lmp = init_lammps(argc, argv, test_config, true);
std::string output = ::testing::internal::GetCapturedStdout();
if (verbose) std::cout << output;
@ -571,11 +574,13 @@ TEST(BondStyle, omp)
if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP();
const char *args[] = {"BondStyle", "-log", "none", "-echo", "screen", "-nocite",
"-pk", "omp", "4", "-sf", "omp"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
::testing::internal::CaptureStdout();
LAMMPS *lmp = init_lammps(argc, argv, test_config, true);
std::string output = ::testing::internal::GetCapturedStdout();
if (verbose) std::cout << output;
@ -735,6 +740,7 @@ TEST(BondStyle, omp)
TEST(BondStyle, single)
{
const char *args[] = {"BondStyle", "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
@ -995,6 +1001,7 @@ TEST(BondStyle, single)
TEST(BondStyle, extract)
{
const char *args[] = {"BondStyle", "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);

View File

@ -12,6 +12,7 @@
------------------------------------------------------------------------- */
#include "error_stats.h"
#include "fmt/format.h"
#include <cmath>
#include <iostream>
#include <string>

View File

@ -216,6 +216,7 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
{
// initialize system geometry
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
LAMMPS *lmp = init_lammps(argc, argv, config);
@ -347,11 +348,13 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
TEST(PairStyle, plain)
{
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
::testing::internal::CaptureStdout();
LAMMPS *lmp = init_lammps(argc, argv, test_config, true);
std::string output = ::testing::internal::GetCapturedStdout();
if (verbose) std::cout << output;
@ -616,11 +619,13 @@ TEST(PairStyle, omp)
if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP();
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite",
"-pk", "omp", "4", "-sf", "omp"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
::testing::internal::CaptureStdout();
LAMMPS *lmp = init_lammps(argc, argv, test_config, true);
std::string output = ::testing::internal::GetCapturedStdout();
if (verbose) std::cout << output;
@ -780,11 +785,13 @@ TEST(PairStyle, intel)
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite",
"-pk", "intel", "0", "mode", "double", "omp",
"4", "lrt", "no", "-sf", "intel"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
::testing::internal::CaptureStdout();
LAMMPS *lmp = init_lammps(argc, argv, test_config);
std::string output = ::testing::internal::GetCapturedStdout();
if (verbose) std::cout << output;
@ -898,13 +905,15 @@ TEST(PairStyle, opt)
{
if (!LAMMPS::is_installed_pkg("OPT")) GTEST_SKIP();
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite", "-sf", "opt"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
if (!verbose) ::testing::internal::CaptureStdout();
LAMMPS *lmp = init_lammps(argc, argv, test_config);
std::string output;
if (!verbose) output = ::testing::internal::GetCapturedStdout();
std::string output = ::testing::internal::GetCapturedStdout();
if (verbose) std::cout << output;
if (!lmp) {
std::cerr << "One or more prerequisite styles with /opt suffix\n"
@ -994,6 +1003,7 @@ TEST(PairStyle, opt)
TEST(PairStyle, single)
{
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
@ -1231,6 +1241,7 @@ TEST(PairStyle, single)
TEST(PairStyle, extract)
{
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);