Skip to main content

A c/c++ cli

Project description

Clic

A cli tool for c/c++ development.

Requirements

First, you should clone [google/googletest] and install CMake in your local machine.

Install

$ pip install clic

How to use

After googletest installed, you need to export a environment GTEST_PATH in your bash config file (e.g .bashrc, .zshrc, etc).

$ clic mycpp
$ cd mycpp

$ tree -L 1
.
├── CMakeLists.txt
├── build
├── lib
├── solution.h
└── test.cpp

2 directories, 3 files

$ cd build
$ cmake .. && make
$ ./mycpp

❯ ./mycpp
Running main() from ~/mycpp/lib/googletest/googletest/src/gtest_main.cc
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from test
[ RUN      ] test.INIT
Hello mycpp
[       OK ] test.INIT (0 ms)
[----------] 1 test from test (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[  PASSED  ] 1 test.

If you don't want to export the GTEST_PATH environment, you can specify the path in the same command as follows:

$ GTEST_PATH=/path/to/cloned/googletest clic my-new-app
$ cd my-new-app

Now, Enjoy your simple c/c++ project. 😉

In the test.cpp file, you can write your tests.

#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include "solution.h"

#include <iostream>

TEST(test, INIT) {
    /* write your test */
}

and in the solution.h file you can write your solution.

#ifndef MY_SOLUTION__
#define MY_SOLUTION__

class Solution {
public:
    /* write your solution */
};

#endif /* ifndef MY_SOLUTION__ */

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clic-0.1.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file clic-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: clic-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for clic-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 20efa4134290a444bc778b6b715fc172af9d0393ac6dfb8a1ce2771b79720835
MD5 46b29a7325e86cee57afd0dc46d20389
BLAKE2b-256 7459f6f33fde2b61f11f707e08ad3e520acdf8eb71cd479b39489d27e243d528

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page