List of commits:
Subject Hash Author Date (UTC)
prettier c0a36395356a8e6b165785b5e2dd5486fa22206d Ubuntu 2020-03-30 04:06:19
fix shit 4e786cec2b361164d67318fb9bc4d3e16b5e3156 Ubuntu 2020-03-30 02:55:58
color output 79515e592fad2cee9a985e0050969f6901451e93 Ubuntu 2020-03-30 02:42:46
output 6eec625ecbd51533330d2a1b618d28a433ae1ee4 Ubuntu 2020-03-30 02:37:25
works 1ee1f753c7dc99e4a91665d48ba7d60fd731b138 Ubuntu 2020-03-30 02:33:45
running test 08bdfaabe6111f35074dc1af59197fcc3af7ae3c Ubuntu 2020-03-30 02:23:19
building 249893d05180fa7cd770c22cef1714cc89c4318b Ubuntu 2020-03-30 02:17:05
cleanup 8750a7302fd91be1b984857bbdcd284470545ba2 Ubuntu 2020-03-30 01:16:21
project and common option 58a8a91e410978a52592952951bb6b24fe76964a Ubuntu 2020-03-30 01:12:45
use minimist 16d617198ccd8304ab324fc3989d60bb97177cca Ubuntu 2020-03-30 01:09:25
works with clang++ and g++ (on circuit) 8802dd772799132ab0c6502c1e079bc44365ad3e Ubuntu 2020-03-30 01:03:14
cleanup 45c9d366a75cbff5930fe51189140210835a6337 Ubuntu 2020-03-30 00:26:01
example works 8ed5b07157cd0b49b147939ba7a99f339a9c2d0f Ubuntu 2020-03-29 16:45:36
filtering out header files 22bafc763385d5b5759b924ac07f2474b4692e8b Ubuntu 2020-03-29 12:22:40
Revert "just include source" 3d420145117a1ea5404972165dca26ca0135f70e Ubuntu 2020-03-29 12:04:38
just include source 9d18479598ad88e5bae0d0a8e8bfe0009b47d5cf Ubuntu 2020-03-29 05:19:00
assert 6ba991dbb9b5606355f73c71fca85d80bd169bf9 Ubuntu 2020-03-29 04:59:45
cleanup f5cbde963e841bf63f51cc28ec389b6580345ed3 Ubuntu 2020-03-29 04:42:07
deepmerge aee7de1ccef07d1162231fad345a1dc1513452fb Ubuntu 2020-03-29 04:39:34
init e6d74419d4aaaa415732b596065b2f5cd67d66ef Ubuntu 2020-03-28 22:44:10
Commit c0a36395356a8e6b165785b5e2dd5486fa22206d - prettier
Author: Ubuntu
Author date (UTC): 2020-03-30 04:06
Committer name: Ubuntu
Committer date (UTC): 2020-03-30 04:06
Parent(s): 4e786cec2b361164d67318fb9bc4d3e16b5e3156
Signing key:
Tree: 5b6c8e6da838570bebc0b754955716ee3f596bee
File Lines added Lines deleted
README.md 1 0
index.js 80 64
package-lock.json 5 0
package.json 1 0
File README.md changed (mode: 100644) (index 96f183b..0563d0f)
1 1 clang++ $(ccargs -p ../circuit/test/test.json -c) clang++ $(ccargs -p ../circuit/test/test.json -c)
2 ccargs -p ../circuit/test/test.json -c -t
File index.js changed (mode: 100755) (index 0bf147e..c80ecb3)
1 1 #!/usr/bin/env node #!/usr/bin/env node
2 2
3 const fs = require('fs'),
4 path = require('path'),
5 tmp = require('tmp'),
6 shell = require( 'shelljs' ),
7 cursor = require('ansi')(process.stdout),
8 argv = require('minimist')(process.argv.slice(2)),
3 const fs = require("fs"),
4 path = require("path"),
5 tmp = require("tmp"),
6 shell = require("shelljs"),
7 cursor = require("ansi")(process.stdout),
8 argv = require("minimist")(process.argv.slice(2)),
9 9 defPath = argv.p ? argv.p : argv.project; defPath = argv.p ? argv.p : argv.project;
10 10
11 let assertionsPassed = 0;
12 if (argv.test || argv.t) {
13 console.time("total");
14 process.on("exit", () => {
15 console.log(`assertions passed: ${assertionsPassed}`);
16 cursor.green();
17 console.timeEnd("total");
18 cursor.reset();
19 });
20 }
21
22 processDef(defPath);
11 23
12 readDef(defPath)
13 .then(obj => {
14 readDef(path.join(__dirname, 'asserter/def.json'))
15 .then(obj2 => {
16 let result = [obj, obj2].join(' ');
17 if (argv.common || argv.c) {
18 result += ' -pthread -DTARGET_TEST=1';
19 }
20 if (argv.test || argv.t) {
21 console.time('total');
22 process.on('exit', () => {
23 cursor.green();
24 console.timeEnd('total');
25 cursor.reset();
26 });
27 let compiler = 'g++';
28 if (argv.clang || argv.llvm) {
29 compiler = "clang++";
30 } else if (argv.emcc) {
31 compiler = "emcc";
24 function processDef(defPath) {
25 console.log("processing ", defPath);
26 readDef(defPath).then((obj) => {
27 readDef(path.join(__dirname, "asserter/def.json")).then((obj2) => {
28 let result = [obj, obj2].join(" ");
29 if (argv.common || argv.c) {
30 result += " -pthread -DTARGET_TEST=1";
32 31 } }
33 tmp.dir((err, tmpDir) => {
34 if (err) throw err;
35 const execFile = path.join(tmpDir, 'test');
36 console.log( 'test directory:', tmpDir );
37 result = `${compiler} ${result} -o ${execFile}`;
38 if (argv.verbose || argv.v) {
39 console.log(result);
32 if (argv.test || argv.t) {
33 let compiler = "g++";
34 if (argv.clang || argv.llvm) {
35 compiler = "clang++";
36 } else if (argv.emcc) {
37 compiler = "emcc";
40 38 } }
41 shell.exec(result);
42 shell.exec('./test', {cwd:tmpDir});
43 fs.readFile(path.join(tmpDir, 'result.json'), 'utf8', (err, result) => {
44 if (err) throw err;
45 const resultObj = JSON.parse(result);
46 console.log(`assertions passed: ${resultObj.passed}`);
47 });
48 });
49 }
50 else {
51 console.log( result );
52 }
39 tmp.dir((err, tmpDir) => {
40 if (err) throw err;
41 const execFile = path.join(tmpDir, "test");
42 console.log("test directory:", tmpDir);
43 result = `${compiler} ${result} -o ${execFile}`;
44 if (argv.verbose || argv.v) {
45 console.log(result);
46 }
47 shell.exec(result);
48 shell.exec("./test", { cwd: tmpDir });
49 fs.readFile(
50 path.join(tmpDir, "result.json"),
51 "utf8",
52 (err, result) => {
53 if (!err) {
54 const resultObj = JSON.parse(result);
55 assertionsPassed += resultObj.passed;
56 }
57 }
58 );
59 });
60 } else {
61 console.log(result);
62 }
63 });
53 64 }); });
54 });
55
56 function readDef(defFile) {
65 }
66
67 function readDef(defFile) {
57 68 return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
58 const base = path.dirname(defFile);
59 fs.readFile(defFile, 'utf8', (err, def) => {
69 const base = path.dirname(defFile);
70 fs.readFile(defFile, "utf8", (err, def) => {
60 71 if (err) throw err; if (err) throw err;
61 const {includes, sources} = JSON.parse(def);
72 const { includes, sources, tests } = JSON.parse(def);
62 73 let result = `-isystem ${base} `; let result = `-isystem ${base} `;
63 74 if (sources) { if (sources) {
64 result += sources.filter( entry => {
65 return path.extname(entry).match(/c|cpp/);
66 })
67 .map( entry => {
68 return path.join(base, entry);
69 }).join(' ');
75 result += sources
76 .filter((entry) => {
77 return path.extname(entry).match(/c|cpp/);
78 })
79 .map((entry) => {
80 return path.join(base, entry);
81 })
82 .join(" ");
70 83 } }
71 84 if (includes) { if (includes) {
72 const batch = includes.map( entry => {
73 return readDef(path.join(base, entry));
85 const batch = includes.map((entry) => {
86 return readDef(path.join(base, entry));
74 87 }); });
75 Promise.all(batch).then( results => {
76 resolve(result + ' ' + results.join(' '));
77 });
78 }
79 else {
88 Promise.all(batch).then((results) => {
89 resolve(result + " " + results.join(" "));
90 });
91 } else if (tests) {
92 for (let test of tests) {
93 processDef(path.join(base, test));
94 }
95 } else {
80 96 resolve(result); resolve(result);
81 97 } }
82 98 }); });
File package-lock.json changed (mode: 100644) (index 3e47473..0037a3c)
96 96 "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
97 97 "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
98 98 }, },
99 "prettier": {
100 "version": "2.0.2",
101 "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.2.tgz",
102 "integrity": "sha512-5xJQIPT8BraI7ZnaDwSbu5zLrB6vvi8hVV58yHQ+QK64qrY40dULy0HSRlQ2/2IdzeBpjhDkqdcFBnFeDEMVdg=="
103 },
99 104 "rechoir": { "rechoir": {
100 105 "version": "0.6.2", "version": "0.6.2",
101 106 "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
File package.json changed (mode: 100644) (index d6451ac..70449d3)
12 12 "dependencies": { "dependencies": {
13 13 "ansi": "^0.3.1", "ansi": "^0.3.1",
14 14 "minimist": "^1.2.5", "minimist": "^1.2.5",
15 "prettier": "^2.0.2",
15 16 "shelljs": "^0.8.3", "shelljs": "^0.8.3",
16 17 "tmp": "^0.1.0" "tmp": "^0.1.0"
17 18 }, },
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/mucbuc/ccargs

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/mucbuc/ccargs

Clone this repository using git:
git clone git://git.rocketgit.com/user/mucbuc/ccargs

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main