aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2020-06-12 10:28:24 -0700
committerGitHub <noreply@github.com>2020-06-12 10:28:24 -0700
commit7a68538a09e1e0c56f936ccf20632314e74c10c0 (patch)
tree45f5c42abc2e827d706d77ca3b430e881f9a836e
parent79efeda18cc5aa79f2a4e4566f5a955327701296 (diff)
parentd34e18c39a3695b9c620e1b4ed509174784fee38 (diff)
downloadplatform_build_kati-7a68538a09e1e0c56f936ccf20632314e74c10c0.tar.gz
platform_build_kati-7a68538a09e1e0c56f936ccf20632314e74c10c0.tar.bz2
platform_build_kati-7a68538a09e1e0c56f936ccf20632314e74c10c0.zip
Merge pull request #196 from danw/githubactions
Switch from Travis to Github Actions
-rw-r--r--.github/workflows/cpp-ci.yml44
-rw-r--r--.travis.yml36
-rw-r--r--README.md2
-rw-r--r--affinity.cc4
-rwxr-xr-xclang-format-check3
-rw-r--r--eval.cc22
-rw-r--r--file_cache.h1
-rw-r--r--fileutil_bench.cc2
-rw-r--r--find_test.cc1
-rw-r--r--ninja_test.cc3
-rw-r--r--string_piece.cc4
-rw-r--r--testcase/empty_target_specific_var.mk2
-rw-r--r--testcase/empty_target_specific_var2.mk2
-rw-r--r--testcase/multiline_arg.mk2
-rwxr-xr-xtestcase/ninja_regen_filefunc_read.sh4
15 files changed, 66 insertions, 66 deletions
diff --git a/.github/workflows/cpp-ci.yml b/.github/workflows/cpp-ci.yml
new file mode 100644
index 0000000..c076cf1
--- /dev/null
+++ b/.github/workflows/cpp-ci.yml
@@ -0,0 +1,44 @@
+name: Build and Test
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ env:
+ CXX: clang++-9
+ CLANG_FORMAT: clang-format-9
+
+ steps:
+ - uses: actions/checkout@v2.2.0
+ - name: install ninja
+ run: |
+ mkdir -p ${GITHUB_WORKSPACE}/ninja-bin; cd ${GITHUB_WORKSPACE}/ninja-bin
+ wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip
+ unzip ninja-linux.zip
+ rm ninja-linux.zip
+ echo "::add-path::${GITHUB_WORKSPACE}/ninja-bin"
+ - name: make
+ run: make -j4 ckati ckati_tests
+ - name: clang format
+ run: ./clang-format-check
+ - name: run standalone tests
+ run: ruby runtest.rb -c
+ - name: run ninja tests
+ run: ruby runtest.rb -c -n
+ - name: run ninja all targets tests
+ run: ruby runtest.rb -c -n -a
+ - name: run ninja unit tests
+ run: ./ninja_test
+ - name: run stringpiece unit tests
+ run: ./string_piece_test
+ - name: run strutil unit tests
+ run: ./strutil_test
+ - name: run find unit tests
+ run: ./find_test
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index e2d9e21..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-language: cpp
-
-dist: trusty
-sudo: required
-
-compiler:
- - clang
-
-addons:
- apt:
- update: true
- sources:
- - ubuntu-toolchain-r-test
- - llvm-toolchain-trusty-7
- packages:
- - clang-7
- - clang-format-7
- - realpath
-
-cache: apt
-
-before_script:
- - wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip
- - unzip ninja-linux.zip -d ~/bin
-
-script:
- - export CXX=clang++-7
- - make -j4 ckati ckati_tests
- - ./clang-format-check
- - ruby runtest.rb -c
- - ruby runtest.rb -c -n
- - ruby runtest.rb -c -n -a
- - ./ninja_test
- - ./string_piece_test
- - ./strutil_test
- - ./find_test
diff --git a/README.md b/README.md
index 029a57d..ee8b51f 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
kati
====
-[![Build Status](https://travis-ci.org/google/kati.svg?branch=master)](http://travis-ci.org/google/kati)
+[![Build and Test](https://github.com/google/kati/workflows/Build%20and%20Test/badge.svg)](https://github.com/google/kati/actions)
kati is an experimental GNU make clone.
The main goal of this tool is to speed-up incremental build of Android.
diff --git a/affinity.cc b/affinity.cc
index 92320ee..9e855f3 100644
--- a/affinity.cc
+++ b/affinity.cc
@@ -21,12 +21,12 @@
#ifdef __linux__
-#include <random>
-
#include <sched.h>
#include <sys/types.h>
#include <unistd.h>
+#include <random>
+
void SetAffinityForSingleThread() {
cpu_set_t cs;
CPU_ZERO(&cs);
diff --git a/clang-format-check b/clang-format-check
index 7eaa1c2..c0a01f2 100755
--- a/clang-format-check
+++ b/clang-format-check
@@ -1,7 +1,6 @@
#!/usr/bin/env bash
-CLANG_FORMAT="clang-format-7"
-if [ -z "$(which $CLANG_FORMAT)" ]; then
+if [ -z "$CLANG_FORMAT" ]; then
CLANG_FORMAT="clang-format"
fi
diff --git a/eval.cc b/eval.cc
index aaad21f..3772763 100644
--- a/eval.cc
+++ b/eval.cc
@@ -300,26 +300,10 @@ void Evaluator::EvalRule(const RuleStmt* stmt) {
return;
}
- // "test: =foo" is questionable but a valid rule definition (not a
- // target specific variable).
- // See https://github.com/google/kati/issues/83
- string buf;
if (!separator_pos) {
- KATI_WARN_LOC(loc_,
- "defining a target which starts with `=', "
- "which is not probably what you meant");
- buf = after_targets.as_string();
- if (stmt->sep == RuleStmt::SEP_SEMICOLON) {
- buf += ';';
- } else if (stmt->sep == RuleStmt::SEP_EQ ||
- stmt->sep == RuleStmt::SEP_FINALEQ) {
- buf += '=';
- }
- if (stmt->rhs) {
- buf += stmt->rhs->Eval(this);
- }
- after_targets = buf;
- separator_pos = string::npos;
+ // We used to make this a warning and otherwise accept it, but Make 4.1
+ // calls this out as an error, so let's follow.
+ Error("*** empty variable name.");
}
Rule* rule = new Rule();
diff --git a/file_cache.h b/file_cache.h
index e344946..fac2077 100644
--- a/file_cache.h
+++ b/file_cache.h
@@ -16,7 +16,6 @@
#define FILE_CACHE_H_
#include <string>
-
#include <unordered_set>
using namespace std;
diff --git a/fileutil_bench.cc b/fileutil_bench.cc
index 367c125..429d004 100644
--- a/fileutil_bench.cc
+++ b/fileutil_bench.cc
@@ -15,7 +15,9 @@
// +build ignore
#include <benchmark/benchmark.h>
+
#include <cstdio>
+
#include "fileutil.h"
static void BM_RunCommand(benchmark::State& state) {
diff --git a/find_test.cc b/find_test.cc
index c9c86b2..e8d521c 100644
--- a/find_test.cc
+++ b/find_test.cc
@@ -18,6 +18,7 @@
#include <stdlib.h>
#include <unistd.h>
+
#include <string>
#include "fileutil.h"
diff --git a/ninja_test.cc b/ninja_test.cc
index 2a7fdc1..15b0693 100644
--- a/ninja_test.cc
+++ b/ninja_test.cc
@@ -14,10 +14,11 @@
// +build ignore
+#include "ninja.h"
+
#include <assert.h>
#include "log.h"
-#include "ninja.h"
#include "testutil.h"
namespace {
diff --git a/string_piece.cc b/string_piece.cc
index e739219..32a7be0 100644
--- a/string_piece.cc
+++ b/string_piece.cc
@@ -19,6 +19,8 @@
// +build ignore
+#include "string_piece.h"
+
#include <ctype.h>
#include <limits.h>
#include <stdint.h>
@@ -26,8 +28,6 @@
#include <algorithm>
#include <ostream>
-#include "string_piece.h"
-
typedef StringPiece::size_type size_type;
bool operator==(const StringPiece& x, const StringPiece& y) {
diff --git a/testcase/empty_target_specific_var.mk b/testcase/empty_target_specific_var.mk
index fd9e6c1..5683eb2 100644
--- a/testcase/empty_target_specific_var.mk
+++ b/testcase/empty_target_specific_var.mk
@@ -4,4 +4,4 @@ test: =foo
var==foo
$(var):
- echo PASS
+ echo FAIL
diff --git a/testcase/empty_target_specific_var2.mk b/testcase/empty_target_specific_var2.mk
index 6defb52..960a615 100644
--- a/testcase/empty_target_specific_var2.mk
+++ b/testcase/empty_target_specific_var2.mk
@@ -8,4 +8,4 @@ $(call var)
eq_one:==1
$(eq_one):
- echo PASS
+ echo FAIL
diff --git a/testcase/multiline_arg.mk b/testcase/multiline_arg.mk
index 1e64318..0bfdf01 100644
--- a/testcase/multiline_arg.mk
+++ b/testcase/multiline_arg.mk
@@ -1,3 +1,5 @@
+# TODO(c-ninja): We're exporting `(echo )` for the last line, while make a kati(w/o ninja) uses `echo \`
+
SHELL:=/bin/bash
define func
diff --git a/testcase/ninja_regen_filefunc_read.sh b/testcase/ninja_regen_filefunc_read.sh
index 7fc3a9f..01fb7e6 100755
--- a/testcase/ninja_regen_filefunc_read.sh
+++ b/testcase/ninja_regen_filefunc_read.sh
@@ -26,7 +26,11 @@ sleep_if_necessary() {
}
cat <<EOF > Makefile
+# Make 4.1 does not support file reading, which was added in 4.2
+# We don't actually care though, since we're just testing kati's regen
+ifdef KATI
A := \$(file <file_a)
+endif
all:
echo foo
EOF